In addition to the general form of the CONTROL statement, there are special control statements for commonly used controls. These statements define the attributes of the child control windows that appear in the window.
Control statements have this general form:
─controltype─text─,─id─,─x─,─y─,─cx─,─cy─── ───┬──────────────────┬──────────── └──,───style───────┘ ┌─────────────────────────┐ │ ───BEGIN────┬──DIALOG statement───┬─┴─END─── ├──CONTROL statement──┤ └──WINDOW statement───┘
The following six controls are exceptions to this form because they do not take a text field. See the LISTBOX control statement for the form of these six controls.
controltype
To indicate the mnemonic for each item, insert the tilde character (~) in the string preceding the mnemonic character.
The double quotation marks are required for the COMBOBOX title even if no title is used.
The x, y, cx, and cy fields can use addition and subtraction operators (+ and -). For example, 15 + 6 can be used for the x-field.
Styles can be combined using the (|) operator.
The control type keywords are shown below, with their classes and default styles:
AUTOCHECKBOX
Class
Class
Class
Format
The fields have the same meaning as in the other control statements.
───COMBOBOX──"title"──,──id───,───x───,───y───,───cx─ ───,───cy──┬─────────────┬── └──,───style──┘Class
Format
Class
Class
Class
Class
Class
Class
Class
Format
──controltype───id───,───x───,───y───,───cx── ───,───cy──┬─────────────┬── └──,───style──┘Class
Class
Class
Format
Class
Class
Class
Format
Format
Format
Examples
The following is a complete example of a DIALOG statement:
DLGTEMPLATE "errmess" BEGIN DIALOG "Disk Error", 100, 10, 10, 300, 110 BEGIN CTEXT "Select One:", 1, 10, 80, 280, 12 RADIOBUTTON "Retry", 2, 75, 50, 60, 12 RADIOBUTTON "Abort", 3, 75, 30, 60, 12 RADIOBUTTON "Ignore", 4, 75, 10, 60, 12 END END
This is an example of a WINDOWTEMPLATE statement that is used to define a specific kind of window frame. Calling Load Dialog with this resource automatically creates the frame window, the frame controls, and the client window (of class MyClientClass).
WINDOWTEMPLATE "wind1" BEGIN FRAME "My Window", 1, 10, 10, 320, 130, WS_VISIBLE, FCF_STANDARD | FCF_VERTSCROLL BEGIN WINDOW "", FID_CLIENT, 0, 0, 0, 0, "MyClientClass", style END END
This example creates a resource template for a parallel dialog identified by the constant parallel1. It includes a frame with a title bar, a system menu, and a dialog-style border. The parallel dialog has three auto radio buttons in it.
DLGTEMPLATE parallel1 BEGIN DIALOG "Parallel Dialog", 1, 50, 50, 180, 110 CTLDATA FCF_TITLEBAR | FCF_SYSMENU | FCF_DLGBORDER BEGIN AUTORADIOBUTTON "Retry", 2, 75, 80, 60, 12 AUTORADIOBUTTON "Abort", 3, 75, 50, 60, 12 AUTORADIOBUTTON "Ignore", 4, 75, 30, 60, 12 END END