Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh gets aborted by ZOrder
Message
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:
01625941
Views:
51
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
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform