Aligning Baselines of Different Objects

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


Dear Ken,

Thank you for the suggestion!

On Sunday, June 29, 2003, at 08:05  AM, Ken Ray wrote:

> Could you set the margins of the field to match the "margins" of the 
> button
> and then adjust them accordingly? That is, if the button when it 
> resizes
> gets a virtual top and bottom margin of 6, couldn't you set the 
> margins of
> the corresponding field to 0,6,0,6 ?
>

I had already tried that! - unfortunately, it does not work. Try this 
(it's very quick):

Once again: the MARGINS and BORDERWIDTH of both the button and the 
field are the same. Try it for yourself:

1) Make a new pulldown menu (button). Its label will read: "Button 1". 
Set its height and width to 'formatted'.

2) Place a new field next to it ("field 1"). Enter the text "Button 1" 
into the field.

If you use the messageBox to check the margins and the borderWidth of 
the button, you will see that they are:

the margins: 4
the borderWidth: 2

3) set the margins and the borderWidth of field "Field 1" to match 
those of the button.

OK, now try aligning the baselines of the text in both objects.

If you align the 'tops', it doesn't work.
If you align the 'bottoms', it doesn't work.
If you align the 'yLoc' (vertical center), it doesn't work.

Of course, some of these options will work when the text on both 
objects is a certain size, but none will work for ALL text sizes. I 
need to find a way/formula that can align the baselines whatever the 
textSize of both objects is - note: the textSize of both the button and 
the field will ALWAYS be the same...

Any suggestions, anyone?
--
Igor
----------------------------------
igor at pixelmedia.com.au
----------------------------------




More information about the use-livecode mailing list