Defining Child Windows


This section describes the mandatory properties and syntax for child windows and includes sample files that illustrate child window definitions.

Child windows share certain attributes with top-level windows; both can possess borders, scroll bars, controls, and other child windows (with no limit to the nesting depth for child windows). Child windows can also use the same event mask options as top-level windows. Unlike top-level windows, child windows cannot contain menus or title bars.

Child windows inherit their default font and units properties from the parent windows and can be either directly or indirectly defined. The following identifies the differences between directly- and indirectly-defined child windows:

  • Definitions for directly-defined child windows are listed within the nested structure of top-level windows. Directly-defined child windows cannot be shared with other windows. The child window ID number must be unique within a resource file.

  • Definitions for indirectly-defined child windows consist of two components: a child window definition that is a separate top-level resource, and a reference within the nested structure of the top-level window that points to the definition. Indirectly-defined child windows can be shared with other windows.

Directly-Defined Child Windows

The following lists the mandatory properties for directly-defined child windows:

child-window window-idx y width height

The following describes the child window properties:

Property

Description

child-window

Identifies the resource as a child window.

window-id

Child window ID number. The number must be an integer between 100 and 32767 but cannot be the same as other controls or child windows in a top-level window.

x

Location of the horizontal position of the upper-left corner of the child window in current units.

y

Location of the vertical position of the upper-left corner of the child window in current units.

width

Width of the child window in current units.

height

Height of the child window in current units.

Indirectly-Defined Child Windows

Indirectly-defined child windows definitions are comprised of two components: the reference component, and the definition component. The following lists the mandatory properties for the reference component of indirectly-defined child windows:

Child-window resource-id window-id x y

The following describes the child window properties:

Property

Description

child-window

Identifies the resource as a child window.

resource-id

ID number of the referenced child window.

window-id

Child window ID number. The number must be an integer between 100 and 32767 but cannot be the same as other controls or child windows in a top level window.

x

Location of the horizontal position of the child window in current units.

y

Location of the vertical position of the child window in current units.

The following lists the mandatory properties for the definition component of indirectly-defined child windows:

Child-window resource-id widthheight

The following describes the child window properties:

Property

Description

child-window

Identifies the resource as a child window.

resource-id

Child window resource ID number and must be an integer between 1 and 32767.

width

Width of the child window in current units.

height

Height of the child window in current units.

For indirectly-defined child windows, the x and y parameters in the reference component are not defined because the reference determines the location of the child window. In the reference component, the context should be the same as the window ID. The child window IDs must be unique within a resource file.