At 04:54 PM 1/1/2005, you wrote:
Hi all,
Have seen a few posts about how to rezize a stack to suit your screen size, here's how I did it!


Resizing the main stack to suit any screen size is quite simple really, the challenge comes when trying to keep all your fields in a relative size & position.
To resize a stack to any screen size I use the following code;


on preOpenStack
-- get users screen size -- left,top,width,height

   put the screenrect into tScreenSize

-- *Note: screenrect is the working size of the window NOT including borders.
-- For this reason we set the parameters as follows.

   set itemDel to ","
   put item 3 of tScreenSize into tWidth
   put item 4 of tScreenSize into tHeight
   set the rect of this stack to 2,28,tWidth-2,tHeight-4

end preOpenStack

2 puts the window 2 pixels from the left
28 puts the window 28 pixels from the top, this allows the window title bar to show.
tWidth-2 sets the overall window width to the screen size -2 pixels to allow the border to fit.
tHeight-4 sets the overall window height to the screen size -4 pixels to allow the border to fit.


This setting works well using windows XP but I haven't tested it on other OS'.

To manipulate fields etc. use; set the rect of fld "fieldname" to ?,?,tWidth-?,tHeight-?

Happy New Year!! ..... Dwayne


How do you apply the above theory the resize other object based on a percent of screen size?

image, label, button, etc?


Paul Salyers
PS1 - Senior Rep.
[EMAIL PROTECTED]
Http://ps1.SoftSeven.org


_______________________________________________
use-revolution mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to