Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatical label's width
Message
From
03/05/1998 04:27:11
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
01/05/1998 20:01:39
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00096378
Message ID:
00096576
Views:
16
>Cetin already told you about Autosize property... This works fine if the form is visible, the screen is not locked, etc. But it doesn't work if label is not visible yet.
>
>If you want to know the width of a text without having a visible label, use the Form.TextWidth() method. (BTW, the _SCREEN variable also has this method...)
>
>And as a recommendation, not a must, use pixels, not foxels. Usually, things get simplier with pixels on a long term.

It seems I've already done what could be done. Textwidth() is obviously giving me the correct pixel size, it's just the matter of recalculating it into foxels.

In all graphical systems I've used so far I've opted for vector against bitmap. It's more precise and scalable. My favorite solution for that is using just foxels and setting the fontsize before showing the form. It all works fine, and I don't have to worry about resizing - just about sizing :). That's my pros, and you're right about the cons. Making it simpler, it sure does, but... well, this is OOP. Any problem vanishes if its solution can be stuffed into a class - it distributes nicely afterwards.

Of course, showing it all and then setting the properties (with .autosize going last) is not useful in my case - I'm building, say, three labels, three textboxes and then checking for their widths, then aligning them row by row, positioning the yes/no commandgroup below them, resizing the form so it all fits, and then centering the form, and then showing it all. If it had to be visible to work, the user would have to watch controls dancing around every time. No way to go this time.

So, I'll rephrase my question: how do I recalculate pixels into foxels? If it's not FONTMETRIC(6, g_FontName, g_FontSize), then what is?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform