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

Dialog Class Reference

Dialog class. More...

#include <Dialog.h>

Inherits Frame.

Inherited by ColorPickDialog, and MessageDialog.

Inheritance diagram for Dialog:

Inheritance graph
[legend]
Collaboration diagram for Dialog:

Collaboration graph
[legend]
List of all members.

Public Methods

 Dialog (int id=0)
 Default constructor. More...

virtual void activate (Frame *p)
 Activates the dialog. More...

virtual void dismiss ()
 Dismiss the dialog. More...

bool accepts (Event &event)
 Returns true iff region will accept the event. More...

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

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

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

void resize (unsigned short w, unsigned short h)
 Resizes the region. 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.


Protected Attributes

bool moving
 True iff Dialog is being dragged.

string title
 The title of the dialog.

ButtonexitButton
 Exit/dismiss button.


Detailed Description

Dialog class.

Format: (see Frame)

    PARAM ::= TITLE
    TITLE ::= "title" <string>
    


Constructor & Destructor Documentation

Dialog::Dialog int    id = 0
 

Default constructor.

Constructs a new Dialog with id 'i'. The id must be unique in the current scope. Creates an dismiss Button.

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


Member Function Documentation

bool Dialog::accepts Event   event [virtual]
 

Returns true iff region will accept the event.

Region::accepts implementation checks if the events falls within the region boundary.

Parameters:
event  A keyboard or mouse Event.
Returns:
true iff the event falls within the region boundary.

Reimplemented from Region.

void Dialog::activate Frame   newParent [virtual]
 

Activates the dialog.

Displays the dialog within the given frame (on top) and updates its parent attribute.

Parameters:
newParent  the Frame in with to show the Dialog
Precondition:
none.
Postcondition:
The dialog has been activated and centered in 'newFrame'.

void Dialog::dismiss   [virtual]
 

Dismiss the dialog.

Removes the dialog from its parent and clears the parent attribute. Does not delete the dialog.

Precondition:
none.
Postcondition:
'this' has been removed from parent Frame and parent is cleared.

bool Dialog::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 Dialog::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 Dialog::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 Dialog::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 Dialog::resize unsigned short    w,
unsigned short    h
[virtual]
 

Resizes the region.

Virtual method to change the size of the Region.

Parameters:
w  New width.
h  New height.
Postcondition:
The region has been resized to (w, h).

Reimplemented from Region.

void Dialog::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.