Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spinner refuses to increase
Message
From
20/04/2006 16:46:49
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01114924
Message ID:
01115149
Views:
8
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform