xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
Engines::Widget Class Reference

A widget in a GUI. More...

#include <widget.h>

Inheritance diagram for Engines::Widget:
Inheritance graph
[legend]
Collaboration diagram for Engines::Widget:
Collaboration graph
[legend]

Public Member Functions

 Widget (GUI &gui, const Common::UString &tag)
 
virtual ~Widget ()
 
const Common::UStringgetTag () const
 Get the widget's tag. More...
 
virtual void setTag (const Common::UString &tag)
 Set the widget's tag. More...
 
bool isActive () const
 Was the widget activated? More...
 
bool isVisible () const
 Is the widget visible? More...
 
bool isDisabled () const
 Is the widget disabled? More...
 
bool isInvisible () const
 Is the widget invisible (never visible)? More...
 
virtual void show ()
 Show the widget. More...
 
virtual void hide ()
 Hide the widget. More...
 
WidgetgetParent ()
 
const WidgetgetParent () const
 
WidgetgetChild (const Common::UString &childTag)
 Get the widget's child by tag. More...
 
virtual void setPosition (float x, float y, float z)
 Set the widget's position. More...
 
virtual void movePosition (float x, float y, float z)
 Move the widget, relative to its current position. More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Get the widget's position. More...
 
virtual float getWidth () const
 Get the widget's width. More...
 
virtual float getHeight () const
 Get the widget's height. More...
 
virtual void setDisabled (bool disabled)
 Disable/Enable the widget. More...
 
virtual void setInvisible (bool invisible)
 Make the widget invisible. More...
 
virtual void enter ()
 The mouse entered the widget. More...
 
virtual void leave ()
 The mouse left the widget. More...
 
virtual void mouseMove (uint8 state, float x, float y)
 The mouse was moved over the widget. More...
 
virtual void mouseDown (uint8 state, float x, float y)
 A mouse button was pressed on the widget. More...
 
virtual void mouseUp (uint8 state, float x, float y)
 A mouse button was released on the widget. More...
 
virtual void mouseWheel (uint8 state, int x, int y)
 A mouse wheel was used on the widget. More...
 
virtual void mouseDblClick (uint8 state, float x, float y)
 A mouse button was double-clicked on the widget. More...
 
virtual void subActive (Widget &widget)
 A sub-widget was activated. More...
 
void remove ()
 Remove the widget from the GUI. More...
 
virtual void addSub (Widget &widget)
 Add a sub-widget to the widget. More...
 
virtual void addChild (Widget &widget)
 Add a child to the widget. More...
 
virtual void addGroupMember (Widget &widget)
 Add a fellow group member to the widget. More...
 
virtual void removeSub (Widget &widget)
 Remove a sub-widget from the widget. More...
 
virtual void removeChild (Widget &widget)
 Remove a child from the widget. More...
 
virtual void removeGroupMember (Widget &widget)
 Remove fellow group member from the widget. More...
 

Protected Member Functions

virtual void signalGroupMemberActive ()
 A fellow group member signaled that it is now active. More...
 
void setActive (bool active)
 The widget's active state. More...
 
void raiseCallbackActive (Widget &widget)
 

Protected Attributes

GUI_gui
 The GUI the widget belongs to. More...
 
Common::UString _tag
 The widget's tag. More...
 
Widget_parent
 The widget's parent, if any. More...
 
Widget_owner
 The widget's owner, if any. More...
 
std::list< Widget * > _subWidgets
 The widget's sub-widgets. More...
 
std::list< Widget * > _children
 The widget's children. More...
 
std::list< Widget * > _groupMembers
 The widget's fellow group members. More...
 

Private Attributes

bool _active
 Was the widget activated? More...
 
bool _visible
 Is the widget visible? More...
 
bool _disabled
 Is the widget disabled? More...
 
bool _invisible
 Is the widget invisible (never visible)? More...
 
float _x
 The widget X position. More...
 
float _y
 The widget Y position. More...
 
float _z
 The widget Z position. More...
 
uint8 _lastClickButton
 
uint32 _lastClickTime
 
float _lastClickX
 
float _lastClickY
 

Friends

class GUI
 

Detailed Description

A widget in a GUI.

Definition at line 40 of file widget.h.

Constructor & Destructor Documentation

◆ Widget()

Engines::Widget::Widget ( GUI gui,
const Common::UString tag 
)

Definition at line 34 of file widget.cpp.

◆ ~Widget()

Engines::Widget::~Widget ( )
virtual

Definition at line 42 of file widget.cpp.

Member Function Documentation

◆ addChild()

void Engines::Widget::addChild ( Widget widget)
virtual

◆ addGroupMember()

void Engines::Widget::addGroupMember ( Widget widget)
virtual

Add a fellow group member to the widget.

Definition at line 222 of file widget.cpp.

References _groupMembers.

Referenced by Engines::NWN::WidgetListBox::add(), and Engines::NWN::CharDomain::moveDomain().

Here is the caller graph for this function:

◆ addSub()

void Engines::Widget::addSub ( Widget widget)
virtual

◆ enter()

void Engines::Widget::enter ( )
virtual

◆ getChild()

Widget * Engines::Widget::getChild ( const Common::UString childTag)

Get the widget's child by tag.

Definition at line 110 of file widget.cpp.

References _children.

Referenced by Engines::NWN::CharSpells::showSpellLevel().

Here is the caller graph for this function:

◆ getHeight()

float Engines::Widget::getHeight ( ) const
virtual

◆ getParent() [1/2]

Widget * Engines::Widget::getParent ( )

Definition at line 102 of file widget.cpp.

References _parent.

Referenced by Engines::NWN::CharAttributes::callbackActive().

Here is the caller graph for this function:

◆ getParent() [2/2]

const Widget * Engines::Widget::getParent ( ) const

Definition at line 106 of file widget.cpp.

References _parent.

◆ getPosition()

void Engines::Widget::getPosition ( float &  x,
float &  y,
float &  z 
) const
virtual

Get the widget's position.

Definition at line 140 of file widget.cpp.

References _x, _y, and _z.

Referenced by Engines::NWN::CharAppearance::adjustButtons(), Engines::NWN::WidgetSlider::changedValue(), Engines::NWN::CharHelp::CharHelp(), Engines::WidgetListBox::createScrollbar(), Engines::KotORJadeWidget::createText(), Engines::NWN::Tooltip::getParentPosition(), Engines::NWN::WidgetLabel::initCaption(), Engines::NWN::NWNWidgetWithCaption::initCaption(), Engines::KotOR2::GUI::initWidget(), Engines::KotOR::MainMenu::initWidget(), Engines::NWN::GUI::initWidget(), Engines::WidgetScrollbar::load(), Engines::KotORInventoryItem::load(), Engines::WidgetProgressbar::load(), Engines::Jade::GUI::loadWidget(), Engines::KotOR::GUI::loadWidget(), Engines::Jade::MainMenu::MainMenu(), Engines::KotOR::Menu::Menu(), Engines::NWN::WidgetGridBox::mouseDown(), Engines::NWN::WidgetListBox::mouseDown(), Engines::WidgetListBox::positionItemWidgets(), Engines::WidgetListBox::refreshItemWidgets(), Engines::KotORJadeWidget::setFill(), Engines::WidgetScrollbar::setHeight(), Engines::KotORJadeWidget::setHighlight(), Engines::WidgetScrollbar::setPosition(), Engines::WidgetProgressbar::setPosition(), Engines::KotORInventoryItem::setPosition(), Engines::NWN::WidgetListItemBaseButton::setPosition(), Engines::NWN::QuickbarButton::setPosition(), Engines::NWN::WidgetListItemPremium::setPosition(), Engines::NWN::WidgetListItemModule::setPosition(), Engines::NWN::ModelWidget::setPosition(), Engines::NWN::WidgetListItemCharacter::setPosition(), Engines::NWN::NWNWidgetWithCaption::setPosition(), Engines::NWN::QuadWidget::setPosition(), Engines::NWN::WidgetListItemTextLine::setPosition(), Engines::KotORJadeWidget::setPosition(), Engines::GUI::setPosition(), Engines::NWN::WidgetListBox::setPosition(), Engines::NWN::PortraitWidget::setPosition(), Engines::NWN::WidgetScrollbar::setState(), Engines::KotORJadeWidget::setSubScene(), Engines::NWN::WidgetLabel::setText(), Engines::NWN::WidgetEditBox::setTitle(), Engines::WidgetScrollbar::setWidth(), Engines::NWN::YesNoCancelDialog::show(), Engines::NWN::OKCancelDialog::show(), Engines::KotOR::HUD::update(), and Engines::NWN::CharDomain::updateChosenDomains().

◆ getTag()

const Common::UString & Engines::Widget::getTag ( ) const

Get the widget's tag.

Definition at line 45 of file widget.cpp.

References _tag.

Referenced by Engines::NWN::WidgetListBox::add(), addSub(), Engines::GUI::addWidget(), Engines::Jade::ControlOptionsMenu::callbackActive(), Engines::Jade::DifficultyOptionsMenu::callbackActive(), Engines::Jade::GameInfoOptionsMenu::callbackActive(), Engines::Jade::VideoOptionsMenu::callbackActive(), Engines::KotOR2::CharacterGenerationPortraitMenu::callbackActive(), Engines::KotOR::MenuAbilities::callbackActive(), Engines::KotOR::MenuCharacter::callbackActive(), Engines::KotOR::MenuInventory::callbackActive(), Engines::Jade::AudioOptionsMenu::callbackActive(), Engines::KotOR::MenuJournal::callbackActive(), Engines::KotOR::MenuMessages::callbackActive(), Engines::KotOR::OptionsFeedbackMenu::callbackActive(), Engines::KotOR::OptionsKeyboardConfigurationMenu::callbackActive(), Engines::KotOR2::CustomCharPanel::callbackActive(), Engines::KotOR2::QuickOrCustomPanel::callbackActive(), Engines::KotOR::MoviesMenu::callbackActive(), Engines::KotOR::OptionsResolutionMenu::callbackActive(), Engines::KotOR::CustomCharPanel::callbackActive(), Engines::KotOR::QuickCharPanel::callbackActive(), Engines::KotOR2::QuickCharPanel::callbackActive(), Engines::NWN::MoviesBaseMenu::callbackActive(), Engines::NWN::OptionsControlsMenu::callbackActive(), Engines::NWN::OptionsGorePasswordMenu::callbackActive(), Engines::KotOR::OptionsAutoPauseMenu::callbackActive(), Engines::KotOR::OptionsGraphicsAdvancedMenu::callbackActive(), Engines::KotOR::OptionsMouseSettingsMenu::callbackActive(), Engines::KotOR::OptionsSoundMenu::callbackActive(), Engines::KotOR::OptionsSoundAdvancedMenu::callbackActive(), Engines::KotOR::QuickOrCustomPanel::callbackActive(), Engines::KotOR::PartySelectionGUI::callbackActive(), Engines::KotOR::CharacterGenerationNameMenu::callbackActive(), Engines::KotOR::CharacterGenerationPortraitMenu::callbackActive(), Engines::NWN::OptionsSoundAdvancedMenu::callbackActive(), Engines::NWN::MoviesCampMenu::callbackActive(), Engines::KotOR2::MainMenu::callbackActive(), Engines::KotOR::OptionsGameplayMenu::callbackActive(), Engines::KotOR::OptionsGraphicsMenu::callbackActive(), Engines::NWN::NewXP2Menu::callbackActive(), Engines::KotOR2::CharacterGenerationNameMenu::callbackActive(), Engines::KotOR::ConfirmDialog::callbackActive(), Engines::NWN::NewXP1Menu::callbackActive(), Engines::NWN::OptionsFeedbackMenu::callbackActive(), Engines::KotOR::ContainerMenu::callbackActive(), Engines::NWN::CharTypeMenu::callbackActive(), Engines::NWN::NewMenu::callbackActive(), Engines::NWN::NewCampMenu::callbackActive(), Engines::NWN::OptionsVideoAdvancedMenu::callbackActive(), Engines::Jade::MainMenu::callbackActive(), Engines::NWN::OptionsVideoMenu::callbackActive(), Engines::KotOR2::ClassSelection::callbackActive(), Engines::NWN::CharAppearance::callbackActive(), Engines::NWN::CharFeatsPopup::callbackActive(), Engines::NWN::CharHelp::callbackActive(), Engines::NWN::OptionsMenu::callbackActive(), Engines::KotOR::MenuMap::callbackActive(), Engines::NWN::IngameMainMenu::callbackActive(), Engines::NWN::CharRace::callbackActive(), Engines::NWN::CharSchool::callbackActive(), Engines::NWN::CharSex::callbackActive(), Engines::KotOR::OptionsMenu::callbackActive(), Engines::NWN::OptionsGameMenu::callbackActive(), Engines::NWN::OptionsSoundMenu::callbackActive(), Engines::NWN::CharAlignment::callbackActive(), Engines::NWN::CharClass::callbackActive(), Engines::KotOR::MainMenu::callbackActive(), Engines::NWN::CharGenMenu::callbackActive(), Engines::NWN::CharPackage::callbackActive(), Engines::NWN::MainMenu::callbackActive(), Engines::NWN::OKCancelDialog::callbackActive(), Engines::NWN::YesNoCancelDialog::callbackActive(), Engines::NWN::OptionsResolutionMenu::callbackActive(), Engines::KotOR::MenuOptions::callbackActive(), Engines::KotOR::MenuEquipment::callbackActive(), Engines::KotOR::ClassSelectionMenu::callbackActive(), Engines::KotOR::DialogGUIBase::callbackActive(), Engines::NWN::CharAttributes::callbackActive(), Engines::KotOR::SaveLoadMenu::callbackActive(), Engines::NWN::PartyLeader::callbackActive(), Engines::NWN::CharInfoVoice::callbackActive(), Engines::NWN::CharDomain::callbackActive(), Engines::NWN::CharPortrait::callbackActive(), Engines::NWN::CharSkills::callbackActive(), Engines::NWN::CharFeats::callbackActive(), Engines::NWN::CharSpells::callbackActive(), Engines::NWN::CharPremadeMenu::callbackActive(), Engines::Jade::OptionsMenu::callbackActive(), Engines::KotOR::HUD::callbackActive(), Engines::NWN::NewModuleMenu::callbackActive(), Engines::KotOR::Menu::callbackActive(), Engines::NWN::NewPremiumMenu::callbackActive(), Engines::NWN::WidgetListBox::createScrollbar(), Engines::KotORJadeWidget::createText(), Engines::NWN::NWNWidgetWithCaption::initCaption(), Engines::KotOR2::GUI::initWidget(), Engines::KotOR2::HUD::initWidget(), Engines::KotOR2::MainMenu::initWidget(), Engines::NWN::OptionsFeedbackMenu::initWidget(), Engines::NWN::NewXP1Menu::initWidget(), Engines::NWN::NewXP2Menu::initWidget(), Engines::NWN::OptionsVideoAdvancedMenu::initWidget(), Engines::NWN::IngameMainMenu::initWidget(), Engines::NWN::OptionsVideoMenu::initWidget(), Engines::NWN::OptionsMenu::initWidget(), Engines::NWN::OKCancelDialog::initWidget(), Engines::KotOR::MainMenu::initWidget(), Engines::NWN::OptionsGameMenu::initWidget(), Engines::NWN::OptionsSoundMenu::initWidget(), Engines::NWN::YesNoCancelDialog::initWidget(), Engines::NWN::OptionsResolutionMenu::initWidget(), Engines::KotOR::HUD::initWidget(), Engines::NWN::NewPremiumMenu::initWidget(), Engines::KotORJadeWidget::load(), Engines::NWN::GUI::loadWidget(), Engines::NWN::CharFeats::moveFeat(), Engines::NWN::WidgetListItem::operator<(), Engines::NWN::QuickbarButton::QuickbarButton(), Engines::GUI::removeWidget(), Engines::KotORJadeWidget::setFill(), Engines::KotORJadeWidget::setHighlight(), Engines::KotORJadeWidget::setTag(), Engines::NWN::PortraitWidget::setTag(), Engines::NWN::WidgetListItemDomain::subActive(), Engines::NWN::WidgetGridBox::subActive(), Engines::NWN::WidgetListItemSkill::subActive(), Engines::NWN::WidgetListItemFeat::subActive(), Engines::NWN::WidgetListItemSpell::subActive(), Engines::WidgetListBox::subActive(), and Engines::NWN::WidgetListBox::subActive().

◆ getWidth()

float Engines::Widget::getWidth ( ) const
virtual

◆ hide()

void Engines::Widget::hide ( )
virtual

◆ isActive()

bool Engines::Widget::isActive ( ) const

Was the widget activated?

Definition at line 55 of file widget.cpp.

References _active.

Referenced by Engines::GUI::checkWidgetActive().

Here is the caller graph for this function:

◆ isDisabled()

bool Engines::Widget::isDisabled ( ) const

◆ isInvisible()

bool Engines::Widget::isInvisible ( ) const

◆ isVisible()

bool Engines::Widget::isVisible ( ) const

◆ leave()

void Engines::Widget::leave ( )
virtual

◆ mouseDblClick()

void Engines::Widget::mouseDblClick ( uint8  state,
float  x,
float  y 
)
virtual

A mouse button was double-clicked on the widget.

Reimplemented in Engines::NWN::WidgetListItem, and Engines::NWN::WidgetListItemDomain.

Definition at line 200 of file widget.cpp.

Referenced by Engines::GUI::mouseUp().

Here is the caller graph for this function:

◆ mouseDown()

void Engines::Widget::mouseDown ( uint8  state,
float  x,
float  y 
)
virtual

◆ mouseMove()

void Engines::Widget::mouseMove ( uint8  state,
float  x,
float  y 
)
virtual

The mouse was moved over the widget.

Reimplemented in Engines::NWN::WidgetScrollbar, and Engines::NWN::WidgetSlider.

Definition at line 188 of file widget.cpp.

Referenced by Engines::GUI::mouseMove().

Here is the caller graph for this function:

◆ mouseUp()

void Engines::Widget::mouseUp ( uint8  state,
float  x,
float  y 
)
virtual

◆ mouseWheel()

void Engines::Widget::mouseWheel ( uint8  state,
int  x,
int  y 
)
virtual

◆ movePosition()

void Engines::Widget::movePosition ( float  x,
float  y,
float  z 
)
virtual

Move the widget, relative to its current position.

Definition at line 136 of file widget.cpp.

References _x, _y, _z, and setPosition().

Referenced by Engines::NWN::CharSkills::CharSkills().

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

◆ raiseCallbackActive()

void Engines::Widget::raiseCallbackActive ( Widget widget)
protected

Definition at line 281 of file widget.cpp.

References _gui, and Engines::GUI::callbackActive().

Referenced by Engines::WidgetListBox::subActive().

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

◆ remove()

void Engines::Widget::remove ( )

Remove the widget from the GUI.

Definition at line 258 of file widget.cpp.

References _gui, hide(), and Engines::GUI::removeWidget().

Referenced by Engines::NWN::CharHelp::CharHelp(), Engines::NWN::WidgetGridItemPortrait::~WidgetGridItemPortrait(), and Engines::NWN::WidgetListItemSkill::~WidgetListItemSkill().

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

◆ removeChild()

void Engines::Widget::removeChild ( Widget widget)
virtual

Remove a child from the widget.

Definition at line 238 of file widget.cpp.

References _children, and _parent.

Referenced by Engines::GUI::removeWidget().

Here is the caller graph for this function:

◆ removeGroupMember()

void Engines::Widget::removeGroupMember ( Widget widget)
virtual

Remove fellow group member from the widget.

Definition at line 249 of file widget.cpp.

References _groupMembers.

Referenced by Engines::NWN::WidgetListBox::remove().

Here is the caller graph for this function:

◆ removeSub()

void Engines::Widget::removeSub ( Widget widget)
virtual

Remove a sub-widget from the widget.

Definition at line 227 of file widget.cpp.

References _owner, and _subWidgets.

Referenced by Engines::NWN::WidgetListBox::remove(), and Engines::GUI::removeWidget().

Here is the caller graph for this function:

◆ setActive()

void Engines::Widget::setActive ( bool  active)
protected

◆ setDisabled()

void Engines::Widget::setDisabled ( bool  disabled)
virtual

◆ setInvisible()

void Engines::Widget::setInvisible ( bool  invisible)
virtual

◆ setPosition()

void Engines::Widget::setPosition ( float  x,
float  y,
float  z 
)
virtual

◆ setTag()

void Engines::Widget::setTag ( const Common::UString tag)
virtual

◆ show()

void Engines::Widget::show ( )
virtual

◆ signalGroupMemberActive()

void Engines::Widget::signalGroupMemberActive ( )
protectedvirtual

A fellow group member signaled that it is now active.

Reimplemented in Engines::NWN::WidgetListItem, and Engines::NWN::WidgetCheckBox.

Definition at line 264 of file widget.cpp.

References _active.

Referenced by Engines::NWN::WidgetCheckBox::signalGroupMemberActive(), and Engines::NWN::WidgetListItem::signalGroupMemberActive().

Here is the caller graph for this function:

◆ subActive()

void Engines::Widget::subActive ( Widget widget)
virtual

Friends And Related Function Documentation

◆ GUI

friend class GUI
friend

Definition at line 140 of file widget.h.

Member Data Documentation

◆ _active

bool Engines::Widget::_active
private

Was the widget activated?

Definition at line 126 of file widget.h.

Referenced by isActive(), setActive(), and signalGroupMemberActive().

◆ _children

std::list<Widget *> Engines::Widget::_children
protected

The widget's children.

Definition at line 116 of file widget.h.

Referenced by addChild(), getChild(), hide(), removeChild(), setDisabled(), setInvisible(), setPosition(), and show().

◆ _disabled

bool Engines::Widget::_disabled
private

Is the widget disabled?

Definition at line 128 of file widget.h.

Referenced by isDisabled(), and setDisabled().

◆ _groupMembers

std::list<Widget *> Engines::Widget::_groupMembers
protected

◆ _gui

GUI* Engines::Widget::_gui
protected

◆ _invisible

bool Engines::Widget::_invisible
private

Is the widget invisible (never visible)?

Definition at line 129 of file widget.h.

Referenced by isInvisible(), setInvisible(), and show().

◆ _lastClickButton

uint8 Engines::Widget::_lastClickButton
private

Definition at line 135 of file widget.h.

Referenced by Engines::GUI::mouseUp(), and show().

◆ _lastClickTime

uint32 Engines::Widget::_lastClickTime
private

Definition at line 136 of file widget.h.

Referenced by Engines::GUI::mouseUp(), and show().

◆ _lastClickX

float Engines::Widget::_lastClickX
private

Definition at line 137 of file widget.h.

Referenced by Engines::GUI::mouseUp(), and show().

◆ _lastClickY

float Engines::Widget::_lastClickY
private

Definition at line 138 of file widget.h.

Referenced by Engines::GUI::mouseUp(), and show().

◆ _owner

Widget* Engines::Widget::_owner
protected

◆ _parent

Widget* Engines::Widget::_parent
protected

The widget's parent, if any.

Definition at line 112 of file widget.h.

Referenced by addChild(), getParent(), removeChild(), Engines::GUI::removeWidget(), and Engines::GUI::setPosition().

◆ _subWidgets

std::list<Widget *> Engines::Widget::_subWidgets
protected

The widget's sub-widgets.

Definition at line 115 of file widget.h.

Referenced by addSub(), removeSub(), setDisabled(), setInvisible(), and Engines::NWN::WidgetListBox::setPosition().

◆ _tag

Common::UString Engines::Widget::_tag
protected

◆ _visible

bool Engines::Widget::_visible
private

Is the widget visible?

Definition at line 127 of file widget.h.

Referenced by hide(), isVisible(), and show().

◆ _x

float Engines::Widget::_x
private

The widget X position.

Definition at line 131 of file widget.h.

Referenced by getPosition(), movePosition(), and setPosition().

◆ _y

float Engines::Widget::_y
private

The widget Y position.

Definition at line 132 of file widget.h.

Referenced by getPosition(), movePosition(), and setPosition().

◆ _z

float Engines::Widget::_z
private

The widget Z position.

Definition at line 133 of file widget.h.

Referenced by getPosition(), movePosition(), and setPosition().


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