Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: CTRL+0 on Boolean checkbox is wrong
Message
From
18/09/2005 14:13:43
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01050561
Message ID:
01050721
Views:
14
>>
>>Know, but CTRL+0 set 2.0, not NULL:
>
>That's documented behavior for numeric controlsource.

sure, 2 is the NULL state:


Tip:
After interacting with the check box, the user can return the check box to the original null state by pressing CTRL+0.


The writer go in confusion immediately:


Note:
If the ControlSource property is a field in a table that does not accept a null value, pressing CTRL+0 generates an error.


Of course the previous is wrong:
WITH NEWOBJECT("form1")
	.Show

	WAIT WINDOWS "Waiting: the controlsource don't support NULL" TIMEOUT 2

	KEYBOARD '{CTRL+0}' PLAIN CLEAR
	DOEVENTS

	WAIT WINDOWS "Look that a CTRL+0 show a dimmed check, without errors " TIMEOUT 10

ENDWITH

DEFINE CLASS form1 AS form


	SHOWWINDOW = 2
	Caption = "CTRL+0 on Boolean checkbox"
	Name = "Form1"


	ADD OBJECT check1 AS checkbox WITH ;
		Top = 72, ;
		Left = 94, ;
		Height = 17, ;
		Width = 60, ;
		Alignment = 0, ;
		Caption = "Check1", ;
		ControlSource = "SOME.CHECKF", ;
		Name = "Check1"


	ADD OBJECT text1 AS textbox WITH ;
		Enabled = .F., ;
		Height = 23, ;
		Left = 72, ;
		Top = 120, ;
		Width = 142, ;
		DisabledForeColor = RGB(0,0,255), ;
		NullDisplay = "NULL", ;
		Name = "Text1"


	PROCEDURE Load
		CREATE CURSOR SOME (CHECKF I NOT NULL)
		INSERT INTO SOME VALUES (1)
	ENDPROC


	PROCEDURE check1.REFRESH
		THISFORM.TEXT1.VALUE = THIS.VALUE
	ENDPROC


	PROCEDURE check1.InteractiveChange
		THISFORM.TEXT1.VALUE = THIS.VALUE
	ENDPROC

ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform