Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: setfocus on disabled group with member.when
Message
From
08/10/2005 09:59:02
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Title:
BUG: setfocus on disabled group with member.when
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01057443
Message ID:
01057443
Views:
47
Observed: when a membergroup of (commandgroup or optiongroup)
have the method "when" linked ( a * command is sufficient ),
the member.Setfocus ignore the parent.Enabled = .F.

Repro:
run
click on the four buttons

observe:
when the method "when" it is executed,
VFP ignores the fact that the group is disabled,
and move the focus on the member control.
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	Height = 268
	Width = 375
	Autocenter = .T.

	ADD OBJECT commandgroup1 AS commandgroup WITH ;
		ButtonCount = 2, ;
		Value = 1, ;
		Enabled = .F., ; && disabled
		Height = 42, ;
		Left = 114, ;
		Top = 20, ;
		Width = 234, ;
		Name = "Commandgroup1", ;
		Command1.Top = 5, ;
		Command1.Left = 5, ;
		Command1.Height = 27, ;
		Command1.Width = 84, ;
		Command1.Caption = "WHEN", ;
		Command1.Name = "Command1", ;
		Command2.Top = 6, ;
		Command2.Left = 98, ;
		Command2.Height = 27, ;
		Command2.Width = 84, ;
		Command2.Caption = "Command2", ;
		Command2.Name = "Command2"


	ADD OBJECT command3 AS commandbutton WITH ;
		Top = 28, ;
		Left = 18, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "click", ;
		Name = "Command3"


	ADD OBJECT optiongroup1 AS optiongroup WITH ;
		ButtonCount = 2, ;
		Value = 1, ;
		Enabled = .F., ; && disabled
		Height = 30, ;
		Left = 114, ;
		Top = 156, ;
		Width = 234, ;
		Name = "Optiongroup1", ;
		Option1.Caption = "WHEN", ;
		Option1.Value = 1, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Top = 5, ;
		Option1.Width = 61, ;
		Option1.Name = "Option1", ;
		Option2.Caption = "Option2", ;
		Option2.Height = 17, ;
		Option2.Left = 116, ;
		Option2.Top = 6, ;
		Option2.Width = 61, ;
		Option2.Name = "Option2"


	ADD OBJECT command4 AS commandbutton WITH ;
		Top = 158, ;
		Left = 18, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "click", ;
		Name = "Command4"


	ADD OBJECT commandgroup2 AS commandgroup WITH ;
		ButtonCount = 2, ;
		Value = 1, ;
		Enabled = .F., ; && disabled
		Height = 42, ;
		Left = 114, ;
		Top = 82, ;
		Width = 234, ;
		Name = "Commandgroup2", ;
		Command1.Top = 5, ;
		Command1.Left = 5, ;
		Command1.Height = 27, ;
		Command1.Width = 84, ;
		Command1.Caption = "NO WHEN", ;
		Command1.Name = "Command1", ;
		Command2.Top = 6, ;
		Command2.Left = 98, ;
		Command2.Height = 27, ;
		Command2.Width = 84, ;
		Command2.Caption = "Command2", ;
		Command2.Name = "Command2"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 90, ;
		Left = 18, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "click", ;
		Name = "Command1"


	ADD OBJECT optiongroup2 AS optiongroup WITH ;
		ButtonCount = 2, ;
		Value = 1, ;
		Enabled = .F., ; && disabled
		Height = 30, ;
		Left = 114, ;
		Top = 208, ;
		Width = 234, ;
		Name = "Optiongroup2", ;
		Option1.Caption = "NO WHEN", ;
		Option1.Value = 1, ;
		Option1.Height = 17, ;
		Option1.Left = 5, ;
		Option1.Top = 5, ;
		Option1.Width = 97, ;
		Option1.Name = "Option1", ;
		Option2.Caption = "Option2", ;
		Option2.Height = 17, ;
		Option2.Left = 120, ;
		Option2.Top = 8, ;
		Option2.Width = 61, ;
		Option2.Name = "Option2"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 210, ;
		Left = 18, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "click", ;
		Name = "Command2"


	PROCEDURE commandgroup1.Command1.When
		*
	ENDPROC

	PROCEDURE optiongroup1.Option1.When
		*
	ENDPROC

	PROCEDURE command3.Click
		thisform.Commandgroup1.command1.SetFocus
	ENDPROC

	PROCEDURE command4.Click
		thisform.optiongroup1.option1.SetFocus
	ENDPROC

	PROCEDURE command1.Click
		thisform.Commandgroup2.command1.SetFocus
	ENDPROC

	PROCEDURE command2.Click
		thisform.optiongroup2.option1.SetFocus
	ENDPROC

ENDDEFINE
Reply
Map
View

Click here to load this message in the networking platform