ManaPlus
Public Member Functions | Static Public Member Functions | Data Fields | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Static Private Attributes | Friends
Widget Class Referenceabstract

#include <widget.h>

Inheritance diagram for Widget:
Widget2 BasicContainer BrowserBox Button CheckBox EmotePage GuiTable Icon ItemContainer Label ListBox PlayerBox ProgressBar ProgressIndicator RadioButton ShortcutContainer SkillRectangleListBox Slider StaticBrowserBox TextBox TextField TextPreview

Public Member Functions

 Widget (const Widget2 *const widget)
 
virtual ~Widget ()
 
virtual void draw (Graphics *const graphics)=0
 
virtual void safeDraw (Graphics *const graphics)=0
 
virtual void drawFrame (Graphics *graphics)
 
virtual void safeDrawFrame (Graphics *graphics)
 
void setFrameSize (const unsigned int frameSize)
 
unsigned int getFrameSize () const
 
virtual void logic ()
 
WidgetgetParent () const
 
void setWidth (const int width)
 
int getWidth () const
 
void setHeight (const int height)
 
int getHeight () const
 
void setSize (const int width, const int height)
 
void setX (const int x)
 
int getX () const
 
void setY (const int y)
 
int getY () const
 
void setPosition (const int x, const int y)
 
void setDimension (const Rect &dimension)
 
const RectgetDimension () const
 
void setFocusable (const bool focusable)
 
bool isFocusable () const
 
virtual bool isFocused () const
 
void setEnabled (const bool enabled)
 
bool isEnabled () const
 
void setVisible (Visible visible)
 
bool isVisible () const
 
void setBaseColor (const Color &color)
 
const ColorgetBaseColor () const
 
void setForegroundColor (const Color &color)
 
const ColorgetForegroundColor () const
 
void setBackgroundColor (const Color &color)
 
const ColorgetBackgroundColor () const
 
virtual void requestFocus ()
 
virtual void requestMoveToTop ()
 
virtual void requestMoveToBottom ()
 
virtual void setFocusHandler (FocusHandler *const focusHandler)
 
FocusHandlergetFocusHandler ()
 
void addActionListener (ActionListener *const actionListener)
 
void removeActionListener (ActionListener *const actionListener)
 
void addDeathListener (WidgetDeathListener *const deathListener)
 
void removeDeathListener (WidgetDeathListener *const deathListener)
 
void addMouseListener (MouseListener *const mouseListener)
 
void removeMouseListener (MouseListener *const mouseListener)
 
void addKeyListener (KeyListener *const keyListener)
 
void removeKeyListener (KeyListener *const keyListener)
 
void addFocusListener (FocusListener *const focusListener)
 
void removeFocusListener (FocusListener *const focusListener)
 
void addWidgetListener (WidgetListener *const widgetListener)
 
void removeWidgetListener (WidgetListener *const widgetListener)
 
void setActionEventId (const std::string &actionEventId)
 
const std::string & getActionEventId () const
 
virtual void getAbsolutePosition (int &x, int &y) const
 
virtual void setParent (Widget *parent)
 
FontgetFont () const
 
void setFont (Font *const font)
 
virtual void fontChanged ()
 
bool isTabInEnabled () const
 
void setTabInEnabled (const bool enabled)
 
bool isTabOutEnabled () const
 
void setTabOutEnabled (const bool enabled)
 
void requestModalFocus ()
 
virtual void requestModalMouseInputFocus ()
 
virtual void releaseModalFocus ()
 
virtual void releaseModalMouseInputFocus ()
 
virtual bool isModalFocused () const
 
virtual bool isModalMouseInputFocused () const
 
virtual WidgetgetWidgetAt (int x, int y)
 
const std::list< MouseListener * > & getMouseListeners () const A_CONST
 
const std::list< KeyListener * > & getKeyListeners () const A_CONST
 
const std::list< FocusListener * > & getFocusListeners () const A_CONST
 
virtual Rect getChildrenArea ()
 
virtual FocusHandlergetInternalFocusHandler ()
 
void setInternalFocusHandler (FocusHandler *const internalFocusHandler)
 
virtual void moveToTop (Widget *widget)
 
virtual void moveToBottom (Widget *widget)
 
virtual void focusNext ()
 
virtual void focusPrevious ()
 
virtual void showWidgetPart (Widget *const widget, const Rect &area)
 
void setId (const std::string &id)
 
const std::string & getId () const
 
virtual void showPart (const Rect &rectangle)
 
bool isAllowLogic () const
 
void setMouseConsume (const bool b)
 
bool isMouseConsume () const
 
void setRedraw (const bool b)
 
virtual bool isSelectable () const
 
void setSelectable (const bool selectable)
 
void windowResized ()
 
virtual void postInit ()
 
- Public Member Functions inherited from Widget2
virtual ~Widget2 ()
 
const ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha=255U) const A_INLINE
 
const ColorgetThemeCharColor (const signed char c, bool &valid) const A_INLINE
 
virtual void setWidget2 (const Widget2 *const widget)
 
void setPalette (int palette)
 
void checkPalette ()
 
void setForegroundColor2 (const Color &color)
 
WidgetgetWindow () const
 
virtual void setWindow (Widget *const window)
 

Static Public Member Functions

static void setGlobalFont (Font *const font)
 
static FontgetGloablFont ()
 
static void cleanGlobalFont ()
 
static bool widgetExists (const Widget *const widget)
 
static void distributeWindowResizeEvent ()
 
static WidgetcallPostInit (Widget *const widget)
 

Data Fields

Visible mVisible
 

Protected Types

typedef std::list< MouseListener * > MouseListenerList
 
typedef MouseListenerList::iterator MouseListenerIterator
 
typedef std::list< KeyListener * > KeyListenerList
 
typedef KeyListenerList::iterator KeyListenerIterator
 
typedef std::list< ActionListener * > ActionListenerList
 
typedef ActionListenerList::iterator ActionListenerIterator
 
typedef std::list< WidgetDeathListener * > WidgetDeathListenerList
 
typedef WidgetDeathListenerList::iterator WidgetDeathListenerIterator
 
typedef std::list< FocusListener * > FocusListenerList
 
typedef FocusListenerList::iterator FocusListenerIterator
 
typedef std::list< WidgetListener * > WidgetListenerList
 
typedef WidgetListenerList::iterator WidgetListenerIterator
 

Protected Member Functions

void distributeActionEvent ()
 
void distributeResizedEvent ()
 
void distributeMovedEvent ()
 
void distributeHiddenEvent ()
 
void distributeShownEvent ()
 
- Protected Member Functions inherited from Widget2
 Widget2 (const Widget2 *const widget)
 

Protected Attributes

MouseListenerList mMouseListeners
 
KeyListenerList mKeyListeners
 
ActionListenerList mActionListeners
 
WidgetDeathListenerList mDeathListeners
 
FocusListenerList mFocusListeners
 
WidgetListenerList mWidgetListeners
 
Color mForegroundColor
 
Color mBackgroundColor
 
Color mBaseColor
 
Rect mDimension
 
std::string mActionEventId
 
std::string mId
 
FocusHandlermFocusHandler
 
FocusHandlermInternalFocusHandler
 
WidgetmParent
 
FontmCurrentFont
 
unsigned int mFrameSize
 
bool mFocusable
 
bool mTabIn
 
bool mTabOut
 
bool mEnabled
 
bool mAllowLogic
 
bool mMouseConsume
 
bool mRedraw
 
bool mSelectable
 
- Protected Attributes inherited from Widget2
int mPaletteOffset
 
WidgetmWindow
 
Color mForegroundColor2
 

Static Protected Attributes

static FontmGlobalFont = 0
 

Static Private Attributes

static std::list< Widget * > mAllWidgets
 
static std::set< Widget * > mAllWidgetsSet
 

Friends

class BasicContainer
 

Detailed Description

Abstract class for widgets of Guichan. It contains basic functions every widget should have.

NOTE: Functions begining with underscore "_" should not be overloaded unless you know what you are doing

Author
Olof Naessén
Per Larsson.

Definition at line 97 of file widget.h.

Member Typedef Documentation

◆ ActionListenerIterator

typedef ActionListenerList::iterator Widget::ActionListenerIterator
protected

Typdef.

Definition at line 1038 of file widget.h.

◆ ActionListenerList

typedef std::list<ActionListener*> Widget::ActionListenerList
protected

Typdef.

Definition at line 1028 of file widget.h.

◆ FocusListenerIterator

typedef FocusListenerList::iterator Widget::FocusListenerIterator
protected

Typdef.

Definition at line 1068 of file widget.h.

◆ FocusListenerList

typedef std::list<FocusListener*> Widget::FocusListenerList
protected

Typdef.

Definition at line 1058 of file widget.h.

◆ KeyListenerIterator

typedef KeyListenerList::iterator Widget::KeyListenerIterator
protected

Typdef.

Definition at line 1023 of file widget.h.

◆ KeyListenerList

typedef std::list<KeyListener*> Widget::KeyListenerList
protected

Typdef.

Definition at line 1013 of file widget.h.

◆ MouseListenerIterator

typedef MouseListenerList::iterator Widget::MouseListenerIterator
protected

Typdef.

Definition at line 1003 of file widget.h.

◆ MouseListenerList

typedef std::list<MouseListener*> Widget::MouseListenerList
protected

Typdef.

Definition at line 998 of file widget.h.

◆ WidgetDeathListenerIterator

typedef WidgetDeathListenerList::iterator Widget::WidgetDeathListenerIterator
protected

Typdef.

Definition at line 1053 of file widget.h.

◆ WidgetDeathListenerList

Typdef.

Definition at line 1043 of file widget.h.

◆ WidgetListenerIterator

typedef WidgetListenerList::iterator Widget::WidgetListenerIterator
protected

Typdef.

Definition at line 1080 of file widget.h.

◆ WidgetListenerList

typedef std::list<WidgetListener*> Widget::WidgetListenerList
protected

Definition at line 1070 of file widget.h.

Constructor & Destructor Documentation

◆ Widget()

Widget::Widget ( const Widget2 *const  widget)
explicit

Constructor. Resets member variables. Noteable, a widget is not focusable as default, therefore, widgets that are supposed to be focusable should overide this default in their own constructor.

Definition at line 84 of file widget.cpp.

References mAllWidgets, and mAllWidgetsSet.

84  :
85  Widget2(widget),
88  mKeyListeners(),
93  mForegroundColor(0x000000),
94  mBackgroundColor(0xffffff),
95  mBaseColor(0x808090),
96  mDimension(),
98  mId(),
99  mFocusHandler(nullptr),
100  mInternalFocusHandler(nullptr),
101  mParent(nullptr),
102  mCurrentFont(nullptr),
103  mFrameSize(0),
104  mFocusable(false),
105  mTabIn(true),
106  mTabOut(true),
107  mEnabled(true),
108  mAllowLogic(true),
109  mMouseConsume(true),
110  mRedraw(true),
111  mSelectable(true)
112 {
113  mAllWidgets.push_back(this);
114  mAllWidgetsSet.insert(this);
115 }
FocusListenerList mFocusListeners
Definition: widget.h:1063
std::string mId
Definition: widget.h:1110
static std::list< Widget * > mAllWidgets
Definition: widget.h:1176
static std::set< Widget * > mAllWidgetsSet
Definition: widget.h:1178
bool mTabIn
Definition: widget.h:1147
const bool Visible_true
Definition: visible.h:29
KeyListenerList mKeyListeners
Definition: widget.h:1018
FocusHandler * mFocusHandler
Definition: widget.h:1115
bool mTabOut
Definition: widget.h:1152
Color mForegroundColor
Definition: widget.h:1085
Color mBaseColor
Definition: widget.h:1095
MouseListenerList mMouseListeners
Definition: widget.h:1008
Visible mVisible
Definition: widget.h:962
Color mBackgroundColor
Definition: widget.h:1090
ActionListenerList mActionListeners
Definition: widget.h:1033
Font * mCurrentFont
Definition: widget.h:1132
Widget * mParent
Definition: widget.h:1127
bool mFocusable
Definition: widget.h:1142
unsigned int mFrameSize
Definition: widget.h:1137
bool mMouseConsume
Definition: widget.h:1161
bool mAllowLogic
Definition: widget.h:1159
FocusHandler * mInternalFocusHandler
Definition: widget.h:1121
WidgetListenerList mWidgetListeners
Definition: widget.h:1075
bool mRedraw
Definition: widget.h:1163
bool mEnabled
Definition: widget.h:1157
std::string mActionEventId
Definition: widget.h:1105
Widget2(const Widget2 *const widget)
Definition: widget2.h:102
WidgetDeathListenerList mDeathListeners
Definition: widget.h:1048
Rect mDimension
Definition: widget.h:1100
bool mSelectable
Definition: widget.h:1165

◆ ~Widget()

Widget::~Widget ( )
virtual

Default destructor.

Definition at line 117 of file widget.cpp.

References FOR_EACH, mAllWidgets, mAllWidgetsSet, mDeathListeners, and setFocusHandler().

118 {
120  {
121  Event event(this);
122  (*iter)->death(event);
123  }
124 
125  // +++ call to virtual member
126  setFocusHandler(nullptr);
127 
128  mAllWidgets.remove(this);
129  mAllWidgetsSet.erase(this);
130 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static std::list< Widget * > mAllWidgets
Definition: widget.h:1176
static std::set< Widget * > mAllWidgetsSet
Definition: widget.h:1178
Definition: event.h:77
virtual void setFocusHandler(FocusHandler *const focusHandler)
Definition: widget.cpp:237
WidgetDeathListenerList mDeathListeners
Definition: widget.h:1048
WidgetDeathListenerList::iterator WidgetDeathListenerIterator
Definition: widget.h:1053

Member Function Documentation

◆ addActionListener()

void Widget::addActionListener ( ActionListener *const  actionListener)

Adds an action listener to the widget. When an action event is fired by the widget the action listeners of the widget will get notified.

Parameters
actionListenerThe action listener to add.
See also
removeActionListener

Definition at line 251 of file widget.cpp.

References mActionListeners.

Referenced by Setup_Video::action(), ChangeEmailDialog::action(), ChangePasswordDialog::action(), EditServerDialog::action(), RegisterDialog::action(), CharSelectDialog::action(), LoginDialog::action(), ShopWindow::action(), SetupItemTextField::action(), SetupItemIntTextField::action(), WidgetGroup::addButton(), SkillDialog::addDefaultTab(), EmoteWindow::addListeners(), TabbedArea::addTab(), CharSelectDialog::askPasswordForDeletion(), DialogsManager::attributeChanged(), Button::Button(), GameModifiers::changeAwayMode(), CharacterDisplay::CharacterDisplay(), CharCreateDialog::CharCreateDialog(), ChatWindow::ChatWindow(), CheckBox::CheckBox(), InventoryWindow::combineItems(), SetupQuickItem::createControls(), SetupActionDropDown::createControls(), SetupItemCheckBox::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemLabel::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), SetupItemSliderList::createControls(), NpcDialog::createSkinControls(), DropDown::DropDown(), EditServerDialog::EditServerDialog(), EquipmentWindow::EquipmentWindow(), getFocusHandler(), ItemLinkHandler::handleCommandLink(), ItemLinkHandler::handleHttpLink(), PopupMenu::handleLink(), BuyDialog::init(), InventoryWindow::InventoryWindow(), SocialGuildTab::invite(), SocialPartyTab::invite(), ItemAmountWindow::ItemAmountWindow(), SocialGuildTab::leave(), SocialPartyTab::leave(), SkillDialog::loadXmlFile(), LoginDialog::LoginDialog(), NpcDialog::NpcDialog(), InputActionReplayListener::openDialog(), OutfitWindow::OutfitWindow(), DialogsManager::playerDeath(), EquipmentWindow::postInit(), TextSelectDialog::postInit(), CharSelectDialog::postInit(), SellDialog::postInit(), SliderList::postInit2(), EAthena::FamilyRecv::processAskForChild(), EAthena::SkillRecv::processSkillWarpPoint(), Ea::TradeRecv::processTradeRequestContinue(), QuestsWindow::QuestsWindow(), RegisterDialog::RegisterDialog(), NpcSellDialog::sellAction(), Setup_Colors::Setup_Colors(), Setup_Input::Setup_Input(), Setup_Joystick::Setup_Joystick(), Setup_Relations::Setup_Relations(), Setup_Theme::Setup_Theme(), Setup_Video::Setup_Video(), ShopWindow::ShopWindow(), SocialWindow::showGuildInvite(), SocialWindow::showPartyInvite(), Game::slowLogic(), TextCommandEditor::TextCommandEditor(), TextField::TextField(), SkillDialog::useSkillDefault(), SkillDialog::useSkillPosition(), and SkillDialog::useSkillTarget().

252 {
253  mActionListeners.push_back(actionListener);
254 }
ActionListenerList mActionListeners
Definition: widget.h:1033

◆ addDeathListener()

void Widget::addDeathListener ( WidgetDeathListener *const  deathListener)

Adds a death listener to the widget. When a death event is fired by the widget the death listeners of the widget will get notified.

Parameters
deathListenerThe death listener to add.
See also
removeDeathListener

Definition at line 261 of file widget.cpp.

References mDeathListeners.

Referenced by getFocusHandler().

262 {
263  mDeathListeners.push_back(deathListener);
264 }
WidgetDeathListenerList mDeathListeners
Definition: widget.h:1048

◆ addFocusListener()

void Widget::addFocusListener ( FocusListener *const  focusListener)

Adds a focus listener to the widget. When a focus event is fired by the widget the key listeners of the widget will get notified.

Parameters
focusListenerThe focus listener to add.
See also
removeFocusListener

Definition at line 281 of file widget.cpp.

References mFocusListeners.

Referenced by ChatInput::ChatInput(), DropDown::DropDown(), getFocusHandler(), Button::init(), MailEditWindow::MailEditWindow(), and TextField::TextField().

282 {
283  mFocusListeners.push_back(focusListener);
284 }
FocusListenerList mFocusListeners
Definition: widget.h:1063

◆ addKeyListener()

void Widget::addKeyListener ( KeyListener *const  keyListener)

◆ addMouseListener()

void Widget::addMouseListener ( MouseListener *const  mouseListener)

◆ addWidgetListener()

void Widget::addWidgetListener ( WidgetListener *const  widgetListener)

◆ callPostInit()

Widget * Widget::callPostInit ( Widget *const  widget)
static

Definition at line 521 of file widget.cpp.

References postInit().

Referenced by setSelectable().

522 {
523  if (widget != nullptr)
524  widget->postInit();
525  return widget;
526 }
virtual void postInit()
Definition: widget.h:956

◆ cleanGlobalFont()

static void Widget::cleanGlobalFont ( )
inlinestatic

Definition at line 649 of file widget.h.

References mGlobalFont, and setFont().

Referenced by Gui::~Gui().

650  { mGlobalFont = nullptr; }
static Font * mGlobalFont
Definition: widget.h:1170

◆ distributeActionEvent()

void Widget::distributeActionEvent ( )
protected

Distributes an action event to all action listeners of the widget.

Definition at line 492 of file widget.cpp.

References FOR_EACH, mActionEventId, and mActionListeners.

Referenced by GuiTableActionListener::action(), TextSelectDialog::action(), TextDialog::action(), SliderList::action(), ConfirmDialog::action(), OkDialog::action(), DropDown::action(), TextField::handleNormalKeys(), DropDown::hideDrop(), IntTextField::keyPressed(), ListBox::keyPressed(), GuiTable::keyPressed(), RadioButton::keyPressed(), Slider::keyPressed(), TextField::keyPressed(), Button::keyReleased(), RadioButton::mouseClicked(), Slider::mouseDragged(), EmotePage::mousePressed(), AvatarListBox::mousePressed(), CharacterDisplay::mousePressed(), Slider::mousePressed(), GuiTable::mousePressed(), PlayerBox::mouseReleased(), Button::mouseReleased(), SkillRectangleListBox::mouseReleased(), ListBox::mouseReleased1(), Slider::mouseWheelMovedDown(), Slider::mouseWheelMovedUp(), CheckBox::toggleSelected(), and DropDown::updateSelection().

493 {
495  {
496  ActionEvent actionEvent(this, mActionEventId);
497  (*iter)->action(actionEvent);
498  }
499 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
ActionListenerList mActionListeners
Definition: widget.h:1033
ActionListenerList::iterator ActionListenerIterator
Definition: widget.h:1038
std::string mActionEventId
Definition: widget.h:1105

◆ distributeHiddenEvent()

void Widget::distributeHiddenEvent ( )
protected

Distributes hidden events to all of the widget's listeners.

Author
Olof Naessén

Definition at line 483 of file widget.cpp.

References FOR_EACH, and mWidgetListeners.

Referenced by setVisible().

484 {
486  {
487  Event event(this);
488  (*iter)->widgetHidden(event);
489  }
490 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
WidgetListenerList mWidgetListeners
Definition: widget.h:1075
Definition: event.h:77
WidgetListenerList::iterator WidgetListenerIterator
Definition: widget.h:1080

◆ distributeMovedEvent()

void Widget::distributeMovedEvent ( )
protected

Distributes moved events to all of the widget's listeners.

Definition at line 474 of file widget.cpp.

References FOR_EACH, and mWidgetListeners.

Referenced by setDimension().

475 {
477  {
478  Event event(this);
479  (*iter)->widgetMoved(event);
480  }
481 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
WidgetListenerList mWidgetListeners
Definition: widget.h:1075
Definition: event.h:77
WidgetListenerList::iterator WidgetListenerIterator
Definition: widget.h:1080

◆ distributeResizedEvent()

void Widget::distributeResizedEvent ( )
protected

Distributes resized events to all of the widget's listeners.

Definition at line 465 of file widget.cpp.

References FOR_EACH, and mWidgetListeners.

Referenced by setDimension(), and CharacterDisplay::update().

466 {
468  {
469  Event event(this);
470  (*iter)->widgetResized(event);
471  }
472 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
WidgetListenerList mWidgetListeners
Definition: widget.h:1075
Definition: event.h:77
WidgetListenerList::iterator WidgetListenerIterator
Definition: widget.h:1080

◆ distributeShownEvent()

void Widget::distributeShownEvent ( )
protected

Distributes shown events to all of the widget's listeners.

Author
Olof Naessén

Definition at line 501 of file widget.cpp.

References FOR_EACH, and mWidgetListeners.

Referenced by setVisible().

502 {
504  {
505  Event event(this);
506  (*iter)->widgetShown(event);
507  }
508 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
WidgetListenerList mWidgetListeners
Definition: widget.h:1075
Definition: event.h:77
WidgetListenerList::iterator WidgetListenerIterator
Definition: widget.h:1080

◆ distributeWindowResizeEvent()

void Widget::distributeWindowResizeEvent ( )
static

Definition at line 354 of file widget.cpp.

References FOR_EACH, and mAllWidgets.

Referenced by setSelectable(), and Gui::videoResized().

355 {
356  FOR_EACH (std::list<Widget*>::const_iterator, iter, mAllWidgets)
357  (*iter)->windowResized();
358 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static std::list< Widget * > mAllWidgets
Definition: widget.h:1176

◆ draw()

virtual void Widget::draw ( Graphics *const  graphics)
pure virtual

Draws the widget. It is called by the parent widget when it is time for the widget to draw itself. The graphics object is set up so that all drawing is relative to the widget, i.e coordinate (0,0) is the top left corner of the widget. It is not possible to draw outside of a widget's dimension.

Parameters
graphicsaA graphics object to draw with.

Implemented in ChatWindow, Button, BasicContainer2, SkillRectangleListBox, ScrollArea, Window, Slider, GuiTable, RadioButton, Label, TextField, BrowserBox, CheckBox, Tab, TextBox, ListBox, StaticBrowserBox, TabbedArea, TextPreview, SkillListBox, PlayerBox, Popup, ProgressBar, ItemContainer, DropDown, Icon, EquipmentWindow, MiniStatusWindow, Viewport, Desktop, Viewport, ShopListBox, Minimap, ConnectionDialog, SliderList, DebugWindow, OutfitWindow, VirtShortcutContainer, EmoteShortcutContainer, ItemShortcutContainer, SpellShortcutContainer, ServersListBox, PasswordField, ProgressIndicator, ExtendedListBox, AvatarListBox, EmotePage, CutInWindow, and ColorPage.

Referenced by GuiTable::draw(), and Gui::draw().

◆ drawFrame()

virtual void Widget::drawFrame ( Graphics graphics)
inlinevirtual

Called when a widget is given a chance to draw a frame around itself. The frame is not considered a part of the widget, it only allows a frame to be drawn around the widget, thus a frame will never be included when calculating if a widget should receive events from user input. Also a widget's frame will never be included when calculating a widget's position.

The size of the frame is calculated using the widget's frame size. If a widget has a frame size of 10 pixels than the area the drawFrame function can draw to will be the size of the widget with an additional extension of 10 pixels in each direction.

An example when drawFrame is a useful function is if a widget needs a glow around itself.

Parameters
graphicsA graphics object to draw with.
See also
setFrameSize, getFrameSize

Reimplemented in ScrollArea, TextField, PlayerBox, and DropDown.

Definition at line 148 of file widget.h.

149  { }

◆ focusNext()

virtual void Widget::focusNext ( )
inlinevirtual

Focuses the next widget in the widget.

See also
moveToBottom

Reimplemented in BasicContainer.

Definition at line 884 of file widget.h.

885  { }

◆ focusPrevious()

virtual void Widget::focusPrevious ( )
inlinevirtual

Focuses the previous widget in the widget.

See also
moveToBottom

Reimplemented in BasicContainer.

Definition at line 892 of file widget.h.

893  { }

◆ fontChanged()

virtual void Widget::fontChanged ( )
inlinevirtual

Called when the font has changed. If the change is global, this function will only be called if the widget doesn't have a font already set.

Reimplemented in TextBox, and TextField.

Definition at line 666 of file widget.h.

References A_WARN_UNUSED, and widgetExists().

Referenced by setFont().

667  { }

◆ getAbsolutePosition()

void Widget::getAbsolutePosition ( int &  x,
int &  y 
) const
virtual

Gets the absolute position on the screen for the widget.

Parameters
xThe absolute x coordinate will be stored in this parameter.
yThe absolute y coordinate will be stored in this parameter.

Definition at line 311 of file widget.cpp.

References getAbsolutePosition(), getChildrenArea(), mDimension, mParent, Rect::x, and Rect::y.

Referenced by Gui::distributeMouseEvent(), DropDown::dropDown(), getAbsolutePosition(), getActionEventId(), StaticBrowserBox::getTextAtPos(), BrowserBox::getTextAtPos(), Gui::getWidgetAt(), Gui::handleMouseMoved(), Gui::handleMousePressed(), Gui::handleMouseReleased(), Gui::handleMouseWheelMovedDown(), Gui::handleMouseWheelMovedUp(), Window::setLocationHorisontallyRelativeTo(), Popup::setLocationRelativeTo(), Window::setLocationRelativeTo(), and ChatWindow::updateVisibility().

312 {
313  if (mParent == nullptr)
314  {
315  x = mDimension.x;
316  y = mDimension.y;
317  return;
318  }
319 
320  int parentX;
321  int parentY;
322 
323  mParent->getAbsolutePosition(parentX, parentY);
324 
325  const Rect &rect = mParent->getChildrenArea();
326  x = parentX + mDimension.x + rect.x;
327  y = parentY + mDimension.y + rect.y;
328 }
Definition: rect.h:72
int x
Definition: rect.h:208
Widget * mParent
Definition: widget.h:1127
int y
Definition: rect.h:213
virtual void getAbsolutePosition(int &x, int &y) const
Definition: widget.cpp:311
virtual Rect getChildrenArea()
Definition: widget.cpp:450
Rect mDimension
Definition: widget.h:1100

◆ getActionEventId()

const std::string& Widget::getActionEventId ( ) const
inline

◆ getBackgroundColor()

const Color& Widget::getBackgroundColor ( ) const
inline

Gets the background color.

See also
setBackgroundColor

Definition at line 432 of file widget.h.

References mBackgroundColor, requestFocus(), requestMoveToBottom(), requestMoveToTop(), and setFocusHandler().

433  { return mBackgroundColor; }
Color mBackgroundColor
Definition: widget.h:1090

◆ getBaseColor()

const Color& Widget::getBaseColor ( ) const
inline

Gets the base color.

Returns
The base color.
See also
setBaseColor

Definition at line 398 of file widget.h.

References mBaseColor.

399  { return mBaseColor; }
Color mBaseColor
Definition: widget.h:1095

◆ getChildrenArea()

Rect Widget::getChildrenArea ( )
virtual

Gets the area of the widget occupied by the widget's children. By default this method returns an empty rectangle as not all widgets are containers. If you want to make a container this method should return the area where the children resides. This method is used when drawing children of a widget when computing clip rectangles for the children.

An example of a widget that overloads this method is ScrollArea. A ScrollArea has a view of its contant and that view is the children area. The size of a ScrollArea's children area might vary depending on if the scroll bars of the ScrollArea is shown or not.

Returns
The area of the widget occupied by the widget's children.
See also
BasicContainer
BasicContainer::getChildrenArea
BasicContainer::drawChildren

Reimplemented in Window, ScrollArea, Popup, DropDown, BasicContainer, GuiTable, and MiniStatusWindow.

Definition at line 450 of file widget.cpp.

Referenced by getAbsolutePosition(), getWidgetAt(), and TextBox::keyPressed().

451 {
452  return Rect(0, 0, 0, 0);
453 }
Definition: rect.h:72

◆ getDimension()

const Rect& Widget::getDimension ( ) const
inline

Gets the dimension of the widget. The dimension is relative to the widget's parent.

Returns
The dimension of the widget.
See also
getDimension, setX, getX, setY, getY, setPosition

Definition at line 316 of file widget.h.

References A_WARN_UNUSED, isFocusable(), isFocused(), mDimension, and setFocusable().

Referenced by GuiTable::draw(), Gui::draw(), GuiTable::getWidgetAt(), Gui::handleMouseMoved(), Window::mouseDragged(), GuiTable::safeDraw(), and TabbedArea::widgetResized().

317  { return mDimension; }
Rect mDimension
Definition: widget.h:1100

◆ getFocusHandler()

FocusHandler* Widget::getFocusHandler ( )
inline

Gets the focus handler used.

WARNING: This function is used internally and should not be called or overloaded unless you know what you are doing.

Returns
The focus handler used.
See also
setFocusHandler

Definition at line 473 of file widget.h.

References addActionListener(), addDeathListener(), addFocusListener(), addKeyListener(), addMouseListener(), addWidgetListener(), mFocusHandler, removeActionListener(), removeDeathListener(), removeFocusListener(), removeKeyListener(), removeMouseListener(), and removeWidgetListener().

Referenced by BasicContainer::add(), GuiTable::installActionListeners(), and BasicContainer::setInternalFocusHandler().

474  { return mFocusHandler; }
FocusHandler * mFocusHandler
Definition: widget.h:1115

◆ getFocusListeners()

const std::list< FocusListener * > & Widget::getFocusListeners ( ) const

Gets the focus listeners of the widget.

Returns
The focus listeners of the widget.

Definition at line 445 of file widget.cpp.

References mFocusListeners.

Referenced by FocusHandler::distributeFocusGainedEvent(), FocusHandler::distributeFocusLostEvent(), and getWidgetAt().

446 {
447  return mFocusListeners;
448 }
FocusListenerList mFocusListeners
Definition: widget.h:1063

◆ getFont()

Font * Widget::getFont ( ) const

Gets the font set for the widget. If no font has been set, the global font will be returned. If no global font has been set, the default font will be returend.

Returns
The font set for the widget.
See also
setFont, setGlobalFont

Definition at line 330 of file widget.cpp.

References mCurrentFont, and mGlobalFont.

Referenced by StaticBrowserBox::addRow(), BrowserBox::addRow(), DropDown::adjustHeight(), TextField::adjustHeight(), Label::adjustSize(), TextPreview::adjustSize(), RadioButton::adjustSize(), CheckBox::adjustSize(), TextField::adjustSize(), Button::adjustSize(), TextBox::adjustSize(), BrowserBox::calcHeight(), ColorPage::ColorPage(), ColorPage::draw(), AvatarListBox::draw(), ExtendedListBox::draw(), ServersListBox::draw(), SpellShortcutContainer::draw(), EmoteShortcutContainer::draw(), ItemShortcutContainer::draw(), VirtShortcutContainer::draw(), ShopListBox::draw(), EquipmentWindow::draw(), DropDown::draw(), ItemContainer::draw(), SkillListBox::draw(), StaticBrowserBox::draw(), ListBox::draw(), CheckBox::draw(), BrowserBox::draw(), TextBox::draw(), TextField::draw(), Label::draw(), RadioButton::draw(), SkillRectangleListBox::draw(), Button::draw(), TextBox::drawCaret(), Viewport::drawPath(), TextField::fixScroll(), SliderList::getMaxLabelWidth(), ServersListBox::getRowHeight(), InventoryWindow::InventoryWindow(), ItemPopup::ItemPopup(), TextBox::keyPressed(), Label::Label(), ListBox::ListBox(), AvatarListBox::mousePressed(), TextField::mousePressed(), TextBox::mousePressed(), SkillRectangleListBox::mousePressed(), NpcDialog::NpcDialog(), OkDialog::OkDialog(), StatusPopup::postInit(), TextBoxPopup::postInit(), TextPopup::postInit(), ConfirmDialog::postInit(), ProgressBar::ProgressBar(), Label::resizeTo(), AvatarListBox::safeDraw(), ItemShortcutContainer::safeDraw(), SpellShortcutContainer::safeDraw(), EmoteShortcutContainer::safeDraw(), VirtShortcutContainer::safeDraw(), EquipmentWindow::safeDraw(), ItemContainer::safeDraw(), Button::safeDraw(), TextBox::scrollToCaret(), ItemPopup::setItem(), setParent(), SpeechBubble::setText(), TextBox::setTextWrapped(), Setup_Colors::Setup_Colors(), ShopListBox::ShopListBox(), BeingPopup::show(), SkillPopup::show(), TextPopup::show(), SkillListBox::SkillListBox(), SkillPopup::SkillPopup(), SkillRectangleListBox::SkillRectangleListBox(), TextDialog::TextDialog(), TradeWindow::TradeWindow(), and StaticBrowserBox::updateHeight().

331 {
332  if (mCurrentFont == nullptr)
333  return mGlobalFont;
334  return mCurrentFont;
335 }
Font * mCurrentFont
Definition: widget.h:1132
static Font * mGlobalFont
Definition: widget.h:1170

◆ getForegroundColor()

const Color& Widget::getForegroundColor ( ) const
inline

Gets the foreground color.

See also
setForegroundColor

Definition at line 415 of file widget.h.

References mForegroundColor.

416  { return mForegroundColor; }
Color mForegroundColor
Definition: widget.h:1085

◆ getFrameSize()

unsigned int Widget::getFrameSize ( ) const
inline

Gets the size of the widget's frame. The frame is not considered a part of the widget, it only allows a frame to be drawn around the widget, thus a frame will never be included when calculating if a widget should receive events from user input. Also a widget's frame will never be included when calculating a widget's position.

A frame size of 0 means that the widget has no frame. The default frame size is 0.

Returns
The size of the widget's frame.
See also
setFrameSize, drawFrame

Definition at line 183 of file widget.h.

References mFrameSize.

Referenced by TabbedArea::adjustSize(), ChatWindow::adjustTabSize(), DropDown::drawFrame(), DropDown::dropDown(), ScrollArea::getHorizontalMaxScroll(), ScrollArea::getVerticalMaxScroll(), ScrollArea::logic(), DropDown::safeDrawFrame(), ScrollArea::showWidgetPart(), and TabbedArea::widgetResized().

184  { return mFrameSize; }
unsigned int mFrameSize
Definition: widget.h:1137

◆ getGloablFont()

static Font* Widget::getGloablFont ( )
inlinestatic

Definition at line 646 of file widget.h.

References mGlobalFont.

647  { return mGlobalFont; }
static Font * mGlobalFont
Definition: widget.h:1170

◆ getHeight()

int Widget::getHeight ( ) const
inline

Gets the height of the widget.

Returns
The height of the widget.
See also
setHeight, setWidth, getWidth, setSize, setDimension, getDimension

Definition at line 239 of file widget.h.

References Rect::height, mDimension, setSize(), setX(), and x.

Referenced by VertContainer::add2(), WindowMenu::addButton(), TabbedArea::addTab(), DropDown::adjustHeight(), TextField::adjustHeight(), TextPreview::adjustSize(), CheckBox::adjustSize(), TabbedArea::adjustSize(), Tab::adjustSize(), TabbedArea::adjustTabPositions(), ChatWindow::adjustTabSize(), TabbedArea::adjustWidget(), BeingPopup::BeingPopup(), ChangeEmailDialog::ChangeEmailDialog(), CharCreateDialog::CharCreateDialog(), ScrollArea::checkPolicies(), Viewport::draw(), TextBox::draw(), GuiTable::draw(), Slider::draw(), RadioButton::drawBox(), CheckBox::drawBox(), TextBox::drawCaret(), Being::drawSpeech(), DropDown::dropDown(), EditServerDialog::EditServerDialog(), EquipmentWindow::EquipmentWindow(), ScrollArea::getChildrenArea(), TabbedArea::getContainerHeight(), ScrollArea::getVerticalMarkerDimension(), ScrollArea::getVerticalMaxScroll(), Gui::handleMouseMoved(), BuySellDialog::init(), Window::loadWindowState(), ShortcutWindow::mouseDragged(), ChatWindow::mouseDragged(), Window::mouseDragged(), OkDialog::OkDialog(), LayoutArray::place(), SetupWindow::postInit(), EditDialog::postInit(), ConfirmDialog::postInit(), EquipmentWindow::postInit(), ProgressBar::ProgressBar(), EquipmentWindow::recalcSize(), CharacterViewNormal::resize(), CharacterViewSmall::resize(), Window::resizeToContent(), GuiTable::safeDraw(), Slider::safeDraw(), ChatTab::scroll(), ServerDialog::ServerDialog(), StaticTableModel::set(), CharCreateDialog::setAttributes(), Desktop::setBestFittingWallpaper(), CharCreateDialog::setButtonsPosition(), SpellPopup::setItem(), Popup::setLocationRelativeTo(), Window::setLocationRelativeTo(), SpeechBubble::setText(), ShopListBox::ShopListBox(), PopupList::show(), TextBoxPopup::show(), TextPopup::show(), PopupMenu::showPopup(), StatusWindow::StatusWindow(), StatusPopup::update(), MiniStatusWindow::updateBars(), WindowMenu::updateButtons(), SliderList::updateLabel(), ChatWindow::updateVisibility(), Gui::videoResized(), StatusPopup::view(), StatsPageBasic::widgetResized(), StatsPage::widgetResized(), FlowContainer::widgetResized(), SetupTabScroll::widgetResized(), Desktop::widgetResized(), EmoteWindow::widgetResized(), SetupWindow::widgetResized(), and TabbedArea::widgetResized().

240  { return mDimension.height; }
int height
Definition: rect.h:223
Rect mDimension
Definition: widget.h:1100

◆ getId()

const std::string& Widget::getId ( ) const
inline

Definition at line 918 of file widget.h.

References mId, and showPart().

Referenced by RequestTradeListener::action(), MiniStatusWindow::mouseMoved(), and PopupMenu::showPopup().

919  { return mId; }
std::string mId
Definition: widget.h:1110

◆ getInternalFocusHandler()

FocusHandler * Widget::getInternalFocusHandler ( )
virtual

Gets the internal focus handler used.

Returns
the internalFocusHandler used. If no internal focus handler is used, NULL will be returned.
See also
setInternalFocusHandler

Definition at line 455 of file widget.cpp.

References mInternalFocusHandler.

Referenced by Gui::getKeyEventSource(), and getWidgetAt().

456 {
457  return mInternalFocusHandler;
458 }
FocusHandler * mInternalFocusHandler
Definition: widget.h:1121

◆ getKeyListeners()

const std::list< KeyListener * > & Widget::getKeyListeners ( ) const

Gets the key listeners of the widget.

Returns
The key listeners of the widget.

Definition at line 440 of file widget.cpp.

References mKeyListeners.

Referenced by Gui::distributeKeyEvent(), and getWidgetAt().

441 {
442  return mKeyListeners;
443 }
KeyListenerList mKeyListeners
Definition: widget.h:1018

◆ getMouseListeners()

const std::list< MouseListener * > & Widget::getMouseListeners ( ) const

Gets the mouse listeners of the widget.

Returns
The mouse listeners of the widget.

Definition at line 435 of file widget.cpp.

References mMouseListeners.

Referenced by Gui::distributeMouseEvent(), and getWidgetAt().

436 {
437  return mMouseListeners;
438 }
MouseListenerList mMouseListeners
Definition: widget.h:1008

◆ getParent()

Widget* Widget::getParent ( ) const
inline

◆ getWidgetAt()

virtual Widget* Widget::getWidgetAt ( int  x,
int  y 
)
inlinevirtual

Gets a widget from a certain position in the widget. This function is used to decide which gets mouse input, thus it can be overloaded to change that behaviour.

NOTE: This always returns NULL if the widget is not a container.

Parameters
xThe x coordinate of the widget to get.
yThe y coordinate of the widget to get.
Returns
The widget at the specified coodinate, NULL if no widget is found.

Reimplemented in ScrollArea, BasicContainer, and GuiTable.

Definition at line 791 of file widget.h.

References A_WARN_UNUSED, getChildrenArea(), getFocusListeners(), getInternalFocusHandler(), getKeyListeners(), getMouseListeners(), and setInternalFocusHandler().

Referenced by Gui::getWidgetAt().

793  { return nullptr; }

◆ getWidth()

int Widget::getWidth ( ) const
inline

Gets the width of the widget.

Returns
The width of the widget.
See also
setWidth, setHeight, getHeight, setSize, setDimension, getDimension

Definition at line 220 of file widget.h.

References mDimension, setHeight(), and Rect::width.

Referenced by HorizontContainer::add(), VertContainer::add2(), WindowMenu::addButton(), StaticBrowserBox::addRow(), BrowserBox::addRow(), TabbedArea::addTab(), WidgetGroup::addWidget(), CheckBox::adjustSize(), TextField::adjustSize(), TabbedArea::adjustSize(), Tab::adjustSize(), TabbedArea::adjustTabPositions(), ChatWindow::adjustTabSize(), TabbedArea::adjustWidget(), ChangeEmailDialog::ChangeEmailDialog(), CharacterViewNormal::CharacterViewNormal(), CharCreateDialog::CharCreateDialog(), CharSelectDialog::CharSelectDialog(), ChatWindow::ChatWindow(), ScrollArea::checkPolicies(), AvatarListBox::draw(), ServersListBox::draw(), Viewport::draw(), SkillListBox::draw(), TextBox::draw(), GuiTable::draw(), Slider::draw(), Being::drawSpeech(), EditServerDialog::EditServerDialog(), SetupItem::fixFirstItemSize(), ScrollArea::getChildrenArea(), ScrollArea::getHorizontalMarkerDimension(), ScrollArea::getHorizontalMaxScroll(), Gui::handleMouseMoved(), BuySellDialog::init(), BuyDialog::init(), Slider::init(), InventoryWindow::InventoryWindow(), ItemAmountWindow::ItemAmountWindow(), Window::loadWindowState(), NpcDialog::logic(), ShortcutWindow::mouseDragged(), ChatWindow::mouseDragged(), SkillListBox::mousePressed(), Client::moveButtons(), OkDialog::OkDialog(), LayoutArray::place(), SetupWindow::postInit(), EditDialog::postInit(), ConfirmDialog::postInit(), EquipmentWindow::postInit(), SellDialog::postInit(), CharacterViewNormal::resize(), CharacterViewSmall::resize(), SliderList::resize(), Window::resizeToContent(), AvatarListBox::safeDraw(), GuiTable::safeDraw(), Slider::safeDraw(), ServerDialog::ServerDialog(), StaticTableModel::set(), Desktop::setBestFittingWallpaper(), CharCreateDialog::setButtonsPosition(), SpellPopup::setItem(), ItemPopup::setItem(), Window::setLocationHorisontallyRelativeTo(), Popup::setLocationRelativeTo(), Window::setLocationRelativeTo(), SpeechBubble::setText(), Setup_Colors::Setup_Colors(), BeingPopup::show(), PopupList::show(), TextBoxPopup::show(), SkillPopup::show(), TextPopup::show(), PopupMenu::showPopup(), SkillDialog::SkillDialog(), Client::stateGame(), Client::stateGame1(), StatusWindow::StatusWindow(), TextDialog::TextDialog(), StatusPopup::update(), CharacterDisplay::update(), TabbedArea::updateArrowEnableState(), MiniStatusWindow::updateBars(), WindowMenu::updateButtons(), SliderList::updateLabel(), ChatWindow::updateTabsMargin(), TabbedArea::updateTabsWidth(), ChatWindow::updateVisibility(), TabbedArea::updateVisibleTabsWidth(), Game::videoResized(), Gui::videoResized(), StatusPopup::view(), SpellPopup::view(), StatsPage::widgetResized(), StatsPageBasic::widgetResized(), VertContainer::widgetResized(), FlowContainer::widgetResized(), SetupTabScroll::widgetResized(), Desktop::widgetResized(), EmoteWindow::widgetResized(), SetupWindow::widgetResized(), InventoryWindow::widgetResized(), and TabbedArea::widgetResized().

221  { return mDimension.width; }
int width
Definition: rect.h:218
Rect mDimension
Definition: widget.h:1100

◆ getX()

int Widget::getX ( ) const
inline

◆ getY()

int Widget::getY ( ) const
inline

◆ isAllowLogic()

bool Widget::isAllowLogic ( ) const
inline

Definition at line 932 of file widget.h.

References mAllowLogic.

933  { return mAllowLogic; }
bool mAllowLogic
Definition: widget.h:1159

◆ isEnabled()

bool Widget::isEnabled ( ) const

Checks if the widget is enabled. A disabled widget will never recieve mouse or key events.

Returns
True if widget is enabled, false otherwise.
See also
setEnabled

Definition at line 374 of file widget.cpp.

References isVisible(), and mEnabled.

Referenced by Setup_Video::action(), Gui::distributeKeyEvent(), Gui::distributeMouseEvent(), Button::draw(), isFocusable(), Button::safeDraw(), and setEnabled().

375 {
376  return mEnabled && isVisible();
377 }
bool isVisible() const
Definition: widget.h:377
bool mEnabled
Definition: widget.h:1157

◆ isFocusable()

bool Widget::isFocusable ( ) const

Checks if a widget is focsable.

Returns
True if the widget should be focusable, false otherwise.
See also
setFocusable

Definition at line 198 of file widget.cpp.

References isEnabled(), isVisible(), and mFocusable.

Referenced by getDimension(), GuiTable::getWidgetAt(), Gui::handleKeyInput(), ListBox::refocus(), requestFocus(), FocusHandler::tabNext(), and FocusHandler::tabPrevious().

199 {
200  return mFocusable && isVisible() && isEnabled();
201 }
bool mFocusable
Definition: widget.h:1142
bool isEnabled() const
Definition: widget.cpp:374
bool isVisible() const
Definition: widget.h:377

◆ isFocused()

bool Widget::isFocused ( ) const
virtual

◆ isModalFocused()

bool Widget::isModalFocused ( ) const
virtual

Checks if the widget or it's parent has modal focus.

Returns
True if the widget has modal focus, false otherwise.
See also
requestModalFocus, releaseModalFocus

Definition at line 407 of file widget.cpp.

References FocusHandler::getModalFocused(), isModalFocused(), mFocusHandler, and mParent.

Referenced by Gui::distributeKeyEvent(), Gui::distributeMouseEvent(), Gui::handleMousePressed(), isModalFocused(), FocusHandler::requestModalFocus(), setTabOutEnabled(), FocusHandler::tabNext(), and FocusHandler::tabPrevious().

408 {
409  if (mFocusHandler == nullptr)
410  return false;
411 
412  if (mParent != nullptr)
413  {
414  return (mFocusHandler->getModalFocused() == this)
415  || mParent->isModalFocused();
416  }
417 
418  return mFocusHandler->getModalFocused() == this;
419 }
FocusHandler * mFocusHandler
Definition: widget.h:1115
virtual bool isModalFocused() const
Definition: widget.cpp:407
Widget * mParent
Definition: widget.h:1127
Widget * getModalFocused() const

◆ isModalMouseInputFocused()

bool Widget::isModalMouseInputFocused ( ) const
virtual

Checks if the widget or it's parent has modal mouse input focus.

Returns
True if the widget has modal mouse input focus, false otherwise.
See also
requestModalMouseInputFocus, releaseModalMouseInputFocus

Definition at line 421 of file widget.cpp.

References FocusHandler::getModalMouseInputFocused(), isModalMouseInputFocused(), mFocusHandler, and mParent.

Referenced by Gui::distributeKeyEvent(), Gui::distributeMouseEvent(), Gui::getMouseEventSource(), isModalMouseInputFocused(), and setTabOutEnabled().

422 {
423  if (mFocusHandler == nullptr)
424  return false;
425 
426  if (mParent != nullptr)
427  {
428  return (mFocusHandler->getModalMouseInputFocused() == this)
430  }
431 
432  return mFocusHandler->getModalMouseInputFocused() == this;
433 }
Widget * getModalMouseInputFocused() const
FocusHandler * mFocusHandler
Definition: widget.h:1115
Widget * mParent
Definition: widget.h:1127
virtual bool isModalMouseInputFocused() const
Definition: widget.cpp:421

◆ isMouseConsume()

bool Widget::isMouseConsume ( ) const
inline

Definition at line 938 of file widget.h.

References mMouseConsume.

939  { return mMouseConsume; }
bool mMouseConsume
Definition: widget.h:1161

◆ isSelectable()

virtual bool Widget::isSelectable ( ) const
inlinevirtual

Reimplemented in ScrollArea.

Definition at line 944 of file widget.h.

References mSelectable.

Referenced by Gui::getWidgetAt(), and ScrollArea::isSelectable().

945  { return mSelectable; }
bool mSelectable
Definition: widget.h:1165

◆ isTabInEnabled()

bool Widget::isTabInEnabled ( ) const
inline

Checks if tab in is enabled. Tab in means that you can set focus to this widget by pressing the tab button. If tab in is disabled then the focus handler will skip this widget and focus the next in its focus order.

Returns
True if tab in is enabled, false otherwise.
See also
setTabInEnabled

Definition at line 687 of file widget.h.

References mTabIn.

Referenced by FocusHandler::tabNext(), and FocusHandler::tabPrevious().

688  { return mTabIn; }
bool mTabIn
Definition: widget.h:1147

◆ isTabOutEnabled()

bool Widget::isTabOutEnabled ( ) const
inline

Checks if tab out is enabled. Tab out means that you can lose focus to this widget by pressing the tab button. If tab out is disabled then the FocusHandler ignores tabbing and focus will stay with this widget.

Returns
True if tab out is enabled, false otherwise.
See also
setTabOutEnabled

Definition at line 711 of file widget.h.

References mTabOut.

Referenced by FocusHandler::tabNext(), and FocusHandler::tabPrevious().

712  { return mTabOut; }
bool mTabOut
Definition: widget.h:1152

◆ isVisible()

bool Widget::isVisible ( ) const
inline

Checks if the widget is visible.

Returns
True if widget is be visible, false otherwise.
See also
setVisible

Definition at line 377 of file widget.h.

References mParent, mVisible, and Visible_true.

Referenced by Gui::handleMouseMoved(), isEnabled(), isFocusable(), ScrollArea::logic(), ChatInput::processVisible(), ChatWindow::requestChatFocus(), ChatWindow::toggleChatFocus(), and ChatWindow::updateVisibility().

378  {
379  return mVisible == Visible_true &&
380  ((mParent == nullptr) || mParent->isVisible());
381  }
const bool Visible_true
Definition: visible.h:29
Visible mVisible
Definition: widget.h:962
Widget * mParent
Definition: widget.h:1127

◆ logic()

virtual void Widget::logic ( )
inlinevirtual

Called for all widgets in the gui each time Gui::logic is called. You can do logic stuff here like playing an animation.

See also
Gui::logic

Reimplemented in NpcDialog, TabbedArea, ListBox, ScrollArea, BasicContainer, NetDebugTab, UpdaterWindow, TargetDebugTab, ServerDialog, CharCreateDialog, Viewport, Viewport, WhoIsOnline, ItemContainer, MiniStatusWindow, ProgressBar, MapDebugTab, CutInWindow, ProgressIndicator, and DebugTab.

Definition at line 192 of file widget.h.

Referenced by ChatWindow::adjustTabSize(), ItemContainer::logic(), ScrollArea::logic(), Gui::logic(), and TextBox::setTextWrapped().

193  { }

◆ moveToBottom()

virtual void Widget::moveToBottom ( Widget widget)
inlinevirtual

Moves a widget in this widget to the bottom of this widget. The moved widget will be drawn below all other widgets in this widget.

Parameters
widgetThe widget to move to the bottom.
See also
moveToTop

Reimplemented in GuiTable, and BasicContainer.

Definition at line 876 of file widget.h.

Referenced by GuiTable::moveToBottom(), and requestMoveToBottom().

877  { }

◆ moveToTop()

virtual void Widget::moveToTop ( Widget widget)
inlinevirtual

Moves a widget to the top of this widget. The moved widget will be drawn above all other widgets in this widget.

Parameters
widgetThe widget to move to the top.
See also
moveToBottom

Reimplemented in GuiTable, and BasicContainer.

Definition at line 866 of file widget.h.

Referenced by Window::mousePressed(), GuiTable::moveToTop(), TextDialog::postInit(), ConfirmDialog::postInit(), and requestMoveToTop().

867  { }

◆ postInit()

virtual void Widget::postInit ( )
inlinevirtual

◆ releaseModalFocus()

void Widget::releaseModalFocus ( )
virtual

Releases modal focus. Modal focus will only be released if the widget has modal focus.

See also
requestModalFocus, isModalFocused

Definition at line 393 of file widget.cpp.

References mFocusHandler, and FocusHandler::releaseModalFocus().

Referenced by PopupList::focusGained(), PopupList::mouseReleased(), setFocusHandler(), Window::setModal(), and setTabOutEnabled().

394 {
395  if (mFocusHandler == nullptr)
396  return;
398 }
FocusHandler * mFocusHandler
Definition: widget.h:1115
void releaseModalFocus(Widget *const widget)

◆ releaseModalMouseInputFocus()

void Widget::releaseModalMouseInputFocus ( )
virtual

Releases modal mouse input focus. Modal mouse input focus will only be released if the widget has modal mouse input focus.

See also
requestModalMouseInputFocus, isModalMouseInputFocused

Definition at line 400 of file widget.cpp.

References mFocusHandler, and FocusHandler::releaseModalMouseInputFocus().

Referenced by setTabOutEnabled().

401 {
402  if (mFocusHandler == nullptr)
403  return;
405 }
FocusHandler * mFocusHandler
Definition: widget.h:1115
void releaseModalMouseInputFocus(const Widget *const widget)

◆ removeActionListener()

void Widget::removeActionListener ( ActionListener *const  actionListener)

Removes an added action listener from the widget.

Parameters
actionListenerThe action listener to remove.
See also
addActionListener

Definition at line 256 of file widget.cpp.

References mActionListeners.

Referenced by getFocusHandler(), and GuiTableActionListener::~GuiTableActionListener().

257 {
258  mActionListeners.remove(actionListener);
259 }
ActionListenerList mActionListeners
Definition: widget.h:1033

◆ removeDeathListener()

void Widget::removeDeathListener ( WidgetDeathListener *const  deathListener)

Removes an added death listener from the widget.

Parameters
deathListenerThe death listener to remove.
See also
addDeathListener

Definition at line 266 of file widget.cpp.

References mDeathListeners.

Referenced by getFocusHandler().

267 {
268  mDeathListeners.remove(deathListener);
269 }
WidgetDeathListenerList mDeathListeners
Definition: widget.h:1048

◆ removeFocusListener()

void Widget::removeFocusListener ( FocusListener *const  focusListener)

Removes an added focus listener from the widget.

Parameters
focusListenerThe focus listener to remove.
See also
addFocusListener

Definition at line 286 of file widget.cpp.

References mFocusListeners.

Referenced by getFocusHandler(), and PopupList::~PopupList().

287 {
288  mFocusListeners.remove(focusListener);
289 }
FocusListenerList mFocusListeners
Definition: widget.h:1063

◆ removeKeyListener()

void Widget::removeKeyListener ( KeyListener *const  keyListener)

Removes an added key listener from the widget.

Parameters
keyListenerThe key listener to remove.
See also
addKeyListener

Definition at line 276 of file widget.cpp.

References mKeyListeners.

Referenced by getFocusHandler(), CharacterViewNormal::~CharacterViewNormal(), CharacterViewSmall::~CharacterViewSmall(), and PopupList::~PopupList().

277 {
278  mKeyListeners.remove(keyListener);
279 }
KeyListenerList mKeyListeners
Definition: widget.h:1018

◆ removeMouseListener()

void Widget::removeMouseListener ( MouseListener *const  mouseListener)

Removes an added mouse listener from the widget.

Parameters
mouseListenerThe mouse listener to remove.
See also
addMouseListener

Definition at line 296 of file widget.cpp.

References mMouseListeners.

Referenced by getFocusHandler(), and Label::~Label().

297 {
298  mMouseListeners.remove(mouseListener);
299 }
MouseListenerList mMouseListeners
Definition: widget.h:1008

◆ removeWidgetListener()

void Widget::removeWidgetListener ( WidgetListener *const  widgetListener)

Removes an added widget listener from the widget.

Parameters
widgetListenerThe widget listener to remove.
See also
addWidgetListener

Definition at line 306 of file widget.cpp.

References mWidgetListeners.

Referenced by getFocusHandler(), Label::setWindow(), CheckBox::setWindow(), RadioButton::setWindow(), TextField::setWindow(), Button::setWindow(), Button::~Button(), CheckBox::~CheckBox(), Label::~Label(), LayoutHelper::~LayoutHelper(), RadioButton::~RadioButton(), TextField::~TextField(), and Window::~Window().

307 {
308  mWidgetListeners.remove(widgetListener);
309 }
WidgetListenerList mWidgetListeners
Definition: widget.h:1075

◆ requestFocus()

void Widget::requestFocus ( )
virtual

Requests focus for the widget. A widget will only recieve focus if it is focusable.

Reimplemented in GuiTable, and CharacterDisplay.

Definition at line 203 of file widget.cpp.

References isFocusable(), mFocusHandler, and FocusHandler::requestFocus().

Referenced by WrongDataNoticeListener::action(), EditServerDialog::action(), ChangeEmailDialog::ChangeEmailDialog(), ChangePasswordDialog::ChangePasswordDialog(), CharCreateDialog::CharCreateDialog(), DropDown::dropDown(), UpdaterWindow::enable(), ChatInput::focusLost(), getBackgroundColor(), Gui::handleMousePressed(), BuySellDialog::init(), TabbedArea::mousePressed(), OkDialog::OkDialog(), NpcDialog::parseListItems(), WorldSelectDialog::postInit(), EditDialog::postInit(), TextDialog::postInit(), EditServerDialog::postInit(), QuitDialog::postInit(), RegisterDialog::postInit(), ConfirmDialog::postInit(), LoginDialog::postInit(), ServerDialog::postInit(), NpcDialog::postInit(), UpdaterWindow::postInit(), CharSelectDialog::postInit(), ChatWindow::requestChatFocus(), GuiTable::requestFocus(), BuySellDialog::setVisible(), TextSelectDialog::setVisible(), SellDialog::setVisible(), and BuyDialog::setVisible().

204 {
205  if (mFocusHandler == nullptr)
206  return;
207 
208  if (isFocusable())
210 }
FocusHandler * mFocusHandler
Definition: widget.h:1115
void requestFocus(const Widget *const widget)
bool isFocusable() const
Definition: widget.cpp:198

◆ requestModalFocus()

void Widget::requestModalFocus ( )

Requests modal focus. When a widget has modal focus, only that widget and it's children may recieve input.

Exceptions
Exceptionif another widget already has modal focus.
See also
releaseModalFocus, isModalFocused

Definition at line 379 of file widget.cpp.

References mFocusHandler, and FocusHandler::requestModalFocus().

Referenced by TextDialog::postInit(), QuitDialog::postInit(), Window::setModal(), setTabOutEnabled(), PopupList::show(), and Window::Window().

380 {
381  if (mFocusHandler == nullptr)
382  return;
384 }
FocusHandler * mFocusHandler
Definition: widget.h:1115
void requestModalFocus(Widget *const widget)

◆ requestModalMouseInputFocus()

void Widget::requestModalMouseInputFocus ( )
virtual

Requests modal mouse input focus. When a widget has modal input focus that widget will be the only widget receiving input even if the input occurs outside of the widget and no matter what the input is.

Exceptions
Exceptionif another widget already has modal focus.
See also
releaseModalMouseInputFocus, isModalMouseInputFocused

Definition at line 386 of file widget.cpp.

References mFocusHandler, and FocusHandler::requestModalMouseInputFocus().

Referenced by setTabOutEnabled().

387 {
388  if (mFocusHandler == nullptr)
389  return;
391 }
FocusHandler * mFocusHandler
Definition: widget.h:1115
void requestModalMouseInputFocus(Widget *const widget)

◆ requestMoveToBottom()

void Widget::requestMoveToBottom ( )
virtual

Requests a move to the bottom in the parent widget.

Definition at line 218 of file widget.cpp.

References moveToBottom(), and mParent.

Referenced by Game::Game(), and getBackgroundColor().

219 {
220  if (mParent != nullptr)
221  mParent->moveToBottom(this);
222 }
Widget * mParent
Definition: widget.h:1127
virtual void moveToBottom(Widget *widget)
Definition: widget.h:876

◆ requestMoveToTop()

void Widget::requestMoveToTop ( )
virtual

◆ safeDraw()

virtual void Widget::safeDraw ( Graphics *const  graphics)
pure virtual

◆ safeDrawFrame()

virtual void Widget::safeDrawFrame ( Graphics graphics)
inlinevirtual

Reimplemented in ScrollArea, TextField, PlayerBox, and DropDown.

Definition at line 151 of file widget.h.

152  { }

◆ setActionEventId()

void Widget::setActionEventId ( const std::string &  actionEventId)
inline

Sets the action event identifier of the widget. The identifier is used to be able to identify which action has occured.

NOTE: An action event identifier should not be used to identify a certain widget but rather a certain event in your application. Several widgets can have the same action event identifer.

Parameters
actionEventIdThe action event identifier.
See also
getActionEventId

Definition at line 595 of file widget.h.

References mActionEventId.

Referenced by Setup_Video::action(), ConfirmDialog::action(), TextDialog::action(), OkDialog::action(), WidgetGroup::addButton(), SkillDialog::addDefaultTab(), CharSelectDialog::askPasswordForDeletion(), Button::Button(), ChangeEmailDialog::ChangeEmailDialog(), ChangePasswordDialog::ChangePasswordDialog(), CharacterDisplay::CharacterDisplay(), CharCreateDialog::CharCreateDialog(), ChatWindow::ChatWindow(), CheckBox::CheckBox(), MiniStatusWindow::createBar(), SetupActionDropDown::createControls(), SetupItemIntTextField::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), NpcDialog::createSkinControls(), DropDown::DropDown(), EquipmentWindow::EquipmentWindow(), PopupMenu::handleLink(), BuyDialog::init(), InventoryWindow::InventoryWindow(), SocialGuildTab::invite(), SocialPartyTab::invite(), ItemAmountWindow::ItemAmountWindow(), SkillDialog::loadXmlFile(), LoginDialog::LoginDialog(), NpcDialog::NpcDialog(), OutfitWindow::OutfitWindow(), EmoteWindow::postInit(), EquipmentWindow::postInit(), TextSelectDialog::postInit(), SellDialog::postInit(), SliderList::postInit2(), QuestsWindow::QuestsWindow(), RegisterDialog::RegisterDialog(), TradeWindow::setStatus(), Setup_Colors::Setup_Colors(), Setup_Input::Setup_Input(), Setup_Joystick::Setup_Joystick(), Setup_Relations::Setup_Relations(), Setup_Theme::Setup_Theme(), Setup_Video::Setup_Video(), ShopWindow::ShopWindow(), TextCommandEditor::TextCommandEditor(), TextField::TextField(), SocialWindow::updateMenu(), SkillDialog::useSkillDefault(), SkillDialog::useSkillPosition(), and SkillDialog::useSkillTarget().

596  { mActionEventId = actionEventId; }
std::string mActionEventId
Definition: widget.h:1105

◆ setBackgroundColor()

void Widget::setBackgroundColor ( const Color color)
inline

Sets the background color.

Parameters
colorThe background Color.
See also
setBackgroundColor

Definition at line 424 of file widget.h.

References mBackgroundColor.

Referenced by Setup_Relations::Setup_Relations().

425  { mBackgroundColor = color; }
Color mBackgroundColor
Definition: widget.h:1090

◆ setBaseColor()

void Widget::setBaseColor ( const Color color)
inline

Sets the base color of the widget.

Parameters
colorThe baseground color.
See also
getBaseColor

Definition at line 389 of file widget.h.

References mBaseColor.

390  { mBaseColor = color; }
Color mBaseColor
Definition: widget.h:1095

◆ setDimension()

void Widget::setDimension ( const Rect dimension)

Sets the dimension of the widget. The dimension is relative to the widget's parent.

Parameters
dimensionThe dimension of the widget.
See also
getDimension, setX, getX, setY, getY, setPosition

Definition at line 168 of file widget.cpp.

References distributeMovedEvent(), distributeResizedEvent(), Rect::height, mDimension, Rect::width, Rect::x, and Rect::y.

Referenced by CharCreateDialog::CharCreateDialog(), GuiTable::draw(), EquipmentWindow::EquipmentWindow(), getY(), MapDebugTab::MapDebugTab(), Window::mouseDragged(), NetDebugTab::NetDebugTab(), WhoIsOnline::postInit(), LayoutCell::reflow(), DebugTab::resize(), GuiTable::safeDraw(), TabbedArea::setDimension(), ScrollArea::setDimension(), setHeight(), setPosition(), setSize(), Setup_Audio::Setup_Audio(), Setup_Chat::Setup_Chat(), Setup_Colors::Setup_Colors(), Setup_Input::Setup_Input(), Setup_Joystick::Setup_Joystick(), Setup_Misc::Setup_Misc(), Setup_Mods::Setup_Mods(), Setup_Perfomance::Setup_Perfomance(), Setup_Players::Setup_Players(), Setup_Quick::Setup_Quick(), Setup_Relations::Setup_Relations(), Setup_Theme::Setup_Theme(), Setup_Touch::Setup_Touch(), Setup_Video::Setup_Video(), Setup_Visual::Setup_Visual(), setWidth(), setX(), setY(), TargetDebugTab::TargetDebugTab(), WindowMenu::updateButtons(), EquipmentWindow::updatePage(), and WindowMenu::WindowMenu().

169 {
170  const Rect oldDimension = mDimension;
171  mDimension = dimension;
172 
173  if (mDimension.width != oldDimension.width
174  || mDimension.height != oldDimension.height)
175  {
177  }
178 
179  if (mDimension.x != oldDimension.x || mDimension.y != oldDimension.y)
181 }
int width
Definition: rect.h:218
Definition: rect.h:72
int x
Definition: rect.h:208
int y
Definition: rect.h:213
int height
Definition: rect.h:223
void distributeResizedEvent()
Definition: widget.cpp:465
void distributeMovedEvent()
Definition: widget.cpp:474
Rect mDimension
Definition: widget.h:1100

◆ setEnabled()

void Widget::setEnabled ( const bool  enabled)
inline

Sets the widget to enabled, or not. A disabled widget will never recieve mouse or key events.

Parameters
enabledTrue if widget should be enabled, false otherwise.
See also
isEnabled

Definition at line 351 of file widget.h.

References A_WARN_UNUSED, isEnabled(), mEnabled, and setVisible().

Referenced by Setup_Video::action(), Setup_Input::action(), ChangeEmailDialog::action(), ChangePasswordDialog::action(), EditServerDialog::action(), CharCreateDialog::action(), WorldSelectDialog::action(), RegisterDialog::action(), SkillDialog::action(), WhoIsOnline::action(), BuyDialog::action(), TradeWindow::action(), ShopWindow::announce(), Setup_Video::apply(), Setup_Video::cancel(), ServerDialog::connectToSelectedServer(), UpdaterWindow::enable(), MailEditWindow::focusLost(), BuyDialog::init(), IntTextField::IntTextField(), RegisterDialog::keyPressed(), LoginDialog::keyPressed(), MailEditWindow::MailEditWindow(), Setup_Input::newKeyCallback(), WhoIsOnline::postInit(), RegisterDialog::postInit(), LoginDialog::postInit(), EquipmentWindow::postInit(), TextSelectDialog::postInit(), SellDialog::postInit(), LoginDialog::prepareUpdate(), MailWindow::refreshMails(), TradeWindow::reset(), NpcSellDialog::sellManyItems(), SetupWindow::setInGame(), MailWindow::setLastPage(), CharSelectDialog::setLocked(), EquipmentWindow::setSelected(), TradeWindow::setStatus(), Setup_Joystick::setTempEnabled(), MailEditWindow::setTo(), Setup_Colors::Setup_Colors(), Setup_Input::Setup_Input(), Setup_Joystick::Setup_Joystick(), Setup_Video::Setup_Video(), SkillDialog::SkillDialog(), WhoIsOnline::slowLogic(), CharCreateDialog::unlock(), ChangeDisplay::update(), TabbedArea::updateArrowEnableState(), InventoryWindow::updateButtons(), TextSelectDialog::updateButtonsAndLabels(), ShopWindow::updateButtonsAndLabels(), SellDialog::updateButtonsAndLabels(), BuyDialog::updateButtonsAndLabels(), Setup_Colors::updateGradType(), Setup_Theme::updateInfo(), UpdaterWindow::UpdaterWindow(), CharCreateDialog::updateSliders(), CharSelectDialog::updateState(), SkillDialog::updateTabSelection(), ShopWindow::updateTimes(), MailEditWindow::validatedTo(), Setup_Colors::valueChanged(), ServerDialog::valueChanged(), and WorldSelectDialog::WorldSelectDialog().

352  { mEnabled = enabled; }
bool mEnabled
Definition: widget.h:1157

◆ setFocusable()

void Widget::setFocusable ( const bool  focusable)

◆ setFocusHandler()

void Widget::setFocusHandler ( FocusHandler *const  focusHandler)
virtual

Sets the focus handler to be used.

WARNING: This function is used internally and should not be called or overloaded unless you know what you are doing.

Parameters
focusHandlerThe focus handler to use.
See also
getFocusHandler

Reimplemented in GuiTable, and BasicContainer.

Definition at line 237 of file widget.cpp.

References FocusHandler::add(), mFocusHandler, releaseModalFocus(), and FocusHandler::remove().

Referenced by getBackgroundColor(), BasicContainer::setFocusHandler(), GuiTable::setFocusHandler(), Gui::setTop(), and ~Widget().

238 {
239  if (mFocusHandler != nullptr)
240  {
242  mFocusHandler->remove(this);
243  }
244 
245  if (focusHandler != nullptr)
246  focusHandler->add(this);
247 
248  mFocusHandler = focusHandler;
249 }
virtual void releaseModalFocus()
Definition: widget.cpp:393
void add(Widget *const widget)
void remove(Widget *const widget)
FocusHandler * mFocusHandler
Definition: widget.h:1115

◆ setFont()

void Widget::setFont ( Font *const  font)

◆ setForegroundColor()

void Widget::setForegroundColor ( const Color color)
inline

Sets the foreground color.

Parameters
colorThe foreground color.
See also
getForegroundColor

Definition at line 407 of file widget.h.

References mForegroundColor.

408  { mForegroundColor = color; }
Color mForegroundColor
Definition: widget.h:1085

◆ setFrameSize()

void Widget::setFrameSize ( const unsigned int  frameSize)
inline

Sets the size of the widget's frame. The frame is not considered a part of the widget, it only allows a frame to be drawn around the widget, thus a frame will never be included when calculating if a widget should receive events from user input. Also a widget's frame will never be included when calculating a widget's position.

A frame size of 0 means that the widget has no frame. The default frame size is 0.

Parameters
frameSizeThe size of the widget's frame.
See also
getFrameSize, drawFrame

Definition at line 167 of file widget.h.

References mFrameSize.

Referenced by PlayerBox::init(), Tab::init(), Slider::init(), Button::init(), ScrollArea::setOpaque(), TextBox::TextBox(), TextField::TextField(), and Window::Window().

168  { mFrameSize = frameSize; }
unsigned int mFrameSize
Definition: widget.h:1137

◆ setGlobalFont()

void Widget::setGlobalFont ( Font *const  font)
static

Sets the global font to be used by default for all widgets.

Parameters
fontThe global font.
See also
getGlobalFont

Definition at line 337 of file widget.cpp.

References ServerCommandType::font, FOR_EACH, mAllWidgets, and mGlobalFont.

Referenced by Gui::postInit(), and setParent().

338 {
339  mGlobalFont = font;
340 
341  FOR_EACH (std::list<Widget*>::const_iterator, iter, mAllWidgets)
342  {
343  if ((*iter)->mCurrentFont == nullptr)
344  (*iter)->fontChanged();
345  }
346 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static std::list< Widget * > mAllWidgets
Definition: widget.h:1176
static Font * mGlobalFont
Definition: widget.h:1170

◆ setHeight()

void Widget::setHeight ( const int  height)

Sets the height of the widget.

Parameters
heightThe height of the widget.
See also
getHeight, setWidth, getWidth, setSize, setDimension, getDimension

Definition at line 139 of file widget.cpp.

References Rect::height, mDimension, and setDimension().

Referenced by VertContainer::add2(), BrowserBox::addRow(), DropDown::adjustHeight(), ItemContainer::adjustHeight(), TextField::adjustHeight(), ColorPage::adjustSize(), ExtendedListBox::adjustSize(), ShopListBox::adjustSize(), Label::adjustSize(), TextPreview::adjustSize(), RadioButton::adjustSize(), CheckBox::adjustSize(), ListBox::adjustSize(), Button::adjustSize(), TextBox::adjustSize(), CharacterDisplay::CharacterDisplay(), CharacterViewNormal::CharacterViewNormal(), CharacterViewSmall::CharacterViewSmall(), CharCreateDialog::CharCreateDialog(), StaticBrowserBox::clearRows(), BrowserBox::clearRows(), ColorPage::ColorPage(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), NpcDialog::createSkinControls(), BrowserBox::draw(), SkillRectangleListBox::draw(), DropDown::DropDown(), getWidth(), HorizontContainer::HorizontContainer(), ItemAmountWindow::ItemAmountWindow(), Label::Label(), ScrollArea::logic(), NpcDialog::logic(), NpcDialog::NpcDialog(), EmoteWindow::postInit(), ProgressBar::ProgressBar(), GuiTable::recomputeDimensions(), Label::resizeTo(), Window::saveWindowState(), TabbedArea::setHeight(), ScrollArea::setHeight(), Minimap::setMap(), TextPopup::show(), NpcDialog::showAvatar(), SkillRectangleListBox::SkillRectangleListBox(), SliderList::SliderList(), TextCommandEditor::TextCommandEditor(), StatusPopup::update(), BrowserBox::updateHeight(), WidgetGroup::WidgetGroup(), ShortcutContainer::widgetResized(), and FlowContainer::widgetResized().

140 {
141  Rect newDimension = mDimension;
142  newDimension.height = height;
143  setDimension(newDimension);
144 }
Definition: rect.h:72
void setDimension(const Rect &dimension)
Definition: widget.cpp:168
int height
Definition: rect.h:223
Rect mDimension
Definition: widget.h:1100

◆ setId()

void Widget::setId ( const std::string &  id)
inline

Sets an id of a widget. An id can be useful if a widget needs to be identified in a container. For example, if widgets are created by an XML document, a certain widget can be retrieved given that the widget has an id.

Parameters
idThe id to set to the widget.
See also
getId

Definition at line 915 of file widget.h.

References mId.

Referenced by MiniStatusWindow::createBar().

916  { mId = id; }
std::string mId
Definition: widget.h:1110

◆ setInternalFocusHandler()

void Widget::setInternalFocusHandler ( FocusHandler *const  internalFocusHandler)

Sets the internal focus handler. An internal focus handler is needed if both a widget in the widget and the widget itself should be foucsed at the same time.

Parameters
focusHandlerThe internal focus handler to be used.
See also
getInternalFocusHandler

Definition at line 460 of file widget.cpp.

References mInternalFocusHandler.

Referenced by getWidgetAt(), and BasicContainer::setInternalFocusHandler().

461 {
462  mInternalFocusHandler = focusHandler;
463 }
FocusHandler * mInternalFocusHandler
Definition: widget.h:1121

◆ setMouseConsume()

void Widget::setMouseConsume ( const bool  b)
inline

Definition at line 935 of file widget.h.

References mMouseConsume.

Referenced by PopupList::PopupList().

936  { mMouseConsume = b; }
bool mMouseConsume
Definition: widget.h:1161

◆ setParent()

virtual void Widget::setParent ( Widget parent)
inlinevirtual

Sets the parent of the widget. A parent must be a BasicContainer.

WARNING: This function is used internally and should not be called or overloaded unless you know what you are doing.

Parameters
parentThe parent of the widget.
See also
getParent

Reimplemented in Button, TextField, RadioButton, CheckBox, and Label.

Definition at line 625 of file widget.h.

References A_WARN_UNUSED, ServerCommandType::font, getFont(), mParent, RETURNS_NONNULL, and setGlobalFont().

Referenced by Label::setParent(), CheckBox::setParent(), RadioButton::setParent(), TextField::setParent(), Button::setParent(), and GuiTableActionListener::~GuiTableActionListener().

626  { mParent = parent; }
Widget * mParent
Definition: widget.h:1127

◆ setPosition()

void Widget::setPosition ( const int  x,
const int  y 
)

Sets position of the widget. The position is relative to the widget's parent.

Parameters
xThe x coordinate of the widget.
yThe y coordinate of the widget.
See also
setX, getX, setY, getY, setDimension, getDimension

Definition at line 160 of file widget.cpp.

References mDimension, setDimension(), x, Rect::x, y, and Rect::y.

Referenced by HorizontContainer::add(), VertContainer::add2(), WindowMenu::addButton(), BeingPopup::addLabels(), ShortcutWindow::addTab(), WidgetGroup::addWidget(), BasicContainer2::addXY(), TabbedArea::adjustSize(), TabbedArea::adjustTabPositions(), ChatWindow::adjustTabSize(), BeingPopup::BeingPopup(), ChangeEmailDialog::ChangeEmailDialog(), CharCreateDialog::CharCreateDialog(), ChatWindow::ChatWindow(), NpcDialog::createSkinControls(), Being::drawSpeech(), getY(), BuySellDialog::init(), Tab::init(), ItemPopup::ItemPopup(), Window::loadWindowState(), ScrollArea::logic(), ShortcutWindow::mouseDragged(), ChatWindow::mouseDragged(), Window::mouseDragged(), Client::moveButtons(), OkDialog::OkDialog(), PopupList::PopupList(), Popup::position(), EmoteWindow::postInit(), SetupWindow::postInit(), TextPopup::postInit(), EditDialog::postInit(), ConfirmDialog::postInit(), EquipmentWindow::postInit(), Window::resetToDefaultSize(), CharacterViewSmall::resize(), SliderList::resize(), CharCreateDialog::setButtonsPosition(), ScrollArea::setContent(), SpellPopup::setItem(), ItemPopup::setItem(), Window::setLocationHorisontallyRelativeTo(), Popup::setLocationRelativeTo(), Window::setLocationRelativeTo(), SpeechBubble::setText(), ShortcutWindow::ShortcutWindow(), CutInWindow::show(), PopupList::show(), TextBoxPopup::show(), SkillPopup::show(), TextPopup::show(), PopupMenu::showPopup(), SkillPopup::SkillPopup(), MiniStatusWindow::updateBars(), WindowMenu::updateButtons(), SliderList::updateLabel(), Game::videoResized(), StatusPopup::view(), SpellPopup::view(), SetupWindow::widgetResized(), and TabbedArea::widgetResized().

161 {
162  Rect newDimension = mDimension;
163  newDimension.x = x;
164  newDimension.y = y;
165  setDimension(newDimension);
166 }
Definition: rect.h:72
void setDimension(const Rect &dimension)
Definition: widget.cpp:168
int x
Definition: rect.h:208
int y
Definition: rect.h:213
Rect mDimension
Definition: widget.h:1100

◆ setRedraw()

void Widget::setRedraw ( const bool  b)
inline

Definition at line 941 of file widget.h.

References mRedraw.

Referenced by ShortcutWindow::widgetMoved().

942  { mRedraw = b; }
bool mRedraw
Definition: widget.h:1163

◆ setSelectable()

void Widget::setSelectable ( const bool  selectable)
inline

◆ setSize()

void Widget::setSize ( const int  width,
const int  height 
)

Sets the size of the widget.

Parameters
widthThe width of the widget.
heightThe height of the widget.
See also
setWidth, setHeight, getWidth, getHeight, setDimension, getDimension

Definition at line 366 of file widget.cpp.

References Rect::height, mDimension, setDimension(), and Rect::width.

Referenced by FlowContainer::add(), VertContainer::add2(), TabbedArea::addTab(), TabbedArea::adjustSize(), Tab::adjustSize(), ChatWindow::adjustTabSize(), TabbedArea::adjustWidget(), AttrDisplay::AttrDisplay(), Game::Game(), getHeight(), Icon::Icon(), Window::loadWindowState(), WhoIsOnline::postInit(), Gui::postInit(), ProgressBar::ProgressBar(), ProgressIndicator::ProgressIndicator(), LayoutHelper::reflowLayout(), Window::resetToDefaultSize(), Window::resizeToContent(), WindowManager::resizeVideo(), Popup::setContentSize(), Window::setContentSize(), Icon::setImage(), TabbedArea::setSize(), CutInWindow::show(), Client::stateGame(), Client::stateGame1(), StaticBrowserBox::updateHeight(), WhoIsOnline::updateSize(), Game::videoResized(), Gui::videoResized(), StatsPageBasic::widgetResized(), StatsPage::widgetResized(), Desktop::widgetResized(), EmoteWindow::widgetResized(), ScrollArea::widgetResized(), and TabbedArea::widgetResized().

367 {
368  Rect newDimension = mDimension;
369  newDimension.width = width;
370  newDimension.height = height;
371  setDimension(newDimension);
372 }
int width
Definition: rect.h:218
Definition: rect.h:72
void setDimension(const Rect &dimension)
Definition: widget.cpp:168
int height
Definition: rect.h:223
Rect mDimension
Definition: widget.h:1100

◆ setTabInEnabled()

void Widget::setTabInEnabled ( const bool  enabled)
inline

Sets tab in enabled, or not. Tab in means that you can set focus to this widget by pressing the tab button. If tab in is disabled then the FocusHandler will skip this widget and focus the next in its focus order.

Parameters
enabledTrue if tab in should be enabled, false otherwise.
See also
isTabInEnabled

Definition at line 699 of file widget.h.

References mTabIn.

700  { mTabIn = enabled; }
bool mTabIn
Definition: widget.h:1147

◆ setTabOutEnabled()

void Widget::setTabOutEnabled ( const bool  enabled)
inline

Sets tab out enabled. Tab out means that you can lose focus to this widget by pressing the tab button. If tab out is disabled then the FocusHandler ignores tabbing and focus will stay with this widget.

Parameters
enabledTrue if tab out should be enabled, false otherwise.
See also
isTabOutEnabled

Definition at line 723 of file widget.h.

References A_WARN_UNUSED, isModalFocused(), isModalMouseInputFocused(), mTabOut, releaseModalFocus(), releaseModalMouseInputFocus(), requestModalFocus(), and requestModalMouseInputFocus().

724  { mTabOut = enabled; }
bool mTabOut
Definition: widget.h:1152

◆ setVisible()

void Widget::setVisible ( Visible  visible)

Sets the widget to be visible, or not.

Parameters
visibleTrue if widget should be visible, false otherwise.
See also
isVisible

Definition at line 224 of file widget.cpp.

References distributeHiddenEvent(), distributeShownEvent(), FocusHandler::focusNone(), isFocused(), mFocusHandler, mVisible, Visible_false, and Visible_true.

Referenced by LoginDialog::action(), ChatWindow::action(), SkillDialog::addDefaultTab(), SkillDialog::addSkill(), ChatWindow::adjustTabSize(), CharacterViewNormal::CharacterViewNormal(), CharacterViewSmall::CharacterViewSmall(), CharCreateDialog::CharCreateDialog(), CharSelectDialog::CharSelectDialog(), ChatWindow::ChatWindow(), Being::drawSpeech(), PopupList::focusGained(), ItemLinkHandler::handleItemLink(), PopupMenu::handleLink(), Popup::hide(), PopupManager::hideBeingPopup(), DropDown::hideDrop(), PopupManager::hidePopupMenu(), PopupManager::hideTextPopup(), MiniStatusWindow::loadBars(), WindowMenu::loadButtons(), SkillDialog::loadXmlFile(), LoginDialog::LoginDialog(), ItemAmountWindow::mouseExited(), ItemShortcutContainer::mouseExited(), SpellShortcutContainer::mouseExited(), VirtShortcutContainer::mouseExited(), EmoteShortcutContainer::mouseExited(), CharacterDisplay::mouseExited(), ItemContainer::mouseExited(), EquipmentWindow::mouseExited(), TextBoxPopup::mouseMoved(), SpellPopup::mouseMoved(), SkillPopup::mouseMoved(), ItemPopup::mouseMoved(), ItemShortcutContainer::mouseMoved(), SpellShortcutContainer::mouseMoved(), EmoteShortcutContainer::mouseMoved(), TextPopup::mouseMoved(), VirtShortcutContainer::mouseMoved(), CharacterDisplay::mouseMoved(), ShopListBox::mouseMoved(), ItemContainer::mouseMoved(), EquipmentWindow::mouseMoved(), EquipmentWindow::mousePressed(), PopupList::mouseReleased(), NpcDialog::NpcDialog(), Popup::Popup(), Popup::position(), MailViewWindow::removeMoney(), CharCreateDialog::setAttributes(), setEnabled(), EquipmentWindow::setSelected(), ChatInput::setVisible(), Window::setVisible(), CharacterViewSmall::show(), BeingPopup::show(), PopupList::show(), TextBoxPopup::show(), TextPopup::show(), MiniStatusWindow::showBar(), WindowMenu::showButton(), PopupMenu::showChangePos(), TextCommandEditor::showControls(), PopupMenu::showPopup(), TabbedArea::updateArrowEnableState(), MailViewWindow::updateAttachButton(), EquipmentWindow::updatePage(), SkillDialog::updateSkill(), Setup_Colors::valueChanged(), StatusPopup::view(), SpellPopup::view(), SpellShortcutContainer::widgetHidden(), ItemShortcutContainer::widgetHidden(), VirtShortcutContainer::widgetHidden(), CharacterDisplay::widgetHidden(), EmoteShortcutContainer::widgetHidden(), InventoryWindow::widgetHidden(), InventoryWindow::widgetResized(), and WindowMenu::WindowMenu().

225 {
226  if (visible == Visible_false && isFocused() && (mFocusHandler != nullptr))
228 
229  if (visible == Visible_true)
231  else
233 
234  mVisible = visible;
235 }
const bool Visible_true
Definition: visible.h:29
FocusHandler * mFocusHandler
Definition: widget.h:1115
virtual bool isFocused() const
Definition: widget.cpp:183
Visible mVisible
Definition: widget.h:962
const bool Visible_false
Definition: visible.h:29
void distributeShownEvent()
Definition: widget.cpp:501
void distributeHiddenEvent()
Definition: widget.cpp:483

◆ setWidth()

void Widget::setWidth ( const int  width)

Sets the width of the widget.

Parameters
widthThe width of the widget.
See also
getWidth, setHeight, getHeight, setSize, setDimension, getDimensi

Definition at line 132 of file widget.cpp.

References mDimension, setDimension(), and Rect::width.

Referenced by StaticBrowserBox::addRow(), PopupList::adjustSize(), SliderList::adjustSize(), Label::adjustSize(), RadioButton::adjustSize(), CheckBox::adjustSize(), TextField::adjustSize(), Button::adjustSize(), TextBox::adjustSize(), ChatWindow::adjustTabSize(), AvatarListBox::AvatarListBox(), BrowserBox::calcHeight(), ChangeEmailDialog::ChangeEmailDialog(), CharacterDisplay::CharacterDisplay(), CharacterViewNormal::CharacterViewNormal(), CharCreateDialog::CharCreateDialog(), CharSelectDialog::CharSelectDialog(), StaticBrowserBox::clearRows(), BrowserBox::clearRows(), SetupActionDropDown::createControls(), SetupItemTextField::createControls(), SetupItemIntTextField::createControls(), SetupItemDropDown::createControls(), SetupItemDropDownStr::createControls(), SetupItemSlider::createControls(), SetupItemSlider2::createControls(), NpcDialog::createSkinControls(), AvatarListBox::draw(), SkillRectangleListBox::draw(), DropDown::DropDown(), DropDown::dropDown(), SetupItem::fixFirstItemSize(), getParent(), BuyDialog::init(), IntTextField::IntTextField(), ItemAmountWindow::ItemAmountWindow(), Label::Label(), ListBox::ListBox(), ScrollArea::logic(), NpcDialog::logic(), MailEditWindow::MailEditWindow(), NpcDialog::NpcDialog(), EmoteWindow::postInit(), EditDialog::postInit(), SellDialog::postInit(), QuestsWindow::QuestsWindow(), EquipmentWindow::recalcSize(), GuiTable::recomputeDimensions(), SliderList::resize(), Label::resizeTo(), AvatarListBox::safeDraw(), Window::saveWindowState(), ItemPopup::setItem(), Minimap::setMap(), Setup_Colors::Setup_Colors(), Setup_Video::Setup_Video(), TabbedArea::setWidth(), ScrollArea::setWidth(), TextPopup::show(), NpcDialog::showAvatar(), PopupMenu::showPopup(), SkillRectangleListBox::SkillRectangleListBox(), TextCommandEditor::TextCommandEditor(), TradeWindow::TradeWindow(), StatusPopup::update(), WhoIsOnline::updateSize(), and FlowContainer::widgetResized().

133 {
134  Rect newDimension = mDimension;
135  newDimension.width = width;
136  setDimension(newDimension);
137 }
int width
Definition: rect.h:218
Definition: rect.h:72
void setDimension(const Rect &dimension)
Definition: widget.cpp:168
Rect mDimension
Definition: widget.h:1100

◆ setX()

void Widget::setX ( const int  x)

Sets the x coordinate of the widget. The coordinate is relateive to the widget's parent.

Parameters
xThe x coordinate of the widget.
See also
getX, setY, getY, setPosition, setDimension, getDimension

Definition at line 146 of file widget.cpp.

References mDimension, setDimension(), x, and Rect::x.

Referenced by getHeight().

147 {
148  Rect newDimension = mDimension;
149  newDimension.x = x;
150  setDimension(newDimension);
151 }
Definition: rect.h:72
void setDimension(const Rect &dimension)
Definition: widget.cpp:168
int x
Definition: rect.h:208
Rect mDimension
Definition: widget.h:1100

◆ setY()

void Widget::setY ( const int  y)

Sets the y coordinate of the widget. The coordinate is relative to the widget's parent.

Parameters
yThe y coordinate of the widget.
See also
setY, setX, getX, setPosition, setDimension, getDimension

Definition at line 153 of file widget.cpp.

References mDimension, setDimension(), y, and Rect::y.

Referenced by getX().

154 {
155  Rect newDimension = mDimension;
156  newDimension.y = y;
157  setDimension(newDimension);
158 }
Definition: rect.h:72
void setDimension(const Rect &dimension)
Definition: widget.cpp:168
int y
Definition: rect.h:213
Rect mDimension
Definition: widget.h:1100

◆ showPart()

void Widget::showPart ( const Rect rectangle)
virtual

Shows a certain part of a widget in the widget's parent. Used when widgets want a specific part to be visible in its parent. An example is a TextArea that wants a specific part of its text to be visible when a TextArea is a child of a ScrollArea.

Parameters
rectangleThe rectangle to be shown.

Definition at line 510 of file widget.cpp.

References mParent, and showWidgetPart().

Referenced by getId(), ChatTab::scroll(), TextBox::scrollToCaret(), NpcSellDialog::sellOneItem(), and ListBox::setSelected().

511 {
512  if (mParent != nullptr)
513  mParent->showWidgetPart(this, rectangle);
514 }
virtual void showWidgetPart(Widget *const widget, const Rect &area)
Definition: widget.h:902
Widget * mParent
Definition: widget.h:1127

◆ showWidgetPart()

virtual void Widget::showWidgetPart ( Widget *const  widget,
const Rect area 
)
inlinevirtual

Tries to show a specific part of a widget by moving it. Used if the widget should act as a container.

Parameters
widgetThe target widget.
areaThe area to show.

Reimplemented in ScrollArea, and BasicContainer.

Definition at line 902 of file widget.h.

Referenced by showPart().

904  { }

◆ widgetExists()

bool Widget::widgetExists ( const Widget *const  widget)
static

Checks if a widget exists or not, that is if it still exists an instance of the object.

Parameters
widgetThe widget to check.
Returns
True if an instance of the widget exists, false otherwise.

Definition at line 360 of file widget.cpp.

References mAllWidgetsSet.

Referenced by Gui::distributeKeyEvent(), Gui::distributeMouseEvent(), fontChanged(), PopupMenu::handleLink(), Gui::handleModalFocusGained(), Gui::handleModalFocusReleased(), Gui::handleMouseMoved(), and Gui::~Gui().

361 {
362  return mAllWidgetsSet.find(const_cast<Widget*>(widget))
363  != mAllWidgetsSet.end();
364 }
static std::set< Widget * > mAllWidgetsSet
Definition: widget.h:1178

◆ windowResized()

void Widget::windowResized ( )

Definition at line 516 of file widget.cpp.

References mRedraw.

Referenced by setSelectable().

517 {
518  mRedraw = true;
519 }
bool mRedraw
Definition: widget.h:1163

Friends And Related Function Documentation

◆ BasicContainer

friend class BasicContainer
friend

Definition at line 100 of file widget.h.

Field Documentation

◆ mActionEventId

std::string Widget::mActionEventId
protected

Holds the action event of the widget.

Definition at line 1105 of file widget.h.

Referenced by WidgetGroup::addButton(), distributeActionEvent(), getActionEventId(), PlayerBox::mouseReleased(), and setActionEventId().

◆ mActionListeners

ActionListenerList Widget::mActionListeners
protected

Holds the action listeners of the widget.

Definition at line 1033 of file widget.h.

Referenced by WidgetGroup::action(), EditDialog::action(), addActionListener(), distributeActionEvent(), and removeActionListener().

◆ mAllowLogic

bool Widget::mAllowLogic
protected

◆ mAllWidgets

std::list< Widget * > Widget::mAllWidgets
staticprivate

Holds a list of all instances of widgets.

Definition at line 1176 of file widget.h.

Referenced by distributeWindowResizeEvent(), setGlobalFont(), Widget(), and ~Widget().

◆ mAllWidgetsSet

std::set< Widget * > Widget::mAllWidgetsSet
staticprivate

Definition at line 1178 of file widget.h.

Referenced by Widget(), widgetExists(), and ~Widget().

◆ mBackgroundColor

Color Widget::mBackgroundColor
protected

◆ mBaseColor

Color Widget::mBaseColor
protected

Holds the base color of the widget.

Definition at line 1095 of file widget.h.

Referenced by BasicContainer2::draw(), getBaseColor(), BasicContainer2::safeDraw(), and setBaseColor().

◆ mCurrentFont

Font* Widget::mCurrentFont
protected

Holds the font used by the widget.

Definition at line 1132 of file widget.h.

Referenced by getFont(), and setFont().

◆ mDeathListeners

WidgetDeathListenerList Widget::mDeathListeners
protected

Holds the death listeners of the widget.

Definition at line 1048 of file widget.h.

Referenced by addDeathListener(), removeDeathListener(), and ~Widget().

◆ mDimension

Rect Widget::mDimension
protected

Holds the dimension of the widget.

Definition at line 1100 of file widget.h.

Referenced by VertContainer::add2(), Window::adjustPositionAfterResize(), PopupList::adjustSize(), TabbedArea::adjustSize(), Window::adjustSizeToScreen(), BrowserBox::calcHeight(), ScrollArea::calcHMarker(), ScrollArea::calcVMarker(), DebugWindow::DebugWindow(), ColorPage::draw(), EmotePage::draw(), ExtendedListBox::draw(), ProgressIndicator::draw(), DebugWindow::draw(), SliderList::draw(), ShopListBox::draw(), Desktop::draw(), DropDown::draw(), Icon::draw(), ProgressBar::draw(), PlayerBox::draw(), Popup::draw(), TextPreview::draw(), StaticBrowserBox::draw(), ListBox::draw(), BrowserBox::draw(), Tab::draw(), Label::draw(), GuiTable::draw(), Slider::draw(), Window::draw(), BasicContainer2::draw(), Button::draw(), DropDown::drawButton(), DropDown::drawFrame(), PlayerBox::drawFrame(), TextField::drawFrame(), ScrollArea::drawFrame(), ScrollArea::drawHMarker(), ScrollArea::drawVMarker(), DropDown::dropDown(), Window::ensureOnScreen(), TextField::fixScroll(), getAbsolutePosition(), MiniStatusWindow::getChildrenArea(), GuiTable::getChildrenArea(), BasicContainer::getChildrenArea(), DropDown::getChildrenArea(), Popup::getChildrenArea(), Window::getChildrenArea(), getDimension(), ScrollArea::getDownButtonDimension(), getHeight(), ScrollArea::getHorizontalBarDimension(), ScrollArea::getHorizontalMarkerDimension(), EmotePage::getIndexFromGrid(), ScrollArea::getLeftButtonDimension(), Window::getResizeHandles(), ScrollArea::getRightButtonDimension(), ItemContainer::getSlotByXY(), ItemContainer::getSlotIndex(), ScrollArea::getUpButtonDimension(), ScrollArea::getVerticalBarDimension(), ScrollArea::getVerticalMarkerDimension(), getWidth(), Window::getWindowArea(), getX(), getY(), Window::loadWindowState(), ScrollArea::logic(), Slider::markerPositionToValue(), Slider::mouseDragged(), Window::mouseDragged(), WindowMenu::mouseMoved(), Minimap::mouseMoved(), MiniStatusWindow::mouseMoved(), InventoryWindow::mouseMoved(), Slider::mousePressed(), DropDown::mouseReleased(), Popup::position(), CharacterViewSmall::resize(), EmotePage::safeDraw(), ProgressIndicator::safeDraw(), DebugWindow::safeDraw(), SliderList::safeDraw(), Icon::safeDraw(), ProgressBar::safeDraw(), Popup::safeDraw(), Tab::safeDraw(), GuiTable::safeDraw(), Slider::safeDraw(), Window::safeDraw(), BasicContainer2::safeDraw(), Button::safeDraw(), DropDown::safeDrawFrame(), PlayerBox::safeDrawFrame(), TextField::safeDrawFrame(), ScrollArea::safeDrawFrame(), Window::saveWindowState(), Desktop::setBestFittingWallpaper(), Window::setDefaultSize(), setDimension(), setHeight(), Window::setLocationHorisontallyRelativeTo(), Popup::setLocationRelativeTo(), Window::setLocationRelativeTo(), Minimap::setMap(), setPosition(), Window::setResizable(), setSize(), Window::setVisible(), setWidth(), setX(), setY(), PopupList::show(), TextBoxPopup::show(), TextPopup::show(), TabbedArea::updateArrowEnableState(), StaticBrowserBox::updateHeight(), BrowserBox::updateHeight(), SliderList::updateLabel(), ItemContainer::updateSize(), Slider::valueToMarkerPosition(), SpellPopup::view(), ShortcutContainer::widgetResized(), DebugWindow::widgetResized(), EmoteWindow::widgetResized(), Window::widgetResized(), ScrollArea::widgetResized(), and TabbedArea::widgetResized().

◆ mEnabled

bool Widget::mEnabled
protected

True if the widget is enabled, false otherwise.

Definition at line 1157 of file widget.h.

Referenced by RadioButton::drawBox(), CheckBox::drawBox(), isEnabled(), and setEnabled().

◆ mFocusable

bool Widget::mFocusable
protected

True if the widget focusable, false otherwise.

Definition at line 1142 of file widget.h.

Referenced by isFocusable(), and setFocusable().

◆ mFocusHandler

FocusHandler* Widget::mFocusHandler
protected

◆ mFocusListeners

FocusListenerList Widget::mFocusListeners
protected

Holds the focus listeners of the widget.

Definition at line 1063 of file widget.h.

Referenced by addFocusListener(), getFocusListeners(), and removeFocusListener().

◆ mForegroundColor

Color Widget::mForegroundColor
protected

◆ mFrameSize

unsigned int Widget::mFrameSize
protected

◆ mGlobalFont

Font * Widget::mGlobalFont = 0
staticprotected

Holds the global font used by the widget.

Definition at line 1170 of file widget.h.

Referenced by cleanGlobalFont(), getFont(), getGloablFont(), and setGlobalFont().

◆ mId

std::string Widget::mId
protected

Holds the id of the widget.

Definition at line 1110 of file widget.h.

Referenced by getId(), and setId().

◆ mInternalFocusHandler

FocusHandler* Widget::mInternalFocusHandler
protected

Holds the focus handler used by the widget. NULL if no internal focus handler is used.

Definition at line 1121 of file widget.h.

Referenced by BasicContainer::add(), getInternalFocusHandler(), BasicContainer::setFocusHandler(), BasicContainer::setInternalFocusHandler(), and setInternalFocusHandler().

◆ mKeyListeners

KeyListenerList Widget::mKeyListeners
protected

Holds the key listeners of the widget.

Definition at line 1018 of file widget.h.

Referenced by addKeyListener(), getKeyListeners(), and removeKeyListener().

◆ mMouseConsume

bool Widget::mMouseConsume
protected

◆ mMouseListeners

MouseListenerList Widget::mMouseListeners
protected

Holds the mouse listeners of the widget.

Definition at line 1008 of file widget.h.

Referenced by addMouseListener(), getMouseListeners(), and removeMouseListener().

◆ mParent

Widget* Widget::mParent
protected

◆ mRedraw

bool Widget::mRedraw
protected

Definition at line 1163 of file widget.h.

Referenced by EmotePage::draw(), ItemContainer::draw(), ProgressBar::draw(), Popup::draw(), Tab::draw(), Slider::draw(), Window::draw(), ScrollArea::draw(), Button::draw(), ShortcutContainer::drawBackground(), ScrollArea::drawFrame(), Popup::hide(), ProgressBar::logic(), ScrollArea::mouseDragged(), Slider::mouseEntered(), Slider::mouseExited(), Popup::mouseMoved(), ScrollArea::mouseReleased(), Popup::position(), ScrollArea::safeDraw(), ProgressBar::setBackgroundColor(), ItemContainer::setCellBackgroundImage(), Popup::setContentSize(), Tab::setFlash(), Tab::setFlashTabColor(), Tab::setHighlightedTabColor(), Tab::setLabelFont(), Popup::setLocationRelativeTo(), Tab::setPlayerFlashTabColor(), ProgressBar::setProgress(), ProgressBar::setProgressPalette(), setRedraw(), EquipmentWindow::setSelected(), Tab::setSelectedTabColor(), Window::setSticky(), Tab::setTabColor(), Slider::setValue(), ScrollArea::updateCalcFlag(), ItemContainer::updateMatrix(), EquipmentWindow::updatePage(), ItemContainer::updateSize(), Window::widgetHidden(), Button::widgetHidden(), EmotePage::widgetMoved(), ShortcutContainer::widgetMoved(), ItemContainer::widgetMoved(), ProgressBar::widgetMoved(), Popup::widgetMoved(), Window::widgetMoved(), Tab::widgetMoved(), ScrollArea::widgetMoved(), Button::widgetMoved(), EmotePage::widgetResized(), ShortcutContainer::widgetResized(), ProgressBar::widgetResized(), Popup::widgetResized(), Window::widgetResized(), Tab::widgetResized(), ScrollArea::widgetResized(), Button::widgetResized(), and windowResized().

◆ mSelectable

bool Widget::mSelectable
protected

Definition at line 1165 of file widget.h.

Referenced by isSelectable(), and setSelectable().

◆ mTabIn

bool Widget::mTabIn
protected

True if the widget has tab in enabled, false otherwise.

Definition at line 1147 of file widget.h.

Referenced by isTabInEnabled(), and setTabInEnabled().

◆ mTabOut

bool Widget::mTabOut
protected

True if the widget has tab in enabled, false otherwise.

Definition at line 1152 of file widget.h.

Referenced by isTabOutEnabled(), and setTabOutEnabled().

◆ mVisible

Visible Widget::mVisible

◆ mWidgetListeners

WidgetListenerList Widget::mWidgetListeners
protected

Holds the widget listeners of the widget.

Definition at line 1075 of file widget.h.

Referenced by addWidgetListener(), distributeHiddenEvent(), distributeMovedEvent(), distributeResizedEvent(), distributeShownEvent(), and removeWidgetListener().


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