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

CheckBox Class Reference

Radio check box. More...

#include <CheckBox.h>

Inherits Widget.

Inheritance diagram for CheckBox:

Inheritance graph
[legend]
Collaboration diagram for CheckBox:

Collaboration graph
[legend]
List of all members.

Public Methods

 CheckBox ()
 Default constuctor. More...

bool isChecked ()
 Returns true iff the checkbox is checked.

void setCheck (bool ch)
 Set the boolean value.

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

bool handleEvent (Event &event)
 Handle window-system events. 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 Types

enum  State { Idle, Pressed, Released }
 Checkbutton state related to mouse movement. More...


Protected Methods

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


Protected Attributes

State state
 The current widget state.

bool checked
 True iff the checkbox is checked.


Detailed Description

Radio check box.

Used to edit a boolean value.

Events:

Format: (see Widget)
    PARAM ::= CHECHED 
    CHECHED :== "check"
    


Member Enumeration Documentation

enum CheckBox::State [protected]
 

Checkbutton state related to mouse movement.

When the button is pressed and the mouse cursur leaves the button region the button is released.

Enumeration values:
Idle  No mouse interaction.
Pressed  Mouse button is pressed and is inside region.
Released  Mouse button is pressed but has moved outside region.


Constructor & Destructor Documentation

CheckBox::CheckBox  
 

Default constuctor.

Constructs a new CheckBox with id 'i'. The id must be unique in the current scope.

Parameters:
i  int to be used as id.
Postcondition:
CheckBox is initialized.


Member Function Documentation

bool CheckBox::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 Region.

void CheckBox::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 Widget.

void CheckBox::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 Region.

void CheckBox::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 Widget.


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.