RE: windows sizing

new topic     » topic index » view thread      » older message » newer message

sixs at ida.net wrote:
> I was looking at automatically resizing the window to fit the screen, 
> but wondered is there a good way to put fields and buttons  in 
> relationship to the windows?
> 
> Jvandal

Most of the sizing and placement routines in win32lib allow you to 
specify relative values as well as explict values.

For example:

    setCtlPos(id, 0.10, 0.05)

will set a control's X/Y pixel position relative to its parent at 10% of 
the parent's width and 5% of its height. Thus if the window is 640 by 
400, this would set the control at 64,20.

This also works for sizing. 

   setCtlSize(id, 0.25, 0.15)

would set the width to 25% of 640 = 160 pixels,
   height = 15% of 400 = 60 pixels.

You can change the location and size in a Resize event handler for the 
window. 

There is also some routines available to move controls so that they 
align or resize relative to other controls. Look at the docs for 
alignControls() and sizeControls().   

I may have got these routine names wrong as I'm not on a machine that 
has win32lib installed. 

-----
Derek.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu