Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

gcn::Gui Class Reference

#include <gui.hpp>

List of all members.


Detailed Description

Gui core class.

Contains a special widget called the top widget. If you want to be able to have more then one Widget in your Gui, the top widget should be a Container.

NOTE: For the Gui to function properly you need to set a Graphics object to use and an Input object to use.

Definition at line 84 of file gui.hpp.

Public Member Functions

 Gui ()
 Constructor.
virtual ~Gui ()
 Destructor.
virtual void setTop (Widget *top)
 Sets the top Widget.
virtual WidgetgetTop () const
 Gets the top Widget.
virtual void setGraphics (Graphics *graphics)
 Sets the Graphics object to use for drawing.
virtual GraphicsgetGraphics () const
 Gets the Graphics object used for drawing.
virtual void setInput (Input *input)
 Sets the Input object to use for input handling.
virtual InputgetInput () const
 Gets the Input object being used for input handling.
virtual void logic ()
 Performs the Gui logic.
virtual void draw ()
 Draws the Gui.
virtual void focusNone ()
 Focus none of the Widgets in the Gui.
virtual void setTabbingEnabled (bool tabbing)
 Toggles the use of the tab key to focus Widgets.
virtual bool isTabbingEnabled ()
 Checks if tabbing is enabled.

Protected Attributes

bool mTopHasMouse
bool mTabbing
WidgetmTop
GraphicsmGraphics
InputmInput
FocusHandlermFocusHandler


Member Function Documentation

void gcn::Gui::draw  )  [virtual]
 

Draws the Gui.

By calling this funcion all draw functions down in the Gui hierarchy will be called.

Definition at line 236 of file gui.cpp.

References gcn::Graphics::_beginDraw(), gcn::Graphics::_endDraw(), gcn::Widget::draw(), gcn::Widget::drawBorder(), gcn::Widget::getBorderSize(), gcn::Widget::getDimension(), gcn::Rectangle::height, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y.

Graphics * gcn::Gui::getGraphics  )  const [virtual]
 

Gets the Graphics object used for drawing.

Returns:
the Graphics object used for drawing. NULL if no Graphics object has been set.

Definition at line 110 of file gui.cpp.

Input * gcn::Gui::getInput  )  const [virtual]
 

Gets the Input object being used for input handling.

Returns:
the Input object used for handling input. NULL if no Input object has been set.

Definition at line 120 of file gui.cpp.

Widget * gcn::Gui::getTop  )  const [virtual]
 

Gets the top Widget.

Returns:
the top widget. NULL if no top widget has been set.

Definition at line 100 of file gui.cpp.

bool gcn::Gui::isTabbingEnabled  )  [virtual]
 

Checks if tabbing is enabled.

Returns:
true if tabbing is enabled.

Definition at line 281 of file gui.cpp.

void gcn::Gui::logic  )  [virtual]
 

Performs the Gui logic.

By calling this function all logic functions down in the Gui heirarchy will be called. What performs in Logic can be just about anything like adjusting a Widgets size or doing some calculations.

NOTE: Logic also deals with user input (Mouse and Keyboard) for Widgets.

Definition at line 125 of file gui.cpp.

References gcn::Widget::_keyInputMessage(), gcn::Widget::_mouseInMessage(), gcn::Widget::_mouseInputMessage(), gcn::Widget::_mouseOutMessage(), gcn::Input::_pollInput(), gcn::FocusHandler::applyChanges(), gcn::Input::dequeueKeyInput(), gcn::Input::dequeueMouseInput(), gcn::FocusHandler::focusNone(), gcn::Widget::getAbsolutePosition(), gcn::Widget::getDimension(), gcn::FocusHandler::getDragged(), gcn::FocusHandler::getFocused(), gcn::KeyInput::getKey(), gcn::KeyInput::getType(), gcn::Key::getValue(), gcn::Widget::getX(), gcn::Widget::getY(), gcn::Widget::hasMouse(), gcn::Widget::isFocusable(), gcn::Input::isKeyQueueEmpty(), gcn::Input::isMouseQueueEmpty(), gcn::Rectangle::isPointInRect(), gcn::Key::isShiftPressed(), gcn::Widget::logic(), gcn::FocusHandler::tabNext(), gcn::FocusHandler::tabPrevious(), gcn::MouseInput::x, and gcn::MouseInput::y.

void gcn::Gui::setGraphics Graphics graphics  )  [virtual]
 

Sets the Graphics object to use for drawing.

Parameters:
graphics the Graphics object to use for drawing.
See also:
SDLGraphics, OpenGLGraphics, AllegroGraphics

Definition at line 105 of file gui.cpp.

void gcn::Gui::setInput Input input  )  [virtual]
 

Sets the Input object to use for input handling.

Parameters:
input the Input object to use for input handling.
see SDLInput, AllegroInput

Definition at line 115 of file gui.cpp.

void gcn::Gui::setTabbingEnabled bool  tabbing  )  [virtual]
 

Toggles the use of the tab key to focus Widgets.

By default, tabbing is enabled.

Parameters:
tabbing set to false if you want to disable tabbing.

Definition at line 276 of file gui.cpp.

void gcn::Gui::setTop Widget top  )  [virtual]
 

Sets the top Widget.

Parameters:
top the top Widget.

Definition at line 86 of file gui.cpp.

References gcn::Widget::_setFocusHandler().

Referenced by ~Gui().


The documentation for this class was generated from the following files:
Generated on Tue May 17 21:23:26 2005 for Guichan by  doxygen 1.4.1