GetParentControl (return parent control)

Top  Previous  Next

 

GetParentControl( control ), VIRTUAL

GetParentControl

Returns the parent for a window control.

control

An integer constant, variable, EQUATE, or expression containing a control number. The Resize method rescales the control based on the coordinates of the parent.

The GetParentControl method returns the parent for a window control. A return value of zero indicates the WINDOW is the parent. Otherwise, the return value is the field equate of another window control.

The SetParentDefaults method intelligently sets the appropriate parent for all the window controls, and the SetParentControl method sets the parent for a single control. The Resize method rescales the control based on the coordinates of the parent.

Return Data Type:     SIGNED

Example:

window WINDOW('Nested Controls'),AT(,,165,97),IMM,GRAY,MAX,RESIZE

       GROUP('OuterGroup'),AT(5,3,154,92),USE(?OuterGroup),BOXED

        BUTTON('Button 1'),AT(14,23),USE(?Button1)

        ENTRY(@s20),AT(60,24),USE(Entry1)

        GROUP('InnerGroup'),AT(11,49,141,38),USE(?InnerGroup),BOXED

         CHECK('Check 1'),AT(32,64),USE(Check1)

         CHECK('Check 2'),AT(91,64),USE(Check2)

        END

       END

      END

 

CODE

OPEN(window)

Resizer.Init(AppStrategy:Spread)               !initialize Resizer object

Resizer.SetParentDefaults                      !set parents for all controls

Resizer.SetParentControl(?Button1,?OuterGroup) !override parent for a control

Resizer.SetParentControl(?Check1,?InnerGroup)  !override parent for a control

Resizer.SetParentControl(?Check2,?InnerGroup)  !override parent for a control

See Also:     Resize, SetParentControl, SetParentDefaults