CheckBox
A CheckBox designates a boolean option. A box appears to the left of the window title. If the CheckBox is selected, the box contains an X (or Check on the 200LX).
Window Structure Details
- int x,y,w,h:
The coordinates (x,y) specify the display point to begin the CheckBox at. The title extends to the right of that. CheckBox automatically calculates the window size (w,h) based on the length of the window title and the size of the CheckBox symbol when an APPEAR message is received. The Object class handler uses w and h are used to save the screen underneath the window when STYLE_SAVEUNDER is being used. CheckBox does not actually use w and h itself.
- PLHRES Title:
Title defines the label appearing to the right of the CheckBox.
- PLHDATA Data:
Data points to the unsigned integer variable that will be modified by selecting this CheckBox. See LogicalSize.
- UINT LogicalSize:
LogicalSize defines the bitmask to set/clear in the word at Data to signify the selection of this CheckBox. For most CheckBoxes, this value will be a single bit (1,2,4,8,...). The CheckBox handler XORs this value with the word at Data when the CheckBox toggles state. In this way, a number of checkboxes in a dialog box can all use the same variable pointed to by the Data field.
- UINT Style: Used by the Object class handler.
- PLHWINDOW Parent: Used by the Object class handler.
- PLHFKEYS FKeys: Used by the Object class handler.
- PLHMENU Menu: Used by the Object class handler.
- UINT Selection: Not used.
- UINT WindowTop: Not used.
Messages
- KEYSTROKE: Responds to the following keys:
- A space selects or deselects the CheckBox. The CheckBox handler XORs the word pointed to by the Data field with the LogicalSize value and sends a DRAW message to the CheckBox handler.
- CheckBox passes all other keys to the Object class handler.
- DRAW:
The CheckBox handler draws the CheckBox, and shows it selected (with an X inside it) if the variable at (Data AND LogicalSize) is non-zero. The CheckBox handler responds to the Data bits DRAW_CLIENT and DRAW_TITLE to display the checkbox and title respectively.
- APPEAR:
The CheckBox handler sets the w and h coordinates to the width and height of the entire CheckBox window by using the length of the title string and the size of the checkbox symbol. CheckBox passes the message to the Object class handler.
- SETFOCUS:
CheckBox displays the highlighted title. If the Data parameter of the message is SETFOCUS_SELECT, the CheckBox toggles state before displaying.
- LOSEFOCUS: Displays the title normally.
- NULLEVENT: Passed to the Object class handler.
- CREATE: Passed to the Object class handler.
- DESTROY: Passed to the Object class handler.
- TERMINATE: Passed to the Object class handler.
- ACTIVATE: Passed to the Object class handler.
- DEACTIVATE: Passed to the Object class handler.
- NOTIFY: Passed to the Object class handler.
- COMMAND: Passed to the Object class handler.
- DISAPPEAR: Passed to the Object class handler.