ResCompiler: Defining Windows
ResCompiler has been superseded. See Converting .brc Files to .arc Format instead.
This section provides the mandatory and optional properties and sample resource file examples for the following window resources:
-
Windows and Dialogs
-
Event Masks
-
Status Bars
The Resource Properties Index identifies and describes the optional properties for windows, dialogs, and status bars. The Predefined Constants section identifies and describes the event mask settings.
Windows and Dialogs
Windows serve as the principal resource placeholders. All resources contained within a window are nested within the window's resource file description. A window can also serve as a dialog box.
The following lists the mandatory properties for windows and dialogs:
Window resource-id "title" x, y, width, height
The following describes the window and dialog properties:
|
Property |
Definition |
|---|---|
|
Window |
Identifies the resource as a window. |
|
resource-id |
Unique resource ID number that identifies the window in the resource file. It must be an integer between 1 and 32767. |
|
"title" |
Title of the control, contained in quotation marks. |
|
x |
Horizontal position of the upper-left corner of the control in current units. |
|
y |
Vertical position of the upper-left corner of the control in current units. |
|
width |
Width of the control in current units. |
|
height |
Height of the control in current units. |
Example
The following example contains three windows: the first contains only the mandatory definitions, the second contains dialog box settings, and the third contains optional settings.
|
Current Units Settings
Setting the current units determines the unit type for a window and its contained controls and elements. This is set at the window level only. Use the following settings rather than the numbers contained in the stdincl.h file:
|
Unit Type |
Current Unit Setting |
|---|---|
|
Pixels |
|
|
Characters |
|
|
Semicharacters |
|
Dialog Box Settings
Setting the following properties defines a window as a dialog box:
Alwaysontop,Dialogbehavior,Dialogborder,Gravity,Keyboardnavigation,Not
Maximizable,
and Not
Sizable.
Event Masks
Event masks filter the events reported by the current window. To prompt the window to report only specific events, all events, or a combination of events, use the logical operators "|" (OR), "~" (NOT), "&" (AND), and parentheses to group elements of the expression. Predefined Constants identifies and describes the event mask settings.
Example
The following contains two examples that illustrate event mask properties. The first example defines three individual event masks, while the second defines all events except mouse events.
|
Status Bars
Status bars are located at the bottom of a window and display information about a process, menu command, or selection.
The following lists the mandatory properties for status bars:
Statusbar control-id
The following describes the scroll bar properties:
|
Property |
Description |
|---|---|
|
|
Identifies the resource as a status bar. |
|
|
An integer between 1 and 32767 that defines the status bar ID number. It must be unique within the top-level window. |
Example
The following example contains a window with two status bars: the first contains only the mandatory definitions, while the second also contains optional settings.
|