Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New BUG: ListBox on page and Click event
Message
From
27/12/2005 16:53:44
 
 
To
27/12/2005 10:11:30
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01080960
Message ID:
01081125
Views:
23
Great job demonstrating the bug as well as two possible workarounds Fabio. Thanks for sharing!


>This is a reproduction of the new problem found in VFP9,
>when some ListBoxes are used into a PageFrame.
>This bug is not present in VFP8.
>
>You can use the spinners to move the Page2's listbox;
>the red box show where the listbox is found.
>
>This show that VFP doesn't produce the event Click when him click
>in the red panel.
>
>
>In the code they are present two possible workarounds.
>
>
>*#DEFINE WORKAROUND1
>*#DEFINE WORKAROUND2
>
>
>#IFDEF WORKAROUND2
>	#UNDEFINE WORKAROUND1
>#ENDIF
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>
>DEFINE CLASS form1 AS form
>
>	Height = 391
>	Width = 556
>	Autocenter = .T.
>	Caption = "Use spinners for move the page2's listbox. Red dotted box show it"
>	DrawStyle = 2
>	ForeColor = RGB(255,0,0)
>	BindControls	= .F.
>	
>	ADD OBJECT timer1 AS timer WITH ;
>		Interval = 600
>
>	ADD OBJECT spinner1 AS spinner WITH ;
>		Left = 42, ;
>		Top = 8, ;
>		Width = 78, ;
>		ControlSource = "THISFORM.Pageframe1.Page2.Lbox2.Left"
>
>
>	ADD OBJECT spinner2 AS spinner WITH ;
>		Left = 149, ;
>		Top = 8, ;
>		Width = 78, ;
>		ControlSource = "THISFORM.Pageframe1.Page2.Lbox2.Top"
>
>	ADD OBJECT label1 AS label WITH ;
>		Caption = "Left", ;
>		Top = 12, ;
>		Width = 22
>		
>	ADD OBJECT label2 AS label WITH ;
>		Caption = "Top", ;
>		Left = 123, ;
>		Top = 12, ;
>		Width = 23
>
>	ADD OBJECT label3 AS label WITH ;
>		Caption = "Width", ;
>		Left = 230, ;
>		Top = 12, ;
>		Width = 33
>
>
>	ADD OBJECT label4 AS label WITH ;
>		Caption = "Height", ;
>		Left = 347, ;
>		Top = 12, ;
>		Width = 38
>
>
>	ADD OBJECT spinner3 AS spinner WITH ;
>		Left = 266, ;
>		Top = 8, ;
>		Width = 78, ;
>		ControlSource = "THISFORM.Pageframe1.Page2.Lbox2.Width"
>
>
>	ADD OBJECT spinner4 AS spinner WITH ;
>		Left = 388, ;
>		Top = 8, ;
>		Width = 78, ;
>		ControlSource = "THISFORM.Pageframe1.Page2.Lbox2.Height"
>
>
>	ADD OBJECT pageframe1 AS pageframe WITH ;
>		PageCount = 2, ;
>		Top = 37, ;
>		Left = 7, ;
>		Width = 546, ;
>		Height = 352
>
>	PROCEDURE PageFrame1.page1.Init
>		this.AddObject("list1","listbox")
>		WITH this.list1
>		FOR K=1 TO ALANGUAGE(AL,1)
>			.AddItem(AL[m.k])
>		next
>		.Visible = .Move(51,38,134,226)
>		ENDWITH
>		=BINDEVENT(this.List1,"click",thisform,"list1_Click")
>		
>	PROCEDURE PageFrame1.page2.Init
>		this.AddObject("lbox2","listbox")
>		WITH this.lbox2
>		.Move(0,156,131,162)
>#IFNDEF WORKAROUND2
>		.Visible = .T.
>#ELSE
>		=BINDEVENT(this.lbox2,"uienable",thisform,"list2_uienable")
>#ENDIF
>		ENDWITH
>
>	PROCEDURE Init
>		this.BindControls = .T.
>
>	PROCEDURE list2_uienable(YES)
>		AEVENTS(AV,0)
>		AV[1].Visible = m.YES
>	ENDPROC
>	
>	PROCEDURE list1_Click
>		WAIT WINDOW "Click" NOWAIT TIMEOUT 3
>	ENDPROC
>	
>	PROCEDURE Refresh
>		NODEFAULT
>		WITH THISFORM.Pageframe1
>
>		.Page1.REFRESH
>#IFDEF WORKAROUND1
>		.Page2.LBox2.REFRESH
>#ELSE
>		.Page2.REFRESH
>#ENDIF
>		this.themes = .t.
>		Form::Draw
>
>		lb=.Page2.LBox2
>
>		thisform.Box(OBJTOCLIENT(m.lb,2),OBJTOCLIENT(m.lb,1),OBJTOCLIENT(m.lb,2)+OBJTOCLIENT(m.lb,3)-1,OBJTOCLIENT(m.lb,1)+OBJTOCLIENT(m.lb,4)-1)
>		ENDWITH
>	ENDPROC
>
>
>	PROCEDURE Paint
>		thisform.timer1.Reset
>	ENDPROC
>
>
>	PROCEDURE spinner1.InteractiveChange
>		this.Value = this.value
>		thisform.Refresh
>	ENDPROC
>
>
>	PROCEDURE spinner2.InteractiveChange
>		this.Value = this.value
>		thisform.Refresh
>	ENDPROC
>
>
>	PROCEDURE spinner3.InteractiveChange
>		this.Value = this.value
>		thisform.Refresh
>	ENDPROC
>
>
>	PROCEDURE spinner4.InteractiveChange
>		this.Value = this.value
>		thisform.Refresh
>	ENDPROC
>
>	PROCEDURE timer1.Timer
>		thisform.refresh
>	ENDPROC
>
>ENDDEFINE
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform