Aligning Baselines of Different Objects

Igor Couto igor at pixelmedia.com.au
Sat Jun 28 00:28:00 EDT 2003


Dear Revolutionaries,

I wonder if anyone has a neat, simple way to vertically align the 
baseline of text in a pulldown menu, with the baseline of text in a 
field. My problem is the following:

PROBLEM:
I have 2 objects, a pulldown menu, and a field, side by side, on a 
card. The user has the option of changing the textSize of both, 
simultaneously, and when he/she does, both objects should resize to 
accomodate the text. The issue arises with the fact that the text in 
the pulldown menu is CENTRED vertically in along the height, while the 
text in the field is TOP ALIGNED. Even though both items have the SAME 
BORDER, SAME MARGINS, SAME TEXT SIZE, SAME FONT, ETC, the reported 
formattedHeight of both is different. Resizing them to their 
formattedHeigh (or even textSize), and then trying to align the 
top/bottom/center of the objects works for some text sizes, but not for 
others. So: how can I keep the baselines of the 2 objects aligned, when 
the textSize of the objects is changed?

If anyone has found a neat formula, or written a script, I would 
really, really appreciate some pointers!

Kind Regards,
--
Igor de Oliveira Couto
----------------------------------
igor at pixelmedia.com.au
----------------------------------




More information about the use-livecode mailing list