Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: Anchor vertical center with odd height
Message
From
07/03/2005 11:41:46
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
BUG: Anchor vertical center with odd height
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00993310
Message ID:
00993310
Views:
57
I look this bug on VFP9 beta, today i have found a slice of free time for publish it.

Run this, and resize height:
* put 3, 5 , ... and the shape is moved, but the position is incorrect.
* Strangely, with an even number it is correct 

#DEFINE NNHEIGHT 1
PUBLIC oform1

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

DEFINE CLASS form1 AS form

	Top = 0
	Left = 0
	Height = NNHEIGHT 
	Width = 375
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT shape1 AS shape WITH ;
		Left = 48, ;
		Height = NNHEIGHT , ;
		Width = 100, ;
		Anchor = 512, ;
		Name = "Shape1"


	PROCEDURE shape1.Init
		DEBUGOUT "start centered",this.top+INT(this.height/2),INT(thisform.height/2)
	ENDPROC


	PROCEDURE shape1.Move ( nLeft, nTop, nWidth, nHeight )
		DEBUGOUT "expected equal",nTop+INT(m.nHeight/2),INT(thisform.height/2)
	ENDPROC

ENDDEFINE
Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform