TComboBox:bCloseUp doesn't work

TComboBox:bCloseUp doesn't work

Postby Enrico Maria Giordano » Thu Feb 16, 2006 11:30 am

This is the sample. I hear no beep when the dropdownlist is closed. Am I missing something?

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TComboBox:bCloseUp doesn't work

Postby Enrico Maria Giordano » Tue Feb 21, 2006 9:11 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Feb 21, 2006 7:07 pm

Enrico,

This fix solves the ESC close bug:
Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Feb 21, 2006 7:09 pm

Thank you. And what about the bCloseUp problem?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Tue Feb 21, 2006 7:24 pm

Enrico,

These changes are required for the CloseUp event fix:

In dialog.prg:
Code: Select all  Expand view  RUN
#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:
Code: Select all  Expand view  RUN
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:
Code: Select all  Expand view  RUN
    oCbx:bCloseUp = { || MsgInfo( "CloseUp Event" ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Tue Feb 21, 2006 8:02 pm

Thank you!

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests