Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TCheckBoxes Class Reference

Cluster of check boxes. More...

#include <dialogs.h>

Inheritance diagram for TCheckBoxes::

TCluster TView TObject TStreamable List of all members.

Public Methods

 TCheckBoxes (const TRect &bounds, TSItem *aStrings)
virtual void draw ()
virtual Boolean mark (int item)
virtual void press (int item)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

const char* const name

Protected Methods

 TCheckBoxes (StreamableInit)

Detailed Description

This view implements a cluster of check boxes.

TCheckBoxes is a specialized cluster of one to 32 controls. Unlike radio buttons, any number of check boxes can be marked independently, so the cluster may have one or more boxes checked by default.

The user can mark check boxes with mouse clicks, cursor movements, and Alt-letter shortcuts. Each check box can be highlighted and toggled on/off (with the Spacebar). An "X" appears in the box when it is selected.

Other parts of your application typically examine the state of the check boxes to determine which options have been chosen by the user.

Check box clusters often have associated TLabel objects to give the user an overview of the clustered options.

See also:
TRadioButtons

Definition at line 1335 of file dialogs.h.


Constructor & Destructor Documentation

TCheckBoxes::TCheckBoxes ( const TRect & bounds,
TSItem * aStrings ) [inline]
 

Constructor.

`bounds' is the bounding rectangle of the view. `aStrings' points to a linked list of TSItem objects, one for each check box, and is assigned to strings data member.

Every TSItem object stores the caption of the related check box. TCheckBoxes handles a maximum of 32 check boxes.

The sel and value data members are set to zero; options is set to (ofSelectable | ofFirstClick | ofPreProcess | ofPostProcess).

Definition at line 1433 of file dialogs.h.

TCheckBoxes::TCheckBoxes ( StreamableInit ) [protected]
 

Constructor.

Used to recover the view from a stream. Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit.


Member Function Documentation

TStreamable * TCheckBoxes::build ( ) [static]
 

Creates a new TCheckBoxes view.

Called to create an object in certain stream-reading situations.

Reimplemented from TCluster.

void TCheckBoxes::draw ( ) [virtual]
 

Draws the TCheckBoxes object by calling the inherited TCluster::drawBox() member function.

The default check box is " [ ] " when unselected and " [X] " when selected. Note that if the boundaries of the view are sufficiently wide, check boxes can be displayed in multiple columns.

Reimplemented from TView.

Boolean TCheckBoxes::mark ( int item ) [virtual]
 

Returns True if the item'th bit of the value data member is set; that is, if the item'th check box is marked.

These bits have no instrinsic meaning. You are free to override mark(), press(), and other check box member functions to give the value data member your own interpretation.

By default, the items are numbered 0 through 31 and each bit of value data member represents the state (on or off) of a check box.

Reimplemented from TCluster.

void TCheckBoxes::press ( int item ) [virtual]
 

Called to toggle the state of a check box: toggles the item'th bit of value data member.

These bits have no instrinsic meaning. You are free to override mark(), press(), and other check box member functions to give the value data member your own interpretation.

Reimplemented from TCluster.


Member Data Documentation

const char *const TCheckBoxes::name [static]
 

Undocumented.

Reimplemented from TCluster.

Definition at line 1402 of file dialogs.h.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:21 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001