Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh gets aborted by ZOrder
Message
From
14/10/2015 13:18:20
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01625937
Message ID:
01625943
Views:
57
>This is a crude repro of the issue, sorry is not very good but I did it quickly but it shows the problem (commenting out ZOrder in the refresh of the myOtherContainer class will refresh properly).
>
>
>loForm			= CREATEOBJECT('myForm')
>loForm.Show(1)
>
>define class myForm as Form
>	add object myContainer as Container with width = 120, height = 25, border = 0
>	add object myButton as CommandButton with Caption = 'Refresh', left = 2, top = 40
>	
>	procedure myButton.Click() as VOID
>		thisform.Refresh()
>		return null
>	endproc
>	
>	function init() as Boolean
>		local lnCount
>		for lnCount = 1 to 10
>			lcName			= SYS(2015)
>			thisform.myContainer.newobject(lcName, 'myOtherContainer')
>			with getpem(thisform.myContainer,lcName)
>				.Width			= 10
>				.Height			= 14
>				.Left			= 2 + (lnCount - 1) * .Width
>				.Top			= 2
>				.Visible		= .t.
>			endwith
>		next lnCount
>		return .t.
>	endfunc
>enddefine
>
>define class myOtherContainer as Container
>	add object myLabel as label with Caption = '*', left = 1, top = 1, border=0
>	procedure Refresh() as VOID
>		this.myLabel.Caption = IIF(this.myLabel.Caption = '*', 'I', 'R')
>		this.ZOrder(0)
>		return null
>	endproc
>enddefine
>
If I remember correctly, Label.Caption in some cases is not drawn.
try
>define class myOtherContainer as Container
>	add object myLabel as label with Caption = '*', left = 1, top = 1, border=0
>	procedure Refresh() as VOID
>		this.myLabel.Caption = IIF(this.myLabel.Caption = '*', 'I', 'R')
>		Container::Refresh
>	endproc
>enddefine
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform