check-box

Class

Package: common-graphics

Class

The class of the check-box control.

Control

Instance of the check-box class. This is a standard check box control. A check-box is a control which is either toggled on or off by clicking it. When it is on, the value field of the dialog item is set to t and the box is filled with a check mark. When it is off, the value field of the dialog item is set to nil and the box is blank.

You can have as many check-boxes on a dialog as you wish. Each one works independently of the others, i.e., they aren't defined in groups via the :cluster property as radio-buttons are.

The title field of the dialog item is used as the name of the check box, and is displayed immediately to the right of the check box itself.

Adding a check-box control to your form

Click the check-box tool on the Component toolbar. Move the mouse cursor to the part of the form where you want to place the control, and click again. The control will appear with colored resizing handles.

Resizing and moving the control

Controls can only be resized and moved on forms during the design stage; the size and location of everything is fixed on a running form.

Resize the control by clicking the mouse cursor and dragging one of the handles to the new size-point. Release the mouse key when you are satisfied with the new size. Note: resizing the check-box control changes the size of the bounding-box, but not the size of the actual check box inside. Resize the label for the box by changing the font property.

Move the control by clicking anywhere on it except a resizing handle and dragging it to a new location on the form. Release the mouse key when you are ready to place the control.

Creating an instance of a check-box control

This call to make-instance returns an instance of a check-box. Properties can be initialization keyword arguments (the keyword has the same name as the property, with a prepended colon, e.g. :width). Additional arguments could be provided. Their absence indicates the default value will be used.

(make-instance 'check-box
                :font
                 (make-font-ex nil "MS Sans Serif" 11 nil)
                :left 242
                :name :check-box-1
                :top 180)

See About how to get sample code for creating controls in cgide.htm, which explains how to use the IDE to create such code.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.