Bug in TComboBox

Bug in TComboBox

Postby Enrico Maria Giordano » Thu Dec 28, 2006 6:00 pm

Valid clause is evaluated on gotfocus instead of lostfocus in CBS_DROPDOWN combos:

Code: Select all  Expand view
#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;
           VALID ( MSGINFO( "Valid" ), .T. )

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

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


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

Postby Antonio Linares » Sat Dec 30, 2006 8:51 am

Enrico,

The problem is that when CBS_DROPDOWN style is used a Get is created as a child of the combobox, and when the combobox gets the focus, it gives it to the Get, thats why the bValid is fired.

We have tried to modify the code this way:

oCbx:oGet:bValid = { || MsgInfo(), .t. }

but the wrong behavior persists. We may need to review the Class combobox to see if we can improve it.
regards, saludos

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

Postby Enrico Maria Giordano » Sat Dec 30, 2006 9:16 am

Thank you.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests

cron