Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG in CheckBox, Click,Space and MouseWheel not equal
Message
De
19/04/2004 18:59:27
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
19/04/2004 06:49:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00896057
Message ID:
00896301
Vues:
32
What you are seeing is not unique to checkboxes; it's a (partial) disconnect between the "current" control's screen image (.value) and it's controlsource.

There are only certain events that "load" the controlsource ("departing" is one).

When a (updated) control has focus, and you run a "hot key", it is often necessary to do a: [currentcontrol].value = [currentcontrol].value in order to sync the "display image" (.value) with the controlsource.

Put THIS.Value = THIS.Value in .Click and the problem should disappear.

One reason this is so, is that even if a user has typed in a control (and not "departed"), it is still possible to do a ".Refresh", which will copy the contents of the controlsource to .value. (and wipe out the User's keystrokes with the original value).

>On a checkBox you can change the value with:
>- Click
>- press SPACE
>- MouseWheel
>
>All 3 modes fire:
>
>....
>InteractiveChange
>Click
>....
>
>
>but on Click the status is not equal,
>because only with Click VFP update the binded ControlSource
>after InteractiveChange and before Click.
>
>The result is that Click is specific for true click event.
>
>repro:
>- use Click,SPACE and MouseWheel for change the CheckBox
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>
>	DoCreate = .T.
>	Caption = "Form1"
>	AllowOutput = .F.
>	Name = "Form1"
>
>	ADD OBJECT check1 AS checkbox WITH ;
>		Top = 53, ;
>		Left = 41, ;
>		Height = 17, ;
>		Width = 60, ;
>		Caption = "Check1", ;
>		ControlSource = "mmCursor.fLogic", ;
>		Name = "Check1"
>
>
>	PROCEDURE Load
>		CREATE CURSOR mmCursor ( fLogic L)
>		APPEND BLANK
>		CLEAR
>	ENDPROC
>
>	PROCEDURE check1.Click
>		? m.This.Value,EVALUATE(m.This.ControlSource);
>		,IIF(m.This.Value=EVALUATE(m.This.ControlSource),'   ===> EQUAL','  ===> NOT EQUAL')
>	ENDPROC
>
>ENDDEFINE
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform