Page 1 of 1

scale field with window

Posted: Tue Dec 08, 2009 10:04 pm
by hamlynart
Hi folks,

I've not used Rev in a while now and I can't work out how to get a text field to dynamically scale (resize) with the window (stack). Any ideas?

Thanks a million

Jim H

Re: scale field with window

Posted: Tue Dec 08, 2009 10:11 pm
by bn
Hello Jim,

make one field and two buttons in a new stack. In the properties inspector under size set the minWidth to 600 and the minHeight to 500. Put this script into the stack or card

Code: Select all

on resizeStack tnewWidth, tNewHeight
   if tNewWidt < 600 or tNewHeight < 500 then exit resizeStack
   lock screen
   set the width of field 1 to tNewWidth - 100
   set the height of field 1 to tNewHeight - 110
   set the topleft of field 1 to 50,40
   put the bottom of field 1 into tFieldBottom
   set the top of button 1 to tFieldBottom +20
   set the top of button 2 to tFieldBottom +20
   set the right of button 2 to the right of field 1
   set the left of button 1 to the left of field 1 + 20
   set the scroll of field 1 to 100000 -- in case it is a scrolling field and you want to scroll it all the way down
   unlock screen
end resizeStack
the two buttons are at the bottom of the field and stay there.
Change/add what is needed.
regards
Bernd

Re: scale field with window

Posted: Tue Dec 08, 2009 10:31 pm
by hamlynart
Hi Bernd,

Blimey - absolutely perfect!

Thanks a million.

Jim H