FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TComboBox:bCloseUp doesn't work
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TComboBox:bCloseUp doesn't work
Posted: Thu Feb 16, 2006 11:30 AM
This is the sample. I hear no beep when the dropdownlist is closed. Am I missing something?

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oCbx, cVar := SPACE( 20 )

    DEFINE DIALOG oDlg

    @ 1, 1 COMBOBOX oCbx VAR cVar;
           ITEMS { "First", "Second", "Third" };
           STYLE CBS_DROPDOWN

    oCbx:bCloseUp = { || Tone( 440, 1 ) }

    @ 3, 1 BUTTON "&Close" ACTION oDlg:End()

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TComboBox:bCloseUp doesn't work
Posted: Tue Feb 21, 2006 09:11 AM

And I can't close the DIALOG using ESC key when the focus is on the combobox.

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TComboBox:bCloseUp doesn't work
Posted: Tue Feb 21, 2006 07:07 PM
Enrico,

This fix solves the ESC close bug:
METHOD KeyChar( nKey, nFlags ) CLASS TComboBox

   if nKey == VK_RETURN
      return ::oWnd:GoNextCtrl( ::hWnd )
   endif
   
return Super:KeyChar( nKey, nFlags )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TComboBox:bCloseUp doesn't work
Posted: Tue Feb 21, 2006 07:09 PM

Thank you. And what about the bCloseUp problem?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TComboBox:bCloseUp doesn't work
Posted: Tue Feb 21, 2006 07:24 PM
Enrico,

These changes are required for the CloseUp event fix:

In dialog.prg:
#define CBN_CLOSEUP        8
...
METHOD Command( nWParam, nLParam ) CLASS TDialog
   ...
              case nNotifyCode == CBN_SELCHANGE
                   SendMessage( hWndCtl, FM_CHANGE, 0, 0 )

              case nNotifyCode == CBN_CLOSEUP // New! 
                   SendMessage( hWndCtl, FM_CLOSEUP, 0, 0 )


In combobox.prg:
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TComboBox

   if nMsg == FM_CLOSEUP
      return ::CloseUp()
   endif
   
return Super:HandleEvent( nMsg, nWParam, nLParam )


In your sample change this:
    oCbx:bCloseUp = { || MsgInfo( "CloseUp Event" ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TComboBox:bCloseUp doesn't work
Posted: Tue Feb 21, 2006 08:02 PM

Thank you!

EMG

Continue the discussion