Navigation: ABC Library Reference > WindowResizeClass > WindowResizeClass Methods >====== SetStrategy (set control resize strategy) ====== | |
SetStrategy( | [control] ,position strategy, size strategy | )
source control, target control |
SetStrategy | Sets the position strategy and the size strategy to apply to a control. |
control | An integer constant, variable, EQUATE, or expression containing a control number. If omitted, the SetStrategy method applies position strategy and size strategy to all controls on the WINDOW. |
position strategy | An integer constant, variable, EQUATE, or expression indicating the position strategy to apply to the control. |
size strategy | An integer constant, variable, EQUATE, or expression indicating the size strategy to apply to the control. |
source control | An integer constant, variable, EQUATE, or expression identifying the control whose position strategy and size strategy are applied to the target control. |
target control | An integer constant, variable, EQUATE, or expression identifying the control whose position strategy and size strategy are copied from the source control. |
The SetStrategy method sets the position strategy and the size strategy to apply to a window control or controls. The Resize method applies the specified strategies.
Implementation:
EQUATEs for the position strategy and the size strategy parameters are declared in ABRESIZE.EQU as follows. To apply two or more strategies, simply add them together.
!Resize strategies
Resize:Resize EQUATE(0000b) !rescale height & width
Resize:LockWidth EQUATE(0001b) !locks width
Resize:LockHeight EQUATE(0010b) !locks height
Resize:LockSize EQUATE(0011b) !locks height & width
Resize:ConstantRight EQUATE(0100b) !locks right edge, moves left
Resize:ConstantBottom EQUATE(1000b) !locks bottom edge, moves top
!Reposition Strategies - Horizontal position
Resize:Reposition EQUATE(0000h) !rescale X & Y
Resize:LockXPos EQUATE(0001h) !locks left edge (absolute)
Resize:FixRight EQUATE(0002h) !fixes right edge (relative)
Resize:FixLeft EQUATE(0003h) !fixes left edge (relative)
Resize:FixXCenter EQUATE(0004h) !fixes horizontal center (relative)
Resize:FixNearestX EQUATE(0005h) !FixRight or FixLeft
!Reposition Strategies - Vertical position
Resize:LockYPos EQUATE(0100h) !locks top edge (absolute)
Resize:FixBottom EQUATE(0200h) !fixes bottom edge (relative)
Resize:FixTop EQUATE(0300h) !fixes top edge (relative)
Resize:FixYCenter EQUATE(0400h) !fixes vertical center (relative)
Resize:FixNearestY EQUATE(0500h) !FixTop or FixBottom
Example:
window WINDOW('Client Information'),AT(,,185,100),IMM,GRAY,MAX,RESIZE
SHEET,AT(3,3,180,78),USE(?Sheet1)
TAB('Client List'),USE(?ListTab)
LIST,AT(10,20,165,55),USE(?List1),FROM(ClientQ),|
FORMAT('87L~Name~@s20@8L~State Code~@s2@')
END
TAB('Client Logo'),USE(?LogoTab)
IMAGE,AT(10,20,165,55),USE(?CLI:Logo)
END
END
PROMPT('Locate:'),AT(7,87),USE(?LocatorPrompt)
ENTRY(@s20),AT(33,86,61,12),USE(CLI:Name)
BUTTON('Close'),AT(150,84),USE(?Close)
END
CODE
OPEN(window)
Resizer.Init(AppStrategy:Surface) !init Resizer overall strategy
!set control specific strategy: at bottom left & fixed size
Resizer.SetStrategy(?LocatorPrompt, Resize:FixLeft+Resize:FixBottom,|
Resize:LockSize)
!set control specific strategy: at bottom left & fixed height
Resizer.SetStrategy(?CLI:Name, Resize:FixLeft+Resize:FixBottom,|
Resize:LockHeight)
See Also: Resize