#include <gui.hpp>
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 90 of file gui.hpp.
Public Member Functions | |
| Gui () | |
| Constructor. | |
| virtual | ~Gui () |
| Destructor. | |
| virtual void | setTop (Widget *top) |
| Sets the top Widget. | |
| virtual Widget * | getTop () const |
| Gets the top Widget. | |
| virtual void | setGraphics (Graphics *graphics) |
| Sets the Graphics object to use for drawing. | |
| virtual Graphics * | getGraphics () const |
| Gets the Graphics object used for drawing. | |
| virtual void | setInput (Input *input) |
| Sets the Input object to use for input handling. | |
| virtual Input * | getInput () 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. | |
| virtual void | addGlobalKeyListener (KeyListener *keyListener) |
| Adds a global KeyListener to the Gui. | |
| virtual void | removeGlobalKeyListener (KeyListener *keyListener) |
| Remove global KeyListener from the Gui. | |
Protected Types | |
| typedef std::list< KeyListener * > | KeyListenerList |
| typedef KeyListenerList::iterator | KeyListenerListIterator |
Protected Attributes | |
| bool | mTopHasMouse |
| bool | mTabbing |
| Widget * | mTop |
| Graphics * | mGraphics |
| Input * | mInput |
| FocusHandler * | mFocusHandler |
| KeyListenerList | mKeyListeners |
| void gcn::Gui::addGlobalKeyListener | ( | KeyListener * | keyListener | ) | [virtual] |
Adds a global KeyListener to the Gui.
| keyListener | a KeyListener to add. |
Definition at line 325 of file gui.cpp.
References mKeyListeners.
| 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 270 of file gui.cpp.
References gcn::Graphics::_beginDraw(), gcn::Graphics::_endDraw(), gcn::Widget::draw(), gcn::Widget::drawBorder(), gcn::Widget::getBorderSize(), gcn::Widget::getDimension(), gcn::Widget::isVisible(), mGraphics, mTop, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), and gcn::Rectangle::x.
| Graphics * gcn::Gui::getGraphics | ( | ) | const [virtual] |
| Input * gcn::Gui::getInput | ( | ) | const [virtual] |
| Widget * gcn::Gui::getTop | ( | ) | const [virtual] |
| bool gcn::Gui::isTabbingEnabled | ( | ) | [virtual] |
| 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 133 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::Widget::getX(), gcn::Widget::getY(), gcn::Widget::hasMouse(), gcn::Widget::isFocusable(), gcn::Input::isKeyQueueEmpty(), gcn::Input::isMouseQueueEmpty(), gcn::Rectangle::isPointInRect(), gcn::Widget::logic(), mFocusHandler, mInput, mKeyListeners, mTabbing, mTop, gcn::FocusHandler::tabNext(), gcn::FocusHandler::tabPrevious(), gcn::MouseInput::x, and gcn::MouseInput::y.
| void gcn::Gui::removeGlobalKeyListener | ( | KeyListener * | keyListener | ) | [virtual] |
Remove global KeyListener from the Gui.
| keyListener | a KeyListener to remove. |
| Exception | if the KeyListener hasn't been added. |
Definition at line 330 of file gui.cpp.
References mKeyListeners.
| void gcn::Gui::setGraphics | ( | Graphics * | graphics | ) | [virtual] |
Sets the Graphics object to use for drawing.
| graphics | the Graphics object to use for drawing. |
Definition at line 113 of file gui.cpp.
References mGraphics.
| void gcn::Gui::setInput | ( | Input * | input | ) | [virtual] |
| void gcn::Gui::setTabbingEnabled | ( | bool | tabbing | ) | [virtual] |
| void gcn::Gui::setTop | ( | Widget * | top | ) | [virtual] |
Sets the top Widget.
| top | the top Widget. |
Definition at line 94 of file gui.cpp.
References gcn::Widget::_setFocusHandler(), mFocusHandler, and mTop.
Referenced by ~Gui().
1.4.7