Resizing a Text Field Dynamically, While Locking Its XY Coordinates

Ron Toledo rontoledo at gmail.com
Tue Jan 13 18:27:51 EST 2009


Hello All,

Thank you all very much; yes, the Rect property is definitely the way to
go.  I also got a similar response from Malte.  As I mentioned to him, it's
amazing to me (as a newbie, but longtime fan of Revolution) how elegant this
language is.  Imagine trying to purely code this in Adobe Flex, for example,
and the amount of lines of code it would require.

What I like is how few lines of code can give one just the results desired.
When I tried the Rect property and it worked perfectly, it was like magic!
Very cool, indeed.

Thank you again,
Ron

On Tue, Jan 13, 2009 at 2:30 PM, Sarah Reichelt <sarah.reichelt at gmail.com>wrote:

> > I'm experimenting with just the left text field and grabber icon at this
> > time.  My current challenge is that when I drag the grabber, the text
> field
> > on the left resizes in width-- however, it resizes from its centerpoint
> > outwards.  Ideally, I would want the text field's XY coordinates to
> remain
> > locked, while the right side of the text field resizes.
> >
> > Is there a property for Rev objects that can configure objects to resize
> > from one specific side?
>
>
> I adjust the rect of the object to do this. The rect has the four
> points of the object: left, top, right, bottom.
> A mnemonic for this that I was told once is "LiTteR Bug".
>
> Here is an example which increases the width of a field by 10 pixels,
> while keeping the topLeft of the field in the same place:
>
> put the rect of fld "My Field" into tRect
> add 10 to item 3 of tRect
> set the rect of fld "My Field" to tRect
>
> HTH,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list