____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"#include <gui.h>
Public Member Functions | |
| Gui () | |
| virtual | ~Gui () |
| virtual void | setTop (Widget *top) |
| virtual Widget * | getTop () const |
| virtual void | setGraphics (Graphics *graphics) |
| virtual Graphics * | getGraphics () const |
| virtual void | setInput (Input *input) |
| virtual Input * | getInput () const |
| virtual void | logic () |
| virtual void | draw () |
| virtual void | focusNone () |
| virtual void | setTabbingEnabled (bool tabbing) |
| virtual bool | isTabbingEnabled () |
| virtual void | setUseDirtyDrawing (bool useDirtyDrawing) |
Protected Attributes | |
| bool | mTopHasMouse |
| bool | mTabbing |
| Widget * | mTop |
| Graphics * | mGraphics |
| Input * | mInput |
| FocusHandler * | mFocusHandler |
| bool | mUseDirtyDrawing |
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 83 of file gui.h.
| gcn::Gui::Gui | ( | ) |
Constructor.
Definition at line 66 of file gui.cpp.
References mFocusHandler, mGraphics, mInput, mTabbing, mTop, mTopHasMouse, and mUseDirtyDrawing.
| gcn::Gui::~Gui | ( | ) | [virtual] |
Destructor.
Definition at line 77 of file gui.cpp.
References mFocusHandler, mTop, setTop(), and gcn::Widget::widgetExists().
| void gcn::Gui::setTop | ( | Widget * | top | ) | [virtual] |
Sets the top Widget.
| top | the top Widget. |
Definition at line 87 of file gui.cpp.
References gcn::Widget::_setFocusHandler(), mFocusHandler, mTop, and gcn::Widget::setDirty().
Referenced by MenuScreen::draw(), EditorMainLoop(), initGuichan(), MenuScreen::MenuScreen(), PatchEditorMainLoop(), MenuScreen::run(), StartMap(), MenuScreen::stop(), and ~Gui().
| Widget * gcn::Gui::getTop | ( | ) | const [virtual] |
Gets the top Widget.
Definition at line 102 of file gui.cpp.
References mTop.
Referenced by MenuScreen::draw(), EditorMainLoop(), EditorUpdateDisplay(), MenuScreen::MenuScreen(), PatchEditorMainLoop(), and StartMap().
| 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 107 of file gui.cpp.
References mGraphics.
Referenced by initGuichan().
| Graphics * gcn::Gui::getGraphics | ( | ) | const [virtual] |
Gets the Graphics object used for drawing.
Definition at line 112 of file gui.cpp.
References mGraphics.
Referenced by MenuScreen::draw(), and freeGuichan().
| void gcn::Gui::setInput | ( | Input * | input | ) | [virtual] |
| Input * gcn::Gui::getInput | ( | ) | const [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 127 of file gui.cpp.
References gcn::Widget::_keyInputMessage(), gcn::Widget::_mouseInMessage(), gcn::Widget::_mouseInputMessage(), gcn::Widget::_mouseOutMessage(), gcn::Input::_pollInput(), gcn::FocusHandler::applyChanges(), gcn::FocusHandler::checkHotKey(), gcn::Input::dequeueKeyInput(), gcn::Input::dequeueMouseInput(), gcn::FocusHandler::focusNone(), GCN_EXCEPTION, 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(), mFocusHandler, mInput, mTabbing, mTop, gcn::KeyInput::PRESS, gcn::Key::TAB, gcn::FocusHandler::tabNext(), gcn::FocusHandler::tabPrevious(), gcn::MouseInput::x, and gcn::MouseInput::y.
Referenced by handleInput().
| 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 245 of file gui.cpp.
References gcn::Graphics::_beginDraw(), gcn::Graphics::_endDraw(), gcn::Widget::draw(), gcn::Widget::drawBorder(), GCN_EXCEPTION, gcn::Widget::getBorderSize(), gcn::Widget::getDimension(), gcn::Widget::getDirty(), gcn::Rectangle::height, mGraphics, mTop, mUseDirtyDrawing, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Widget::setDirty(), gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y.
Referenced by MenuScreen::draw(), and DrawGuichanWidgets().
| void gcn::Gui::focusNone | ( | ) | [virtual] |
Focus none of the Widgets in the Gui.
Definition at line 283 of file gui.cpp.
References gcn::FocusHandler::focusNone(), and mFocusHandler.
| void gcn::Gui::setTabbingEnabled | ( | bool | tabbing | ) | [virtual] |
| bool gcn::Gui::isTabbingEnabled | ( | ) | [virtual] |
| void gcn::Gui::setUseDirtyDrawing | ( | bool | useDirtyDrawing | ) | [virtual] |
Definition at line 298 of file gui.cpp.
References mUseDirtyDrawing.
Referenced by DrawGuichanWidgets(), and initGuichan().
bool gcn::Gui::mTopHasMouse [protected] |
bool gcn::Gui::mTabbing [protected] |
Definition at line 184 of file gui.h.
Referenced by Gui(), isTabbingEnabled(), logic(), and setTabbingEnabled().
Widget* gcn::Gui::mTop [protected] |
Graphics* gcn::Gui::mGraphics [protected] |
Definition at line 187 of file gui.h.
Referenced by draw(), getGraphics(), Gui(), and setGraphics().
Input* gcn::Gui::mInput [protected] |
FocusHandler* gcn::Gui::mFocusHandler [protected] |
bool gcn::Gui::mUseDirtyDrawing [protected] |
1.5.6