Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ColorPick Class Reference

Color selection Widget. More...

#include <ColorPick.h>

Inherits Frame.

Inheritance diagram for ColorPick:

Inheritance graph
[legend]
Collaboration diagram for ColorPick:

Collaboration graph
[legend]
List of all members.

Public Methods

 ColorPick (int i=0)
 Default contructor. More...

void setColor (const Color4 &c)
 Set the color value.

const Color4getColor ()
 Get the color value.

bool event (int regionId, int evnt)
 Handle events from child Regions. More...

bool handleEvent (Event &evnt)
 Handle window-system events. More...

void refresh ()
 Repaints the region. More...

void resize (unsigned short w, unsigned short h)
 Not valid. More...

void parseSymbol (Token &t, ObjectFile &file)
 Reads a single parameter sections inside the body of the object description. More...

void writeParams (ostream &stream)
 Writes all parameter sections inside the body of the object description. More...


Protected Methods

void createSymbols ()
 Creates all parameter symbols that are used within the body of the object description.

void updateUI ()
 Updates the UI from the current color. More...


Detailed Description

Color selection Widget.

A selection Widget containing RGB NumeticField widgets and three color selection planes: RB-plane; GB-plane and RG-plane. A ColorPick has a fixed size and should not be resized.

Events:


Constructor & Destructor Documentation

ColorPick::ColorPick int    i = 0
 

Default contructor.

Constructs a new ColorPick widget with id 'i'. Creates the NumericField and positions them. The id must be unique in the current scope.

Parameters:
i  int to be used as id.
Precondition:
none.
Postcondition:
Instance is initialized and NumericField widgets are created.


Member Function Documentation

bool ColorPick::event int    regionId,
int    evnt
[virtual]
 

Handle events from child Regions.

The event method is used as a simple notification method to signal activations and state changes of regions. These event are handled bottom up until they are consumed (used). Events that are not accepted by this region are passed to the parent region. If no parent exists the event remains unconsumed.

Parameters:
regionId  Id of the region.
evnt  Id of the event, the semantics of this id is region dependent.
Postcondition:
The event is consumed to passed to parent.
Returns:
true iff the event is consumed.

Reimplemented from Region.

bool ColorPick::handleEvent Event   evnt [virtual]
 

Handle window-system events.

This method handles keyboard or mouse event from the window system. Window events are handled top down, events that are not consumed are passed to child regions that are willing to accept the event.

See also:
accepts
Parameters:
event  The Event that occured.
Postcondition:
The event is consumed or passed to child regions.
Returns:
true iff the Event is consumed.

Reimplemented from Frame.

void ColorPick::parseSymbol Token   t,
ObjectFile   file
[virtual]
 

Reads a single parameter sections inside the body of the object description.

Each object has a set of parameter names associated with it, called symbols. Symbols are declared inside the createSymbols method. The method parseSymbol expects the Token t to be such a symbol and reads the corresponding parameters. Unknown symbols are passed to its super class.

Parameters:
t  Token that is the current parameter symbol.
file  ObjectFile from which to read.
Precondition:
The file is opened for reading and is positioned just after the parameter name.
Postcondition:
The parameter section is read including the terminating semicolon (';').

Reimplemented from Frame.

void ColorPick::refresh   [virtual]
 

Repaints the region.

This method is called whenever the screen is repainted. The repaint method uses OpenGL calls to render the region. Currently it is assumed that regions are refreshed automatically so that no refresh notification has to be done when the region changes state i.e. no refresh has to be forced by the region. Region rendering is done back to front.

Precondition:
An OpenGL context has been created and activated to render in.
Postcondition:
The region is redrawn.

Reimplemented from Frame.

void ColorPick::resize unsigned short    w,
unsigned short    h
[virtual]
 

Not valid.

A ColorPick widget should not be resized.

Reimplemented from Region.

void ColorPick::updateUI   [protected]
 

Updates the UI from the current color.

Updates all NumericField widgets given the currently selected color.

Precondition:
none.
Postcondition:
NumericField widgets are filled in.

void ColorPick::writeParams ostream &    stream [virtual]
 

Writes all parameter sections inside the body of the object description.

This method writes all object parameters to ostream. Inhereting classes will always call super::writeParams().

Parameters:
stream  ostream to which to write.
Precondition:
stream is opened for writing.
Postcondition:
All object parameters are written.

Reimplemented from Frame.


The documentation for this class was generated from the following files:
This documentation was generated using doxygen. If you have any comments or additions please mail me.