GUI
|
Application's main class. More...
#include <App.h>
Public Member Functions | |
App (int argc, char **argv) | |
Constructor. Parses command-line arguments. More... | |
virtual | ~App () |
void | initAllegro () |
Initalizes Allegro5 library. More... | |
void | init () |
Initializes interface and sets the gui. More... | |
bool | loop (bool waitForEvent=false) |
Application's main loop. More... | |
void | setButtonOnClick (Event &event) |
Widget * | createWidget (GUISystem *guiSystem) |
Private Attributes | |
ALLEGRO_DISPLAY * | display |
ALLEGRO_EVENT_QUEUE * | queue |
ALLEGRO_FONT * | font |
GUISystem * | guiSystem |
Renderer * | renderer |
Handle< EditBox > | editBox |
Handle< TextField > | textField |
Handle< Button > | setButton |
Handle< EditBox > | multilineEdit |
Handle< Widget > | customWidget |
Static Private Attributes | |
static bool | initialized = false |
Used for preventing multiple instances. More... | |
App::App | ( | int | argc, |
char ** | argv | ||
) |
Constructor. Parses command-line arguments.
argc | Argument count |
argv | Argument vector |
Definition at line 17 of file App.cpp.
References initialized.
Definition at line 156 of file App.cpp.
References gui::Renderer::color(), gui::Button::downStateColor, gui::GUISystem::getRenderer(), gui::Button::hoverStateColor, renderer, gui::Button::setText(), gui::Button::textColor, and gui::Button::upStateColor.
void App::init | ( | ) |
Initializes interface and sets the gui.
Definition at line 55 of file App.cpp.
References gui::GUISystem::addButton(), gui::GUISystem::addEditBox(), gui::EventEmitter::addEventListener(), gui::GUISystem::addTextField(), gui::GUISystem::addWidget(), createWidget(), customWidget, display, editBox, font, guiSystem, multilineEdit, queue, renderer, gui::Renderer::setBuffer(), setButton, setButtonOnClick(), gui::Renderer::setFont(), gui::GUISystem::setRenderer(), and textField.
bool App::loop | ( | bool | waitForEvent = false | ) |
Application's main loop.
waitForEvent | If true, blocks the application until an Allegro's event come. |
Definition at line 92 of file App.cpp.
References guiSystem, gui::GUISystem::handleEvents(), gui::GUISystem::keyChar(), gui::GUISystem::keyDown(), gui::GUISystem::mouseButtonDown(), gui::GUISystem::mouseButtonUp(), gui::GUISystem::mouseMove(), queue, and gui::GUISystem::render().
void App::setButtonOnClick | ( | Event & | event | ) |
Definition at line 150 of file App.cpp.
References editBox, gui::EditBox::getText(), gui::TextField::setText(), and textField.
|
staticprivate |