1. Windows values??

Ola!,
I am wondering  about the values that can be fed to create Windows.
The first create is using whole numbers

constant MyWin = createEx( Window, "", 0, Default, Default, 548, 432, 0, 0 )
This create is using  decimal values.
constant  Window1  = create(Window, winName, 0,0.2 ,0.2,0.6,0.6,0)
What is windows doing with the two values. 
Jvandal

new topic     » topic index » view message » categorize

2. Re: Windows values??

sixs wrote:
> 
> Ola!,
> I am wondering  about the values that can be fed to create Windows.
> The first create is using whole numbers
> 
> constant MyWin = createEx( Window, "", 0, Default, Default, 548, 432, 0, 0 )
> This create is using  decimal values.
> constant  Window1  = create(Window, winName, 0,0.2 ,0.2,0.6,0.6,0)
> What is windows doing with the two values. 
> Jvandal

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 Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

3. Re: Windows values??

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?

new topic     » goto parent     » topic index » view message » categorize

4. Re: Windows values??

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, that's what Don Phillips' xControls is for!

new topic     » goto parent     » topic index » view message » categorize

5. Re: Windows values??

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: Windows values??

Jonas Temple wrote:
> 
> cklester wrote:
> > 
> > Derek, do the "child" controls maintain their relative size and
> > position when the parent control changes its dimensions?
> 
> No, that's what Don Phillips' xControls is for!

Yeah, I know! I just thought maybe Derek had made it a built-in feature. :)

new topic     » goto parent     » topic index » view message » categorize

7. Re: Windows values??

cklester wrote:
> 
> 
> Jonas Temple wrote:
> > 
> > cklester wrote:
> > > 
> > > Derek, do the "child" controls maintain their relative size and
> > > position when the parent control changes its dimensions?
> > 
> > No, that's what Don Phillips' xControls is for!
> 
> Yeah, I know! I just thought maybe Derek had made it a built-in feature. :)

Its on the TODO list. 

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

8. Re: Windows values??

Derek Parnell wrote:
> cklester wrote:
> > Jonas Temple wrote:
> > > 
> > > cklester wrote:
> > > > 
> > > > Derek, do the "child" controls maintain their relative size and
> > > > position when the parent control changes its dimensions?
> > > 
> > > No, that's what Don Phillips' xControls is for!
> > 
> > Yeah, I know! I just thought maybe Derek had made it a built-in feature. :)
> 
> Its on the TODO list. 
> 
> -- 
> Derek Parnell
> Melbourne, Australia
> 

WOW, so we'll be looking forward to bloat akin to MS visual basic or
something... can't wait.  I guess the art of using Win32Lib will soon
become one of knowing what it can do as opposed to what it can't do.  I
hope you're keeping up on the docs because I used to be able to just view 
source to know what was going on.  Good luck with the next round of bug
reports when (if) you get these next releases out... (you don't work for
MS, do you?  Because I'm still waiting for Cairo, too).
http://c2.com/cgi/wiki?MicrosoftCairo

-- Brian
(can I be more pessimistic? absolutely.)

new topic     » goto parent     » topic index » view message » categorize

9. Re: Windows values??

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
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu