Navigation: ABC Library Reference > WindowResizeClass > WindowResizeClass Methods >====== GetResizeStrategy (return resize strategy for a control type) ====== | |
GetResizeStrategy( control type [, strategy ] )
GetResizeStrategy | Returns the resizing strategy for a control type. |
control type | An integer constant, variable, EQUATE, or expression indicating the type of control (BUTTON, ENTRY, LIST, etc.). |
strategy | An integer constant, variable, EQUATE, or expression indicating the overall strategy for resizing and repositioning all the controls on the window. If omitted, strategy defaults to the strategy specified by the Init method. |
The GetResizeStrategy method returns the appropriate resizing strategy for a particular control type based on the overall strategy.
Implementation:
The Reset method calls the GetResizeStrategy method to set the resizing strategy for dynamically created controls.
EQUATEs for the control type parameter are declared in EQUATES.CLW. Each control type EQUATE is prefixed with CREATE:.
EQUATEs for the return value are declared in ABRESIZE.INC. Each strategy EQUATE is prefixed with Resize:.
Return Data Type: USHORT
Example:
GET(SELF.ControlQueue,SELF.ControlQueue.ID) !get control resize info
IF ERRORCODE() !if no control info, add it
SELF.ControlQueue.Type=FieldCounter{PROP:Type} ! set control type
SELF.ControlQueue.ParentID=0 ! set parent
SELF.ControlQueue.HasChildren=False ! set children
SELF.ControlQueue.ID=FieldCounter ! set ID
GetSizeInfo(FieldCounter,SELF.ControlQueue.Pos)! set coordinates
! set resize strategies
SELF.ControlQueue.PositionalStrategy=SELF.GetPositionStrategy(SELF.ControlQueue.Type)
SELF.ControlQueue.ResizeStrategy=SELF.GetResizeStrategy(SELF.ControlQueue.Type)
ADD(SELF.ControlQueue,SELF.ControlQueue.ID) ! add control info
ASSERT(~ERRORCODE())
END