Property Types

The following section identifies and describes the property types Visual PRO/5 uses to define resources:

  • String Properties

  • Integer Properties

  • Flag Properties

  • Color Properties

  • Font and Justification Properties

  • Character Properties

The Resource Properties Index identifies and describes all properties contained in this section.

Common Properties Example

The following lists common properties for button and edit controls:

Version "3.0"
Window 1 "Status" 0 0 200 100
Begin Not Sizable
Button 1 "OK" 10 10 50 25 Begin Justification
JUSTIFICATION_LEFT end
edit 1 "Done" 50 10 50 25 Begin
Initialcontents "The first initalcontents line\n"
"The second initalcontents line\n"
Font "Arial" 12, Bold, CS_DEFAULT
Justification $2000$
Foregroundcolor Rgb(128,255,128)
Backgroundcolor Color_magenta
Disabled Invisible Clientedge Vscrollbar
Hscrollbar End
End

String Properties

String properties define name, title, mask, and default text entries for resources. String properties are always contained in double quotes. Null is the default setting for all string properties. In the example, "Status" defines the title text of Window 1, while "OK" and "Done" define the title text for the edit and button controls, respectively.

Integer Properties

Integers set numeric value-related definitions such as resource size, position, number of columns, and tab height. In the example, integer properties define the size and position of the window button and edit controls. For the window, the settings 50, 250, 250, and 125 define in current units the horizontal and vertical positions of the upper-left corner, width, and height, respectively. Default settings for integer properties are listed in the Resource Properties Index.

Flag Properties

Flag ("Boolean") properties define a wide range of resource settings. For example, they are used to include scroll bars and titles in windows, set controls to be initially disabled or invisible, replace input text with asterisks, and set menu items to be initially checked. Flag properties are designated as true or false by default.

The following guidelines apply to flag properties:

  • Properties designated as false by default will not be applied, unless the property name is included in the resource definition.

  • Properties designated as true by default will be applied, unless NOT and the property name are included in the resource definition.

  • Properties for a single resource can be entered on more than one line.

In the example, because the Disabled,Invisible,Clientedge,Vscrollbar, and Hscrollbar properties are false by default, they are only applied if they are included in the resource definition. Because the Sizeable property is true by default, it is only excluded if Not Sizeable is included in the resource definition.

Color Properties

Color properties define the foreground and background colors of resources. To define colors, use the predefined color name listed in the stdincl.h file or use the RGB value.

In the example, the settings Foregroundcolor Rgb(128,255,128)andBackgroundcolor Color_magenta illustrate colors defined by RGB values and predefined color names, respectively. The Predefined Constants section identifies and describes the predefined color properties.

Font and Justification Properties

Font and justification properties define the attributes of text contained or entered into resources. Font properties define the text font, point size, style, and character set. Justification properties define the alignment of text within the control.

Font Properties

The following lists the font property syntax:

"Fontname" pointsize{,style{,charset}}

In the example, the Font "Arial" 12, Bold, CS_DEFAULT settings define the text font, point size, style, and character set.

ResCompiler uses the Window-defined font and point size, normal style, and ANSI character sets as defaults and supports normal, bold, italic, strikeout, and underline text styles. The Predefined Constants section identifies and describes the predefined character set options. Style settings are only required if a nondefault character set is used.

Justification Properties

The following lists the justification syntax:

Justification setting

In the example, the Justification $2000$ and Justification JUSTIFICATION_LEFT settings define the alignment of text in the button and edit controls, respectively. The Predefined Constants section identifies and describes the hex value and predefined justification settings.

Character Properties

Character properties define row and column separations in grid controls and line separations in the Initialcontents settings of all text entry controls.

In the example, \n forces a line break in the edit control Initialcontents lines.