Child Windows


Child windows are simpler versions of windows and are frequently used to create tool bars. They are always contained within another window. Child windows may contain buttons, check boxes, edit boxes, list objects, other child windows — all the objects that a developer can place in a top level window. However, a child window cannot have a menu or a title bar, cannot be modal, and is not user-resizable.

If the child window's gravity flag enabled, all controls within the child window will automatically arrange themselves to fit. The controls will appear left to right and top to bottom in ID sequence order.

An optional docking flag may be used with a child window. If docking is enabled, the child window automatically attaches itself to the top edge of the parent window and will initially size itself to the full width of the parent. If the parent is resized, the child resizes itself as well. This is useful for creating tool bars. A child window with docking enabled is placed in the parent window and the objects for the tool bar are placed within the child window. The 'DOCK' mnemonic may be used to change the docking location from the top of the parent window to the bottom, left, or right.

Docked child windows do not take up part of the client area. For example, if a child window is docked at the top of its parent, the (0,0) coordinates of the parent will be at the bottom of the child window, so you do not have to know the size of a child window in order to position elements on the parent.

All of the optional events that may be placed on top level windows may be used with child windows as well. However, the flags for child windows are not the same. All SYSGUI drawing and printing commands are valid for child windows.

Creating

Mnemonic

Description

'CHILD'

Create Child Window

Manipulating

Mnemonic

Description

'CONTEXT'

Set Device Context

'DOCK'

Change Child Window Docking Position

Querying

CTRL() Function

Information Returned

0

Outer rectangle of the control in current scaled units.

1

Control title.

4

Class and type of the control.

8

Visible/invisible and enabled/disabled status of the control.

15

Background color of the control.

16

Foreground color of the control.