TComboBox

TComboBox

Postby Enrico Maria Giordano » Sat Jun 07, 2008 11:06 am

In the following sample, VALID clause is not fired when the combobox losts the focus:

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;
           VALID ( MSGINFO( "Valid" ), .T. )

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

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


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

Re: Bug in TComboBox

Postby Ugo » Sat Jun 07, 2008 11:51 pm

Enrico Maria Giordano wrote:In the following sample, VALID clause is not fired when the combobox losts the focus

Enrico,
not fired when the combobox lost the focus but fired when the button lost the focus! :shock:
Ciao, best regards,
Ugo
User avatar
Ugo
 
Posts: 283
Joined: Sat Oct 15, 2005 6:40 am
Location: Turin, Italy

Postby Colin Wisbey » Sun Jun 08, 2008 5:20 am

Enrico,

I'm afraid I can't help. I gave up on valid's with comboboxes about 10 years ago after raising the problem many times. I came up with a fix back then (IIRC it required change to CONTROL and also to DEFAULT method in COMBOBOX.prg) but I can no longer find it and it got broken in a subsequent upgrade anyway. I'm not convinced valid on a combobox (without modifications) has ever completely worked (although I could be wrong).

As an aside, although I can confirm the bug you reported, I suggest you avoid using MSGINFO() to test for a VALID as that can shift the focus to the MSGINFO(). I use something like MSGBEEP() instead.
Colin Wisbey
 
Posts: 56
Joined: Mon Jul 03, 2006 2:34 am

Postby Enrico Maria Giordano » Sun Jun 08, 2008 12:56 pm

No problem friends. I reported it only for Antonio. I don't need that fix at all.

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

Postby James Bott » Sun Jun 08, 2008 6:11 pm

Theoretically it seems one would not need to validate a combobox selection since only valid options are available in the list.

If you need to call a codeblock for some other use, perhaps you could use bLostFocus.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Sun Jun 08, 2008 6:13 pm

Please note that the combobox in my sample is a CBS_DROPDOWN one.

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

Postby James Bott » Mon Jun 09, 2008 6:59 am

Enrico,

>Please note that the combobox in my sample is a CBS_DROPDOWN one.

Ops!

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA



Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 13 guests