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

TColorSelector Class Reference

Color viewer used to display available color selections. More...

#include <colorsel.h>

Inheritance diagram for TColorSelector::

TView TObject TStreamable List of all members.

Public Types

enum  ColorSel { csBackground = 0, csForeground }

Public Methods

 TColorSelector (const TRect &bounds, ColorSel aSelType)
virtual void draw ()
virtual void handleEvent (TEvent &event)

Static Public Methods

TStreamablebuild ()

Static Public Attributes

char icon
const char* const name

Protected Methods

 TColorSelector (StreamableInit)
virtual void write (opstream &os)
virtual void* read (ipstream &is)

Protected Attributes

uchar color
ColorSel selType

Detailed Description

The interrelated classes TColorItem, TColorGroup, TColorSelector, TMonoSelector, TColorDisplay, TColorGroupList, TColorItemList and TColorDialog provide viewers and dialog boxes from which the user can select and change the color assignments from available palettes with immediate effect on the screen.

TColorSelector is a view for displaying the color selections available.

Definition at line 206 of file colorsel.h.


Member Enumeration Documentation

enum TColorSelector::ColorSel
 

This view can handle two sets of colors: the 8 background colors or the 16 foreground colors.

Definition at line 213 of file colorsel.h.


Constructor & Destructor Documentation

TColorSelector::TColorSelector ( const TRect & bounds,
ColorSel aSelType )
 

Constructor.

Calls TView constructor TView(bounds) to create a view with the given `bounds'. Sets options data member with ofSelectable, ofFirstClick, and ofFramed. Sets eventMask to evBroadcast, selType to `aSelType', and color to 0.

`aSelType' may be one of the following values:

 Constant     Value Meaning

 csBackground 0     show the 8 background colors
 csForeground 1     show the 16 foreground colors
 

TColorSelector::TColorSelector ( StreamableInit ) [protected]
 

Constructor.

Used to recover the view from a stream.


Member Function Documentation

TStreamable * TColorSelector::build ( ) [static]
 

Creates a new TColorSelector.

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

Reimplemented from TView.

void TColorSelector::draw ( ) [virtual]
 

Draws the color selector.

Reimplemented from TView.

void TColorSelector::handleEvent ( TEvent & event ) [virtual]
 

Handles mouse and key events: you can click on a given color indicator to select that color, or you can select colors by positioning the cursor with the arrow keys.

Changes invoke drawView() when appropriate.

Reimplemented from TView.

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

Used to recover the view from a stream. Reads from the input stream `is'.

Reimplemented from TView.

void TColorSelector::write ( opstream & os ) [protected, virtual]
 

Used to store the view in a stream. Writes to the output stream `os'.

Reimplemented from TView.


Member Data Documentation

uchar TColorSelector::color [protected]
 

Holds the currently selected color.

Definition at line 252 of file colorsel.h.

char TColorSelector::icon [static]
 

This character is used to mark the current color.

Definition at line 247 of file colorsel.h.

const char *const TColorSelector::name [static]
 

Undocumented.

Reimplemented from TView.

Definition at line 289 of file colorsel.h.

ColorSel TColorSelector::selType [protected]
 

Specifies if the view shows the 8 background colors or the 16 foreground colors.

Gives attribute (foreground or background) of the currently selected color. ColorSel is an enum defined as follows:

 enum ColorSel { csBackground = 0, csForeground }
 

Definition at line 264 of file colorsel.h.


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