User Tools

Site Tools


getpositionstrategy_return_position_strategy_for_a_control_type_.htm
Navigation:  ABC Library Reference > WindowResizeClass > WindowResizeClass Methods >====== GetPositionStrategy (return position strategy for a control type) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

GetPositionStrategy( control type [, strategy ] )

blk2blue.jpg

GetPositionStrategy Returns the repositioning 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 GetPositionStrategy method returns the appropriate repositioning strategy for a particular control type based on the overall strategy.

Implementation:

The Reset method calls the GetPositionStrategy method to set the position 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:.

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

See Also:     Init, Reset

getpositionstrategy_return_position_strategy_for_a_control_type_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1