Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pageframe and Tab Sequence
Message
 
 
To
22/07/2005 02:26:34
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01034794
Message ID:
01035127
Views:
16
>Changing the order of combo's properties setting and the result changes.
>Fundamental it is the time when controlsource is evaluated,
>because here VFP has 1 bug.
>Example:
>
>PUBLIC oform1
>
>CREATE CURSOR VisCodes ( cCode_Description V(50), cCode_Value c(10))
>INSERT INTO VisCodes VALUES ( "EVENTS1","CODE1")
>INSERT INTO VisCodes VALUES ( "EVENTS2","CODE2")
>INSERT INTO VisCodes VALUES ( "EVENTS3","CODE3")
>INSERT INTO VisCodes VALUES ( "EVENTS4","CODE4")
>INSERT INTO VisCodes VALUES ( "EVENTS5","CODE5")
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>
>DEFINE CLASS form1 AS form
>
>
>	Top = 2
>	Left = 3
>	Height = 250
>	Width = 446
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>
>	ADD OBJECT pageframe1 AS pageframe WITH ;
>		ErasePage = .T., ;
>		PageCount = 2, ;
>		Top = 26, ;
>		Left = 20, ;
>		Width = 394, ;
>		Height = 189, ;
>		Name = "Pageframe1", ;
>		Page1.Caption = "Page1", ;
>		Page1.Name = "Page1", ;
>		Page2.Caption = "Page2", ;
>		Page2.Name = "Page2"
>		
>
>
>	PROCEDURE pageframe1.Page1.Activate
>		KEYBOARD '{TAB}' PLAIN CLEAR
>	ENDPROC
>
>	PROCEDURE pageframe1.Page2.Activate
>		KEYBOARD '{TAB}' PLAIN CLEAR
>	ENDPROC
>
>	PROCEDURE init
>		this.pageframe1.page1.AddObject("COMBO1","COMBO")
>		this.pageframe1.page1.COMBO1.Move(40,50)
>		this.pageframe1.page1.COMBO1.Visible = .T.
>		this.pageframe1.page2.AddObject("text1","textbox")
>		this.pageframe1.page2.text1.Move(150,40)
>		this.pageframe1.page2.text1.Visible = .T.
>
>ENDDEFINE
>
>
>DEFINE CLASS COMBO AS ComboBox
>
>	PROCEDURE Init
>		GO 3
>		SET MULTILOCKS on
>		CURSORSETPROP("Buffering",5)
>		ADDPROPERTY(m.this,"Items[1]")
>		SELECT cCode_Description, cCode_Value FROM VisCodes INTO ARRAY this.Items
>
>* this don't work
>                * this is a your error, because cCode_value is not a Listindex value
>		this.ControlSource = 'VisCodes.cCode_value'		
>		this.BoundTo	   = .t.
>		this.BoundColumn 	= 2
>		this.RowSourceType 	= 5
>		this.RowSource = "this.Items"
>                && but this is a VFP's bug because VFP don't evaluate this correctly
>		this.ControlSource = 'VisCodes.cCode_value'
>* this work  ( comment before block and uncomment this )
>*		this.BoundTo	   = .t.	&& before ControlSource
>*		this.ControlSource = 'VisCodes.cCode_value'		
>*		this.BoundColumn 	= 2
>*		this.RowSourceType 	= 5
>*		this.RowSource = "this.Items"
>		* comment this and it don't work
>*		this.ControlSource = 'VisCodes.cCode_value'
>		? this.ListIndex
>	ENDPROC	
>ENDDEFINE
>
Yes, I played with the settings yesterday and found that if you assign controlsource as a last step, it works. However, if you set it in design time, then set to an empty string, then assign it as the last step, it doesn't work. However, without keyboard my form works fine. Once I include keyboard command, it doesn't.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform