xoreos  0.0.5
Classes | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::NWN::GUI Class Reference

A NWN GUI. More...

#include <gui.h>

Inheritance diagram for Engines::NWN::GUI:
Inheritance graph
[legend]
Collaboration diagram for Engines::NWN::GUI:
Collaboration graph
[legend]

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)
 
WidgetFramegetFrame (const Common::UString &tag, bool vital=false)
 
WidgetClosegetClose (const Common::UString &tag, bool vital=false)
 
WidgetCheckBoxgetCheckBox (const Common::UString &tag, bool vital=false)
 
WidgetPanelgetPanel (const Common::UString &tag, bool vital=false)
 
WidgetLabelgetLabel (const Common::UString &tag, bool vital=false)
 
WidgetSlidergetSlider (const Common::UString &tag, bool vital=false)
 
WidgetEditBoxgetEditBox (const Common::UString &tag, bool vital=false)
 
WidgetButtongetButton (const Common::UString &tag, bool vital=false)
 
WidgetListBoxgetListBox (const Common::UString &tag, bool vital=false)
 
WidgetScrollbargetScrollbar (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...
 
WidgetgetWidget (const Common::UString &tag, bool vital=false)
 Return a widget in the GUI. More...
 
const WidgetgetWidget (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...
 

Detailed Description

A NWN GUI.

Definition at line 54 of file gui.h.

Member Enumeration Documentation

◆ WidgetType

Enumerator
kWidgetTypeInvalid 
kWidgetTypeFrame 
kWidgetTypeCloseButton 
kWidgetTypeCheckBox 
kWidgetTypePanel 
kWidgetTypeLabel 
kWidgetTypeSlider 
kWidgetTypeEditBox 
kWidgetTypeButton 
kWidgetTypeListBox 
kWidgetTypeScrollbar 

Definition at line 60 of file gui.h.

Constructor & Destructor Documentation

◆ GUI()

Engines::NWN::GUI::GUI ( ::Engines::Console console = 0)

Definition at line 71 of file gui.cpp.

◆ ~GUI()

Engines::NWN::GUI::~GUI ( )
virtual

Reimplemented from Engines::GUI.

Definition at line 74 of file gui.cpp.

Member Function Documentation

◆ createWidget()

void Engines::NWN::GUI::createWidget ( WidgetContext ctx)
private

◆ fixWidgetType()

void Engines::NWN::GUI::fixWidgetType ( const Common::UString tag,
WidgetType type 
)
protectedvirtual

◆ getButton()

WidgetButton * Engines::NWN::GUI::getButton ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getCheckBox()

WidgetCheckBox * Engines::NWN::GUI::getCheckBox ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getClose()

WidgetClose * Engines::NWN::GUI::getClose ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 234 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Here is the call graph for this function:

◆ getEditBox()

WidgetEditBox * Engines::NWN::GUI::getEditBox ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getFrame()

WidgetFrame * Engines::NWN::GUI::getFrame ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 222 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Here is the call graph for this function:

◆ getLabel()

WidgetLabel * Engines::NWN::GUI::getLabel ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getListBox()

WidgetListBox * Engines::NWN::GUI::getListBox ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getPanel()

WidgetPanel * Engines::NWN::GUI::getPanel ( const Common::UString tag,
bool  vital = false 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getScrollbar()

WidgetScrollbar * Engines::NWN::GUI::getScrollbar ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 330 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Here is the call graph for this function:

◆ getSlider()

WidgetSlider * Engines::NWN::GUI::getSlider ( const Common::UString tag,
bool  vital = false 
)
protected

◆ initCaption()

void Engines::NWN::GUI::initCaption ( WidgetContext ctx,
NWNWidgetWithCaption widget 
)
private

◆ initWidget() [1/4]

void Engines::NWN::GUI::initWidget ( Widget widget)
protectedvirtual

◆ initWidget() [2/4]

void Engines::NWN::GUI::initWidget ( WidgetContext ctx)
private

Definition at line 211 of file gui.cpp.

References initWidget(), and Engines::NWN::GUI::WidgetContext::widget.

Here is the call graph for this function:

◆ initWidget() [3/4]

void Engines::NWN::GUI::initWidget ( WidgetContext ctx,
WidgetLabel widget 
)
private

◆ initWidget() [4/4]

void Engines::NWN::GUI::initWidget ( WidgetContext ctx,
ModelWidget widget 
)
private

◆ load()

void Engines::NWN::GUI::load ( const Common::UString resref)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadWidget()

void Engines::NWN::GUI::loadWidget ( const Aurora::GFF3Struct strct,
Widget parent 
)
private

Member Data Documentation

◆ _name

Common::UString Engines::NWN::GUI::_name
private

Definition at line 107 of file gui.h.

Referenced by load().


The documentation for this class was generated from the following files: