Re: Windows values??
- Posted by "Patrick Barnes" <mistertrik at hotmail.com> May 20, 2004
- 446 views
Or, to do automatic resizing, check out my autosizing library in the archive...</plug> http://www.rapideuphoria.com/autosize-1.1.zip ------------------------------------------------------------------------ magnae clunes mihi placent, nec possum de hac re mentiri. >From: Derek Parnell <guest at RapidEuphoria.com> >Reply-To: EUforum at topica.com >To: EUforum at topica.com >Subject: Re: Windows values?? >Date: Wed, 19 May 2004 19:48:26 -0700 > > >posted by: Derek Parnell <ddparnell at bigpond.com> > >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 > > > >