xoreos
0.0.5
|
#include <gui.h>
Classes | |
struct | WidgetContext |
Public Member Functions | |
GUI (::Engines::Console *console=0) | |
~GUI () | |
Public Member Functions inherited from Engines::GUI | |
GUI (Console *console=0) | |
virtual void | show () |
Show the GUI. More... | |
virtual void | hide () |
Hide the GUI. More... | |
uint32 | run (uint32 startCode=kStartCodeNone) |
Run the GUI. More... | |
virtual void | abort () |
Abort the currently running GUI. More... | |
void | addEvent (const Events::Event &event) |
Add a single event for consideration into the GUI event queue. More... | |
uint32 | processEventQueue () |
Process the current event queue. More... | |
virtual Common::UString | getName () const |
Protected Types | |
enum | WidgetType { kWidgetTypeInvalid = - 1, kWidgetTypeFrame = 0, kWidgetTypeCloseButton = 1, kWidgetTypeCheckBox = 2, kWidgetTypePanel = 3, kWidgetTypeLabel = 5, kWidgetTypeSlider = 6, kWidgetTypeEditBox = 8, kWidgetTypeButton = 9, kWidgetTypeListBox = 100, kWidgetTypeScrollbar = 101 } |
Protected Member Functions | |
void | load (const Common::UString &resref) |
virtual void | fixWidgetType (const Common::UString &tag, WidgetType &type) |
virtual void | initWidget (Widget &widget) |
WidgetFrame * | getFrame (const Common::UString &tag, bool vital=false) |
WidgetClose * | getClose (const Common::UString &tag, bool vital=false) |
WidgetCheckBox * | getCheckBox (const Common::UString &tag, bool vital=false) |
WidgetPanel * | getPanel (const Common::UString &tag, bool vital=false) |
WidgetLabel * | getLabel (const Common::UString &tag, bool vital=false) |
WidgetSlider * | getSlider (const Common::UString &tag, bool vital=false) |
WidgetEditBox * | getEditBox (const Common::UString &tag, bool vital=false) |
WidgetButton * | getButton (const Common::UString &tag, bool vital=false) |
WidgetListBox * | getListBox (const Common::UString &tag, bool vital=false) |
WidgetScrollbar * | getScrollbar (const Common::UString &tag, bool vital=false) |
Protected Member Functions inherited from Engines::GUI | |
void | addWidget (Widget *widget) |
Add a widget. More... | |
void | removeWidget (Widget *widget) |
Remove a widget. More... | |
void | clearWidgets () |
Clear all widgets. More... | |
bool | empty () |
Check if the gui is currently empty. More... | |
bool | hasWidget (const Common::UString &tag) const |
Does this specific widget exist within the GUI? More... | |
Widget * | getWidget (const Common::UString &tag, bool vital=false) |
Return a widget in the GUI. More... | |
const Widget * | getWidget (const Common::UString &tag, bool vital=false) const |
Return a widget in the GUI. More... | |
void | declareGroup (const std::list< Widget *> &group) |
Put these widgets together into a group. More... | |
void | removeFocus () |
Forcefully remove the focus from the current widget. More... | |
void | updateMouse () |
Force an update of the mouse position. More... | |
virtual void | mouseUp () |
The mouse state has changed. More... | |
virtual void | mouseDown () |
uint32 | sub (GUI &gui, uint32 startCode=kStartCodeNone, bool showSelf=true, bool hideSelf=true) |
Open up a sub GUI. More... | |
void | setPosition (float x, float y, float z) |
Set the GUI's position. More... | |
void | getPosition (float &x, float &y, float &z) const |
Get the GUI's position. More... | |
virtual void | callbackRun () |
Callback that's triggered periodically in the run() method. More... | |
virtual void | callbackActive (Widget &widget) |
Callback that's triggered when a widget was activated. More... | |
virtual void | callbackTextInput (const Common::UString &text) |
Callback that's triggered when a text input is received. More... | |
virtual void | callbackKeyInput (const Events::Key &key, const Events::EventType &type) |
Callback that's triggered when a key is pressed or released. More... | |
void | addChild (GUI *gui) |
Add a child GUI object to this GUI. More... | |
void | removeChild (GUI *gui) |
Remove a child GUI object from this GUI. More... | |
Private Member Functions | |
void | loadWidget (const Aurora::GFF3Struct &strct, Widget *parent) |
void | createWidget (WidgetContext &ctx) |
void | initWidget (WidgetContext &ctx) |
void | initWidget (WidgetContext &ctx, WidgetLabel &widget) |
void | initWidget (WidgetContext &ctx, ModelWidget &widget) |
void | initCaption (WidgetContext &ctx, NWNWidgetWithCaption &widget) |
Private Attributes | |
Common::UString | _name |
Additional Inherited Members | |
Static Public Attributes inherited from Engines::GUI | |
static const uint32 | kStartCodeNone = 0 |
static const uint32 | kReturnCodeNone = 0 |
static const uint32 | kReturnCodeAbort = 0xFFFFFFFF |
Protected Attributes inherited from Engines::GUI | |
Console * | _console |
Widget * | _currentWidget |
The widget the mouse is currently on. More... | |
uint32 | _startCode |
The GUI's start code. More... | |
uint32 | _returnCode |
The GUI's return code. More... | |
GUI * | _sub |
The currently running sub GUI. More... | |
|
protected |
Engines::NWN::GUI::GUI | ( | ::Engines::Console * | console = 0 | ) |
|
virtual |
Reimplemented from Engines::GUI.
|
private |
Definition at line 119 of file gui.cpp.
References fixWidgetType(), initWidget(), kWidgetTypeButton, kWidgetTypeCheckBox, kWidgetTypeCloseButton, kWidgetTypeEditBox, kWidgetTypeFrame, kWidgetTypeLabel, kWidgetTypeListBox, kWidgetTypePanel, kWidgetTypeSlider, Engines::NWN::GUI::WidgetContext::model, Engines::NWN::GUI::WidgetContext::tag, Engines::NWN::GUI::WidgetContext::type, and Engines::NWN::GUI::WidgetContext::widget.
Referenced by loadWidget().
|
protectedvirtual |
Reimplemented in Engines::NWN::NewModuleMenu, Engines::NWN::NewPremiumMenu, Engines::NWN::CharPremadeMenu, Engines::NWN::CharSpells, Engines::NWN::CharFeats, Engines::NWN::CharDomain, Engines::NWN::OptionsResolutionMenu, Engines::NWN::CharClass, Engines::NWN::OptionsGameMenu, Engines::NWN::OptionsVideoAdvancedMenu, and Engines::NWN::OptionsSoundAdvancedMenu.
Definition at line 216 of file gui.cpp.
Referenced by createWidget().
|
protected |
Definition at line 306 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::CharAppearance::adjustButtons(), Engines::NWN::CharFeatsPopup::callbackActive(), Engines::NWN::CharClass::callbackActive(), Engines::NWN::CharGenMenu::callbackActive(), Engines::NWN::CharAttributes::callbackActive(), Engines::NWN::CharFeats::changeAvailFeats(), Engines::NWN::CharAlignment::CharAlignment(), Engines::NWN::CharAttributes::CharAttributes(), Engines::NWN::CharDomain::CharDomain(), Engines::NWN::CharFeats::CharFeats(), Engines::NWN::CharFeatsPopup::CharFeatsPopup(), Engines::NWN::CharHelp::CharHelp(), Engines::NWN::CharRace::CharRace(), Engines::NWN::CharSchool::CharSchool(), Engines::NWN::CharSex::CharSex(), Engines::NWN::CharSpells::CharSpells(), Engines::NWN::CharAttributes::hide(), Engines::NWN::CharGenMenu::init(), Engines::NWN::CharAttributes::initButtonsGroup(), Engines::NWN::CharSpells::makeSpellsList(), Engines::NWN::CharDomain::moveDomain(), Engines::NWN::CharAttributes::pointCost(), Engines::NWN::CharSchool::reset(), Engines::NWN::CharSex::reset(), Engines::NWN::CharRace::reset(), Engines::NWN::CharAttributes::reset(), Engines::NWN::CharPortrait::reset(), Engines::NWN::CharPortrait::setMainTexture(), Engines::NWN::CharAttributes::setRecommend(), Engines::NWN::CharPortrait::show(), and Engines::NWN::CharAttributes::updateText().
|
protected |
Definition at line 246 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::OptionsFeedbackMenu::adoptChanges(), Engines::NWN::OptionsVideoAdvancedMenu::adoptChanges(), Engines::NWN::OptionsVideoAdvancedMenu::show(), and Engines::NWN::OptionsFeedbackMenu::show().
|
protected |
Definition at line 234 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
|
protected |
Definition at line 294 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::CharClass::callbackActive(), Engines::NWN::CharPackage::callbackActive(), Engines::NWN::CharAlignment::CharAlignment(), Engines::NWN::CharClass::CharClass(), Engines::NWN::CharHelp::CharHelp(), Engines::NWN::CharRace::CharRace(), Engines::NWN::CharSchool::CharSchool(), Engines::NWN::CharSex::CharSex(), Engines::NWN::CharSkills::CharSkills(), Engines::NWN::CharPackage::createPackageList(), Engines::NWN::CharClass::hide(), Engines::NWN::CharAttributes::init(), Engines::NWN::CharAttributes::initButtonsGroup(), Engines::NWN::WidgetListItemDomain::mouseUp(), Engines::NWN::CharDomain::moveDomain(), Engines::NWN::CharClass::reset(), Engines::NWN::CharSchool::reset(), Engines::NWN::CharAlignment::reset(), Engines::NWN::CharRace::reset(), Engines::NWN::CharSex::reset(), Engines::NWN::CharPackage::reset(), Engines::NWN::CharAttributes::reset(), Engines::NWN::CharSkills::reset(), Engines::NWN::CharHelp::setContent(), Engines::NWN::CharAlignment::show(), and Engines::NWN::CharDomain::updateChosenDomains().
|
protected |
Definition at line 222 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
|
protected |
Definition at line 270 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::CharSkills::changeAvailableSkillRank(), Engines::NWN::CharFeats::changeAvailFeats(), Engines::NWN::CharSkills::CharSkills(), Engines::NWN::CharAttributes::init(), Engines::NWN::WidgetListItemDomain::mouseUp(), Engines::NWN::CharDomain::moveDomain(), Engines::NWN::CharHelp::setContent(), Engines::NWN::CharSkills::setSkillCost(), Engines::NWN::OKCancelDialog::show(), Engines::NWN::YesNoCancelDialog::show(), Engines::NWN::OptionsGameMenu::updateDifficulty(), Engines::NWN::OptionsVideoAdvancedMenu::updateFSAALabel(), Engines::NWN::CharSpells::updateRemainLabel(), Engines::NWN::OptionsVideoMenu::updateTextureQualityLabel(), Engines::NWN::OptionsFeedbackMenu::updateTooltipDelay(), and Engines::NWN::OptionsSoundMenu::updateVolume().
|
protected |
Definition at line 318 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::CharFeatsPopup::callbackActive(), Engines::NWN::OptionsResolutionMenu::callbackActive(), Engines::NWN::CharInfoVoice::callbackActive(), Engines::NWN::CharSkills::callbackActive(), Engines::NWN::CharClass::CharClass(), Engines::NWN::CharDomain::CharDomain(), Engines::NWN::CharFeats::CharFeats(), Engines::NWN::CharPackage::CharPackage(), Engines::NWN::CharSpells::CharSpells(), Engines::NWN::CharSkills::createSkillsList(), Engines::NWN::CharPremadeMenu::getSelectedCharacter(), Engines::NWN::NewModuleMenu::getSelectedModule(), Engines::NWN::NewPremiumMenu::getSelectedModule(), Engines::NWN::CharPremadeMenu::initCharacterList(), Engines::NWN::NewModuleMenu::initModuleList(), Engines::NWN::NewPremiumMenu::initModuleList(), Engines::NWN::CharInfoVoice::initVoicesList(), Engines::NWN::CharSkills::reset(), Engines::NWN::NewModuleMenu::selectedModule(), Engines::NWN::NewPremiumMenu::selectedModule(), Engines::NWN::CharFeatsPopup::setFeats(), Engines::NWN::CharSkills::setRecommendedSkills(), Engines::NWN::OptionsResolutionMenu::show(), Engines::NWN::CharInfoVoice::show(), and Engines::NWN::OptionsGameMenu::updateDifficulty().
|
protected |
Definition at line 258 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::CharPortrait::CharPortrait(), Engines::NWN::CharPortrait::setMainTexture(), Engines::NWN::OKCancelDialog::show(), and Engines::NWN::YesNoCancelDialog::show().
|
protected |
Definition at line 330 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
|
protected |
Definition at line 282 of file gui.cpp.
References Common::UString::c_str(), and Engines::GUI::getWidget().
Referenced by Engines::NWN::OptionsFeedbackMenu::adoptChanges(), Engines::NWN::OptionsGameMenu::adoptChanges(), Engines::NWN::OptionsVideoMenu::callbackActive(), Engines::NWN::OptionsVideoAdvancedMenu::show(), Engines::NWN::OptionsFeedbackMenu::show(), Engines::NWN::OptionsVideoMenu::show(), Engines::NWN::OptionsGameMenu::show(), Engines::NWN::OptionsSoundMenu::show(), and Engines::NWN::OptionsFeedbackMenu::updateTooltipDelay().
|
private |
Definition at line 187 of file gui.cpp.
References Aurora::GFF3Struct::getDouble(), Aurora::GFF3Struct::getString(), Aurora::GFF3Struct::getStruct(), Aurora::GFF3Struct::getUint(), Aurora::GFF3Struct::hasField(), Engines::NWN::NWNWidgetWithCaption::initCaption(), Graphics::Aurora::kHAlignLeft, Aurora::kStrRefInvalid, Graphics::Aurora::kVAlignTop, Engines::NWN::GUI::WidgetContext::strct, and TalkMan.
Referenced by initWidget().
|
protectedvirtual |
Reimplemented in Engines::NWN::NewPremiumMenu, Engines::NWN::OptionsResolutionMenu, Engines::NWN::OKCancelDialog, Engines::NWN::YesNoCancelDialog, Engines::NWN::OptionsGameMenu, Engines::NWN::OptionsSoundMenu, Engines::NWN::IngameMainMenu, Engines::NWN::OptionsMenu, Engines::NWN::OptionsVideoMenu, Engines::NWN::OptionsVideoAdvancedMenu, Engines::NWN::NewXP1Menu, Engines::NWN::NewXP2Menu, and Engines::NWN::OptionsFeedbackMenu.
Definition at line 219 of file gui.cpp.
Referenced by createWidget(), initWidget(), and loadWidget().
|
private |
Definition at line 211 of file gui.cpp.
References initWidget(), and Engines::NWN::GUI::WidgetContext::widget.
|
private |
Definition at line 153 of file gui.cpp.
References Aurora::GFF3Struct::getDouble(), Engines::Widget::getPosition(), initCaption(), Engines::NWN::GUI::WidgetContext::parent, Engines::Widget::setPosition(), Engines::NWN::WidgetLabel::setSize(), Engines::NWN::GUI::WidgetContext::strct, and Engines::NWN::GUI::WidgetContext::widget.
|
private |
Definition at line 171 of file gui.cpp.
References Aurora::GFF3Struct::getDouble(), Engines::Widget::getPosition(), initCaption(), Engines::NWN::GUI::WidgetContext::parent, Engines::NWN::ModelWidget::setPosition(), and Engines::NWN::GUI::WidgetContext::strct.
|
protected |
Definition at line 77 of file gui.cpp.
References _name, Common::StackException::add(), Common::UString::c_str(), Aurora::kFileTypeGUI, loadWidget(), and MKTAG.
Referenced by Engines::NWN::CharAlignment::CharAlignment(), Engines::NWN::CharAppearance::CharAppearance(), Engines::NWN::CharAttributes::CharAttributes(), Engines::NWN::CharClass::CharClass(), Engines::NWN::CharDomain::CharDomain(), Engines::NWN::CharFeats::CharFeats(), Engines::NWN::CharFeatsPopup::CharFeatsPopup(), Engines::NWN::CharGenMenu::CharGenMenu(), Engines::NWN::CharHelp::CharHelp(), Engines::NWN::CharInfoVoice::CharInfoVoice(), Engines::NWN::CharPackage::CharPackage(), Engines::NWN::CharPortrait::CharPortrait(), Engines::NWN::CharPremadeMenu::CharPremadeMenu(), Engines::NWN::CharRace::CharRace(), Engines::NWN::CharSchool::CharSchool(), Engines::NWN::CharSex::CharSex(), Engines::NWN::CharSkills::CharSkills(), Engines::NWN::CharSpells::CharSpells(), Engines::NWN::CharTypeMenu::CharTypeMenu(), Engines::NWN::IngameMainMenu::IngameMainMenu(), Engines::NWN::MainMenu::MainMenu(), Engines::NWN::MoviesBaseMenu::MoviesBaseMenu(), Engines::NWN::MoviesCampMenu::MoviesCampMenu(), Engines::NWN::NewCampMenu::NewCampMenu(), Engines::NWN::NewMenu::NewMenu(), Engines::NWN::NewModuleMenu::NewModuleMenu(), Engines::NWN::NewPremiumMenu::NewPremiumMenu(), Engines::NWN::NewXP1Menu::NewXP1Menu(), Engines::NWN::NewXP2Menu::NewXP2Menu(), Engines::NWN::OKCancelDialog::OKCancelDialog(), Engines::NWN::OptionsControlsMenu::OptionsControlsMenu(), Engines::NWN::OptionsFeedbackMenu::OptionsFeedbackMenu(), Engines::NWN::OptionsGameMenu::OptionsGameMenu(), Engines::NWN::OptionsGorePasswordMenu::OptionsGorePasswordMenu(), Engines::NWN::OptionsMenu::OptionsMenu(), Engines::NWN::OptionsResolutionMenu::OptionsResolutionMenu(), Engines::NWN::OptionsSoundAdvancedMenu::OptionsSoundAdvancedMenu(), Engines::NWN::OptionsSoundMenu::OptionsSoundMenu(), Engines::NWN::OptionsVideoAdvancedMenu::OptionsVideoAdvancedMenu(), Engines::NWN::OptionsVideoMenu::OptionsVideoMenu(), and Engines::NWN::YesNoCancelDialog::YesNoCancelDialog().
|
private |
Definition at line 92 of file gui.cpp.
References Engines::Widget::addChild(), Engines::GUI::addWidget(), createWidget(), Aurora::GFF3Struct::getList(), Aurora::GFF3Struct::getString(), Engines::Widget::getTag(), Aurora::GFF3Struct::hasField(), initWidget(), Engines::NWN::GUI::WidgetContext::parent, Engines::NWN::GUI::WidgetContext::strct, and Engines::NWN::GUI::WidgetContext::widget.
Referenced by load().
|
private |