Adjusting a field size based upon its contents

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Nov 17 06:37:43 EST 2007


Hi Francis,

This is very simple:

set the height of fld x to the formattedHeight of fld x
set the width of fld x to the formattedWidth of fld x

or

set the rect of fld x to the formattedRect of fld x

I would store the topleft of the field before setting the rect and  
restore the topleft afterwards.

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Quickly extract data from your HyperCard stacks with DIFfersifier.  
http://differsifier.economy-x-talk.com


Op 17-nov-2007, om 12:17 heeft Francis Nugent Dixon het volgende  
geschreven:

> Hi from Paris,
>
> I have a hidden field that I want to display after I have put a  
> specific text in it. The text is of variable size.
>
> The size of field required is obviously based on the "textSize",  
> "textFont" and "number of characters" values. I need to set the  
> size of the field (rect) so that it is just big enough for the text  
> to be displayed.
>
> If I had a few days available, I could surely work out an algorithm  
> to do this, but I need to get the new version of my application out  
> of the door quickly.
>
> Has anybody come across this problem (and solved it) ?
>
> Many Thanks
>
> -Francis
>
>



More information about the use-livecode mailing list