Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Spinner refuses to increase
Message
De
20/04/2006 16:46:49
 
 
À
20/04/2006 09:09:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01114924
Message ID:
01115149
Vues:
7
>This piece of code demonstrates a spinner that refuses to increase or decrease. The crucial part appears to be the instruction to refresh the form in the interactivechange method.
>
>Who has a clue? Is it a bug? Or am I the one who is doing something really stupid here.
>
>
local ox
>ox = createobject( 'form1' )
>ox.visible = .t.
>read events
>
>DEFINE CLASS form1 AS form
>
>	DoCreate = .T.
>	Caption = "Form1"
>	nEffe = 0
>	Name = "Form1"
>
>	ADD OBJECT spinner1 AS spinner WITH ;
>		Height = 24, ;
>		Left = 198, ;
>		Top = 72, ;
>		Width = 120, ;
>		ControlSource = "thisform.nEffe", ;
>		Name = "Spinner1"
>
>	PROCEDURE spinner1.InteractiveChange
>		thisform.refresh()
>	ENDPROC
>
>	procedure destroy
>		clear events
>	endproc
>
>ENDDEFINE
the controlsource is updated BEFORE the valid event, when you try to leave the spinner.

then
local ox
ox = createobject( 'form1' )
ox.visible = .t.
read events

DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	nEffe = 0
	Name = "Form1"

	ADD OBJECT spinner1 AS spinner WITH ;
		Height = 24, ;
		Left = 198, ;
		Top = 72, ;
		Width = 120, ;
		ControlSource = "thisform.nEffe", ;
		Name = "Spinner1"

	PROCEDURE spinner1.InteractiveChange
		SPINNER::SETFOCUS	&& force the ControlSource update
		thisform.refresh()
	ENDPROC

	procedure destroy
		clear events
	endproc

ENDDEFINE
Setfocus reset the SelStart position, this is a bug.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform