Combobox change events

Combobox change events

Postby DonDrew » Fri Mar 25, 2011 3:17 pm

I'm having a problem controlling the behavior of a combobox change event response.

Every time I update the array of list items, oClaim_Num:SetItems( aClaims ), the change event response is triggered. Is there any way I can restrict the change response to user input only?

Don
Last edited by DonDrew on Sat Mar 26, 2011 12:20 pm, edited 1 time in total.
DonDrew
 
Posts: 63
Joined: Mon Aug 02, 2010 5:38 pm

Re: Combobox change events

Postby anserkk » Fri Mar 25, 2011 5:27 pm

Code: Select all  Expand view
bChange:=oDbCombo:bChange
oDbCombo:bChange:=NIL
oDbCombo:SetItems(aMyNewArray)
oDbCombo:bChange:=bChange


Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Combobox change events

Postby DonDrew » Sat Mar 26, 2011 12:14 pm

Regretably that didn't change anything.

Thanks for your help.

Don
DonDrew
 
Posts: 63
Joined: Mon Aug 02, 2010 5:38 pm

Re: Combobox change events

Postby James Bott » Sun Mar 27, 2011 12:43 am

Don,

If you do this do you hear a beep?

oCombo:bChange:=msgbeep()
oCombo:SetItems(aMyNewArray)
oCombo:bChange:=nil

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

Re: Combobox change events

Postby DonDrew » Sun Mar 27, 2011 6:48 am

Yes.
DonDrew
 
Posts: 63
Joined: Mon Aug 02, 2010 5:38 pm

Re: Combobox change events

Postby Enrico Maria Giordano » Mon Mar 28, 2011 8:19 am

James Bott wrote:oCombo:bChange:=msgbeep()


It should be

Code: Select all  Expand view
oCombo:bChange:={ || msgbeep() }


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

Re: Combobox change events

Postby James Bott » Mon Mar 28, 2011 2:56 pm

Yes, of course.

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

Re: Combobox change events

Postby Daniel Garcia-Gil » Tue Apr 05, 2011 2:45 pm

DonDrew wrote:I'm having a problem controlling the behavior of a combobox change event response.

Every time I update the array of list items, oClaim_Num:SetItems( aClaims ), the change event response is triggered. Is there any way I can restrict the change response to user input only?

Don



Hello... you can try this change in the class

Code: Select all  Expand view

   METHOD Reset( lChanged ) INLINE Eval( ::bSetGet,;                                                    
                         If( ValType( Eval( ::bSetGet ) ) == "N", 0, "" ) ),;                            
                         ::nAt := 0, ::SendMsg( CB_RESETCONTENT ),;                                      
                         if( ( lChanged != NIL .and. lChanged ) .or. ( lChanged == NIL ), ::Change(), )  


   METHOD SetItems( aItems, lChanged ) INLINE ::Reset( lChanged ), ::aItems := aItems,;
                                    ::Default(),;
                                    if( ( lChanged != NIL .and. lChanged ) .or. ( lChanged == NIL ), ::Change(), )

 


use oClaim_Num:SetItems( aClaims, .F. )
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin for Harbour/xHarbour

Who is online

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