Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: Anchor vertical center with odd height
Message
 
 
À
07/03/2005 11:41:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00993310
Message ID:
00993579
Vues:
13
It's not a bug. Your assumption that shape is centered horizontaly from the beginning is incorrect. The shape center is one pixel closer to the top border of the form than to the bottom.

>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
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform