TCluster Class Reference

[tvision Index] [tvision Hierarchy] [Headers]


The base class of TCheckBoxes and TRadioButtons More...

#include <dialogs.h>

Inherits: TView

Public Members

Protected Members


Detailed Description

The base class used by TCheckBoxes and TRadioButtons.

See Also: TCheckBoxes, TRadioButtons


TCluster( const TRect& bounds, TSItem *aStrings ) [public]

Constructor.

`bounds' is the bounding rectangle of the view. `aStrings' points to a list of TSItem objects, one for each cluster item. Every TSItem object stores the caption of the related item. TCluster handles a maximum of 32 items.

See Also:
TSItem

~TCluster() [public]

Destructor.

ushort dataSize() [public virtual]

Returns the size of the data record of this view.

It just returns `sizeof(short)'.

void drawBox( const char *icon, char marker ) [public]

Redraws the view.

Called within the draw() method. `icon' points to a string which will be written at the left side of every item. Parameter `marker' is the character which will be written if the item is checked. Otherwise a space character will be used.

See Also:
TCluster::drawMultiBox

void drawMultiBox(const char *icon, const char* marker) [public]

Redraws the view.

Called within the draw() method. `icon' points to a string which will be written at the left side of every item. For example TCheckBoxes::draw() calls this method with string " [ ] " as `icon' parameter. TRadioButton::draw() calls this method with string " ( ) " as parameter `icon'. Parameter `marker' is a pointer to an array of 2 characters. If the item is not checked the first character will be written. Otherwise the second character will be used.

See Also:
TCluster::drawBox, TCheckBoxes::draw, TRadioButtons::draw

void getData( void *rec ) [public virtual]

Reads the data record of this view.

It stores variable `value' (casted to short integer) at address `rec`.

ushort getHelpCtx() [public]

Returns the help context of the selected item.

The help context is calculated by summing view variable `helpCtx' and the number of the currently selected item (0 for the first item, 1 for the second item, etc). Redefines TView::getHelpCtx().

See Also:
TView::getHelpCtx, TView::helpCtx

TPalette& getPalette() const [public virtual]

Returns a reference to the standard TCluster palette.

void handleEvent( TEvent& event ) [public virtual]

Handles TCluster events.

Boolean mark( int item ) [public virtual]

Should return True if the specified item is checked.

Does nothing and returns False. Redefined in TCheckBoxes and in TRadioButtons.

See Also:
TCheckBoxes::mark, TRadioButtons::mark

uchar multiMark( int item ) [public virtual]

It just returns `(uchar)(mark(item) == True)'.

void press( int item ) [public virtual]

Should change the state of an item.

Does nothing. Redefined in TCheckBoxes and in TRadioButtons.

See Also:
TCheckBoxes::press, TRadioButtons::press

void movedTo( int item ) [public virtual]

Called whenever the user moves the selection to another item.

Does nothing. Redefined in TRadioButtons.

See Also:
TRadioButtons::movedTo

void setData( void *rec ) [public virtual]

Writes the data record of this view.

This method reads a short integer from address `rec', places it in variable `value' and then calls drawView().

See Also:
TCluster::value, TView::drawView

void setState( ushort aState, Boolean enable ) [public virtual]

Changes the state of the view.

See Also:
TView::setState

void setButtonState(unsigned long aMask, Boolean enable) [public virtual]

Sets the state of one or more items.

`aMask` is a bitmap which specifies what items to enable or disable. `enable' is the action to perform: False to disable, True to enable.

Boolean buttonState(int item) [public]

Returns True if the specified item is enabled.

Parameter `item' specifies which item to check. 0 is the first item, 1 is the second item, etc.

See Also:
TCluster::enableMask

TStreamable* build() [public static]

Creates a new TCluster view.

Used to recover the view from a stream.

unsigned long value[protected]

This variable stores the item status bitmap.

If bit 0 is set the first item is checked, if bit 1 is set the second item is checked, etc. If a bit is cleared the related item is not checked. Its initial value is 0.

unsigned long enableMask[protected]

This variable stores a bitmap which selectively enables cluster items.

If bit 0 is set the first item is enabled, if bit 1 is set the second item is enabled, etc. If a bit is cleared the related item is disabled. Its initial value is 0xffffffff.

int sel[protected]

This integer contains the current selected item.

If its value is 0 the first item is selected, if its value is 1 the second item is selected, etc. Its initial value is 0.

TStringCollection *strings[protected]

This object contains all the item captions.

TCluster( StreamableInit ) [protected]

Constructor.

Used to recover the view from a stream.

void write( opstream& os ) [protected virtual]

Used to store the view in a stream.

void* read( ipstream& is ) [protected virtual]

Used to recover the view from a stream.


Documentation generated by sergio@athena.milk.it on Wed Feb 10 22:11:47 CET 1999
Kdoc