Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter NineDialog Functions (continued)

CHECKBOX Resource Statement

Overview

The CHECKBOX statement can be used as part of the body of a dialog resource specification. It is a specific method of specifying a check box. The control is a small rectangle (check box) that has the specified text displayed next to it (typically to the right). When the user chooses the control, the control highlights the rectangle and permits the user to check or uncheck the box.

Syntax/Parameters

Syntax

CHECKBOX text, id, x, y, width, height, [style], [extended-style]

Parameters

text

The text that is to be displayed with the control (the control’s caption). The text is positioned within the control or adjacent to the control.

This parameter must contain zero or more characters enclosed in double quotation marks ("). Strings are automatically converted to Unicode in the resulting resource file. By default, the characters listed between the double quotation marks are ANSI characters, and escape sequences are interpreted as byte escape sequences. If a double quotation mark is required in the text, you must include the double quotation mark twice. An ampersand (&) character in the text indicates that the following character is used as a mnemonic character for the control. When the control is displayed, the ampersand is not shown but the mnemonic character is underlined. The user can choose the control by pressing the key corresponding to the underlined mnemonic character. To use the ampersand as a character in a string, insert two ampersands (&&).

id

The control identifier. This value must be a 16-bit unsigned integer in the range 0 through 65,535 or -1 (same as 0xFFFF or 65535). Except for -1, control identifiers must be unique. Duplicate control values for the same dialog page will result in an error. id is used to access the control within dialog procedures. A value of -1 is typically used for legends and other static controls and cannot be used for controls that require programmatic access.

x

The X coordinate in dialog units of the left side of the control relative to the left side of the dialog box. This value must be a 16-bit unsigned integer in the range 0 through 65,535. Use caution when overlaying controls.

y

The Y coordinate in dialog units of the top side of the control relative to the top of the dialog box. This value must be a 16-bit unsigned integer in the range 0 through 65,535. Use caution when overlaying controls.

width

The width of the control. This value must be a 16-bit unsigned integer in the range 1 through 65,535. The width is in 1/4-character units.

height

The height of the control. This value must be a 16-bit unsigned integer in the range 1 through 65,535. The height is in 1/8-character units.

style

An optional predefined name or literal integer value that specifies the style of the control. By default, the style is BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP.

extended-style

An optional extended window style. The style parameter must be specified in order to specify extended-style. For more information, see EXSTYLE.

Remarks

Check boxes are useful controls to present the user with a binary decision. The CHECKBOX control differs from an AUTOCHECKBOX control in that the toggling of the check within the box is not handled by the script engine. The programmer must handle the click through the action procedure for the dialog, which can process and adjust the state of the control. The CHECKBOX resource statement can only be used with the DIALOGEX statement.

This statement is the equivalent of using the CONTROL statement with the “button” class and the BS_CHECKBOX style.