Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: Spinner not force numeric type and VFP go in panic
Message
From
19/04/2004 13:13:09
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00895957
Message ID:
00896206
Views:
22
You say this:
VFP6 not support Property for ControlSource

This is not true,
VFP6 support Property into ControlSource,
and Null property too,
but not support a property set to NULL into a Spinner.
PUBLIC oform1

oform1=CREATEOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


DoCreate = .T.
Caption = "Form1"
myproperty = 1 && with a NOT NULL the spinner can live, but if you press a CTRL+0, it dead
Name = "form1"

ADD OBJECT spinner1 AS spinner WITH ;
Height = 24, ;
Left = 24, ;
Top = 14, ;
Width = 121, ;
ControlSource = "thisform.myproperty", ;
NullDisplay = "Fabio Null", ;
Name = "Spinner1"


ADD OBJECT command1 AS commandbutton WITH ;
Top = 13, ;
Left = 156, ;
Height = 27, ;
Width = 84, ;
Caption = "Other focus", ;
Name = "Command1"


ADD OBJECT command2 AS commandbutton WITH ;
Top = 51, ;
Left = 29, ;
Height = 27, ;
Width = 84, ;
Caption = "Release", ;
BackColor = RGB(255,255,0), ;
Name = "Command2"


ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
FontSize = 15, ;
Alignment = 2, ;
BorderStyle = 1, ;
Caption = "Press Esc To Force Exit", ;
Height = 26, ;
Left = 126, ;
Top = 53, ;
Width = 216, ;
ForeColor = RGB(255,0,0), ;
BackColor = RGB(255,255,0), ;
Name = "Label1"

PROCEDURE Unload
ON ERROR 
ON KEY LABEL ESC
ENDPROC

PROCEDURE Load
* without next line you go into a panic status, and you must kill VFP
*ON ERROR MESSAGEBOX(MESSAGE())
* with ON ERROR you can close the window only with a CLEAR ALL
ON KEY LABEL ESC CLEAR ALL
ENDPROC

PROCEDURE command2.Click
* this is ignored
thisform.release
RELEASE WINDOWS (m.this.Name)
ENDPROC

PROCEDURE spinner1.InteractiveChange
this.Value = this.Value
WAIT WINDOWS tran(EVALUATE(m.this.ControlSource)) NOWAIT NOCLEAR
ENDPROC

PROCEDURE spinner1.Destroy
WAIT CLEAR
ENDPROC

ENDDEFINE
- run
- change the spinner value, Property is updated ok
- put a CTRL+0
- now the Property is fixed to NULL
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform