Re: Windows values??
- Posted by Derek Parnell <ddparnell at bigpond.com> May 20, 2004
- 430 views
cklester wrote: > > > Derek Parnell wrote: > > > > > > When values between 0 and 1 are used, it refers to the fraction > > corresponding parent dimension. In your example, you are specify a > > Window whose left edge begins 20% (0.2) of the screen width, and > > the top edge is 20% of the screen height, and the width is 60% of > > the screen width and height is 60% of the screen height. So if your > > screen is 800x600 pixels your specification is equivalent to ... > > > > create(Window, winName, 0, 160, -- 20% of 800 > > 120, -- 20% of 600 > > 480, -- 60% of 800 > > 360, -- 60% of 600 > > 0) > > > > There are even more variations available for specifying relative > > dimensions. Check out the documentation for the create() routine. > > Derek, do the "child" controls maintain their relative size and > position when the parent control changes its dimensions? No. This is only the initial dimensions. To do auto resizing you can trap the resize event for the parent and then call setRect() for those controls you need to reposition. eg... procedure Resize_MainWin(integer self, integer event, sequence parms) setRect(fld1, 0.2, 0.2, 0.6, 25, 1) setRect(fld2, {w32AltEdge,-40}, 5, 40, 0.25, 1) end procedure setHandler(MainWin, w32HResize, routine_id("Resize_MainWin")) -- Derek Parnell Melbourne, Australia