How %di works

In this section:

%di causes ClearWin+ to load the resource and extract initial information such as the caption and the initial font. When the window is fully defined in the program (at the end of a winio@ statement with no continuation symbol), ClearWin+ merges the information in the program with that provided in the resource.

All the static information is contained in the resource, whilst the program contains details of those controls that need to use variables. For example, a simple Edit Box can be included in the resource and linked via its identifier to (say) a %rd format in the program. %rd (Edit Integer) requires an integer variable to hold the result. The position and dimensions of the control are defined in the resource so %rd simply links the control identifier to a variable in the program.

ClearWin+ initially makes no distinction between a window that uses %di and one that does not. In both cases it determines the position of each piece of text and each control on the fly as the components are added. When the window description in the program is complete, %di repositions existing components and adds additional components from the resource. The ordering of these components is given by the order in the program followed by the order in the resource (i.e. those items in the resource that are not found in the program). The latter order can be seen by reading the text of the resource script or by using the menu item "Layout" followed by "Tab Order" in the Dialog resource editor. This order does not affect the positioning of the text and controls in the resulting dialog but may be significant if a particular control ends up either partially or totally hidden by other controls. For example, this might happen if you place one Group Box on top of another.



Copyright © 1999-2021 Silverfrost Limited