Loading...
 

Parameter specification: Window, child object

Parameter specification: Window, child object

All instructions used to access surface objects have the same structure in principle:

Syntax
Statement(windowID, childID)
Parameters
Parameters Description
windowID the identifier of a window / entry point of the widget search
childID the identifier of a child object of this window / entry point

If the statement refers to a window itself, then the parameter childID is omitted.

The tuple (windowID, childID) defines a widget selector.

windowID defines the entry point of the widget search. This is used to select the first open window by name from the active module (see Visibility). If windowID is omitted, the search begins in the window of the active widget. If a CX_WIDGET object with STACK (see section: Stack) is passed as windowID parameter, then the search starts at this passed widget.

childID defines the name of the child widget to which the widget command refers. The child widget is searched for within the parent widget selected by windowID. If there are several child widgets with the same name (bad style!), then the first widget found in the width search is taken.

Additional rules apply to widget searches in the context of imported widgets.

Implicit parameters from the context

Statements of this kind are used so often that it is worthwhile to introduce a more convenient notation where one or both parameters can be omitted:

Rule: InstantView® replaces missing information using the window object that triggered the execution of the statement.

Statement

refers directly to the 'triggering window object'.

Statement(, childID)

refers to a child object, which is located together with the 'triggering window object' on the same window. For statements in the action list of a window object that are associated with a system event, this window object is the trigger for the statements. For statements in the action list of a module there is a triggering window object if the triggering statement SendMsg is connected to a window object (also indirectly via several levels).
There is no triggering window object when instructions in the action list of a module are started with



are connected. This also applies to instructions that are triggered (directly or indirectly) by a SendMsg connected to the above events for a module.

The keyword STACK

The keyword STACK can be specified for both parameters (windowID, childID). A general explanation of the STACK parameter can be found here. On the stack top, either the name of a window/window object or a window object itself is expected as an object of the class CX_WIDGET (see widget). If a window object is passed on the stack, this definition is unique. The parent window can be omitted in this case. In this case, both the notation (,STACK) and (STACK) are accepted.

Note: With the notation (STACK, childID) and the passing of the parent widget as CX_WIDGET object, the widget with the identifier childID is searched for in the passed parent widget and the strict widget separation according to import contexts is also cancelled.

If STACK is specified for both parameters, the specification for the window is expected before the specification for the child object.

Note: If you want to execute an instruction for a group of window objects, you must pass a vector of these window objects (or their names) on the stack.

Example

[ "childName1" "childName2" "childnameN" ]  Hide(, STACK)

would make the window objects listed as vectors invisible.
The instruction:

[ "child11", "child12" ] [ "child21" ] [ "win1", "win2" ] Show(STACK, STACK)

is semantically equivalent to:

Show(win1, child11) Show(win1, child12) Show(win2, child21)