Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you calculate the header height?
Message
De
12/11/1999 12:22:41
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00290365
Message ID:
00290633
Vues:
44
>Hi Roi (and Dan and Mike),
>
>Don't forget that there's more than 2 frame widths and that the title bar may be a half height. I had to deal with all of this stuff in Obj2Bmp. So...
>* Get the height of the border (frame)
>DO CASE
>  CASE oForm.BorderStyle = 0
>    * No Border
>    lnresult = 0
>  CASE oForm.BorderStyle = 1
>    * Fixed Single
>    lnresult = SYSMETRIC(11)
>  CASE oForm.BorderStyle = 2
>    * Fixed Double
>    lnresult = SYSMETRIC(13)
>  CASE oForm.BorderStyle = 3
>    * Sizeable
>    lnresult = SYSMETRIC(4)
>ENDCASE
>RETURN lnresult
>* Get the width of the border
>DO CASE
>  CASE oForm.BorderStyle = 0
>    * No Border
>    lnresult = 0
>  CASE oForm.BorderStyle = 1
>    * Fixed Single
>    lnresult = SYSMETRIC(10)
>  CASE oForm.BorderStyle = 2
>    * Fixed Double
>    lnresult = SYSMETRIC(12)
>  CASE oForm.BorderStyle = 3
>    * Sizeable
>    lnresult = SYSMETRIC(3)
>ENDCASE
>RETURN lnresult
>* The title bar height
>lnresult = 0
>IF loObject.TitleBar = 1
>  * It has a title bar
>  IF NOT oForm.HalfHeightCaption
>    * Normal Title Bar
>    lnresult = SYSMETRIC(9)
>  ELSE
>    * Half height title bar
>    * I've noted that half height's are 5 more pixels
>    * than exactly half
>    lnresult = ROUND((SYSMETRIC(9) / 2), 0) + 5
>  ENDIF
>ENDIF
>RETURN lnresult
I had a feeling the final calculation would be this complicated. Wouldn't it be nice if the objtoclient returned the screen position rather thant the form position if the current object was not within a container?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform