PureRESIZE library

Overview

Automatically resizing gadgets, monitoring window size and position (PB 4.xx version).

Functions

PureRESIZE_SetGadgetResize(GadgetNumber.l, Locked_Left.l, Locked_Top.l, Locked_Right.l, Locked_Bottom.l [, ParentGadget.l])

Select gadget to be automatically resized [Locked_* : #True/#False].

The gadget is automatically resized after a #WM_SIZE event.

Parameters :

- GadgetNumber : valid Purebasic gadget number ; it may also be a valid Windows control handle, this allows to use the library with 'API gadgets' created with CreateWindowEx_().
- Locked_Left : set left anchor
- Locked_Top : set top anchor
- Locked_Right : set right anchor
- Locked_Bottom : set bottom anchor

Optional parameter ParentGadget :

By default, the gadget is resized when his window is resized. If a parent gadget is specified, the gadget is resized when the parent gadget is resized.
This is very usefull when working with container and splitter gadgets. 

Return codes  :

#PureRESIZE_Ok = 1 ; Success
#PureRESIZE_NotAGadget = 2 ; The specified gadget does not exist
#PureRESIZE_NotAWindow = 3 ; The specified window does not exist
PureRESIZE_SetGadgetProportionalResize(GadgetNumber.l, Prop_Width.l, Prop_Height.l [, Lock_Width.l [, Lock_Height.l]])

Enables proportional resizing for a gadget.

Parameters :

- GadgetNumber : valid Purebasic gadget number ; it may also be a valid Windows control handle, this allows to use the library with 'API gadgets' created with CreateWindowEx_().
- Prop_Width : enables horizontal proportional resizing
- Prop_Height : enables vertical proportional resizing
- Lock_Width : gadget moves proportionaly to the parent, but the width is locked (usefull for separators)
- Lock_Heigh : gadget moves proportionaly to the parent, but the height is locked (usefull for separators)

Note :
This function must be called after PureRESIZE_SetGadgetResize().
This feature is hard to explain ; have a look at the code examples :
- example 1 : horizontal proportional resizing
- example 2 : vertical proportional resizing with separators (locked height)

PureRESIZE_ResizeWindowNow(WindowNumber.l)

Resize a window without waiting for a WM_SIZE event.

All gadgets in the window are resized (if registered with PureRESIZE_SetGadgetResize()).
PureRESIZE_ClearGadgetResize(GadgetNumber.l)

Stop resizing the gadget.

Return codes  :

#PureRESIZE_Ok = 1 ; Success
#PureRESIZE_NotAGadget = 2 ; The specified gadget does not exist
#PureRESIZE_NotAWindow = 3 ; The specified window does not exist
PureRESIZE_SetWindowMinimumSize(WindowNumber.l, MinimumWidth.l, MinimumHeight.l)

Set a window minimum size.

The window's resizing is blocked at MinimumWidth / MinimumHeight.

Return codes :

#PureRESIZE_Ok = 1 ; Success
#PureRESIZE_NotAGadget = 2 ; The specified gadget does not exist
#PureRESIZE_NotAWindow = 3 ; The specified window does not exist

PureRESIZE_SetWindowMaximumSize(WindowNumber.l, MaximumWidth.l, MaximumHeight.l)

Set a window maximum size.

The window's resizing is blocked at MaximumWidth / MaximumHeight.

Return codes :

#PureRESIZE_Ok = 1 ; Success
#PureRESIZE_NotAGadget = 2 ; The specified gadget does not exist
#PureRESIZE_NotAWindow = 3 ; The specified window does not exist
PureRESIZE_SetWindowMonitoring(WindowNumber.l, Flag.l)

Monitor a window [forbids moving or resizing].

Flags :

#PureRESIZE_Monitoring_DontResize : the window can't be resized
#PureRESIZE_Monitoring_DontMove   : the window can't be moved

Return codes  :

#PureRESIZE_Ok = 1 ; Success
#PureRESIZE_NotAGadget = 2 ; The specified gadget does not exist
#PureRESIZE_NotAWindow = 3 ; The specified window does not exist

PureRESIZE_ClearWindowMonitoring(WindowNumber.l)

Stop monitoring window size / position.

Return codes  :
#PureRESIZE_Ok = 1 ; Success
#PureRESIZE_NotAGadget = 2 ; The specified gadget does not exist
#PureRESIZE_NotAWindow = 3 ; The specified window does not exist