ScummVM API documentation
GUI::Widget Class Referenceabstract
Inheritance diagram for GUI::Widget:
GUI::GuiObject GUI::CommandReceiver GUI::ContainerWidget GUI::EditableWidget GUI::GraphicsWidget GUI::OptionsContainerWidget GUI::PopUpWidget GUI::RichTextWidget GUI::ScrollBarWidget GUI::ScrollContainerWidget GUI::SliderWidget GUI::StaticTextWidget GUI::TabWidget

Public Member Functions

 Widget (GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip=Common::U32String())
 
 Widget (GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip=Common::U32String())
 
 Widget (GuiObject *boss, const Common::String &name, const Common::U32String &tooltip=Common::U32String())
 
void init ()
 
void setNext (Widget *w)
 
void setBoss (GuiObject *newBoss)
 
Widgetnext ()
 
int16 getAbsX () const override
 
int16 getAbsY () const override
 
virtual void setPos (int x, int y)
 
virtual void setSize (int w, int h)
 
virtual void getMinSize (int &minWidth, int &minHeight)
 
virtual void handleMouseDown (int x, int y, int button, int clickCount)
 
virtual void handleMouseUp (int x, int y, int button, int clickCount)
 
virtual void handleMouseEntered (int button)
 
virtual void handleMouseLeft (int button)
 
virtual void handleMouseMoved (int x, int y, int button)
 
void handleMouseWheel (int x, int y, int direction) override
 
virtual bool handleKeyDown (Common::KeyState state)
 
virtual bool handleKeyUp (Common::KeyState state)
 
virtual void handleOtherEvent (const Common::Event &evt)
 
virtual void handleTickle ()
 
virtual void markAsDirty ()
 
virtual void draw ()
 
void receivedFocus ()
 
void lostFocus ()
 
virtual bool wantsFocus ()
 
uint32 getType () const
 
void setFlags (int flags)
 
void clearFlags (int flags)
 
int getFlags () const
 
void setEnabled (bool e)
 
bool isEnabled () const
 
void setVisible (bool e)
 
bool isVisible () const override
 
bool useRTL () const
 
uint8 parseHotkey (const Common::U32String &label)
 
Common::U32String cleanupHotkey (const Common::U32String &label)
 
bool hasTooltip () const
 
const Common::U32StringgetTooltip () const
 
void setTooltip (const Common::U32String &tooltip)
 
void setTooltip (const Common::String &tooltip)
 
virtual bool containsWidget (Widget *) const
 
void read (const Common::U32String &str)
 
- Public Member Functions inherited from GUI::GuiObject
 GuiObject (int x, int y, int w, int h, bool scale=false)
 
 GuiObject (const Common::String &name)
 
virtual void setTextDrawableArea (const Common::Rect &r)
 
virtual void resize (int x, int y, int w, int h, bool scale=true)
 
virtual WidgetaddChild (Widget *newChild)
 
virtual int16 getRelX () const
 
virtual int16 getRelY () const
 
virtual int16 getChildX () const
 
virtual int16 getChildY () const
 
virtual uint16 getWidth () const
 
virtual uint16 getHeight () const
 
virtual void reflowLayout ()
 
virtual void removeWidget (Widget *widget)
 
virtual bool isPointIn (int x, int y)
 
virtual Common::Rect getClipRect () const
 
virtual void handleTooltipUpdate (int x, int y)
 

Static Public Member Functions

static WidgetfindWidgetInChain (Widget *start, int x, int y)
 
static WidgetfindWidgetInChain (Widget *start, const char *name)
 
static bool containsWidgetInChain (Widget *start, Widget *search)
 

Protected Member Functions

void updateState (int oldFlags, int newFlags)
 
virtual void drawWidget ()=0
 
virtual void receivedFocusWidget ()
 
virtual void lostFocusWidget ()
 
virtual WidgetfindWidget (int x, int y)
 
void releaseFocus () override
 
void handleCommand (CommandSender *sender, uint32 cmd, uint32 data) override
 

Protected Attributes

uint32 _type
 
GuiObject_boss
 
Widget_next
 
bool _hasFocus
 
ThemeEngine::WidgetStateInfo _state
 
Common::U32String _tooltip
 
- Protected Attributes inherited from GUI::GuiObject
Common::Rect _textDrawableArea
 
int16 _x
 
int16 _y
 
uint16 _w
 
uint16 _h
 
bool _useRTL
 
const Common::String _name
 
Widget_firstWidget
 

Member Function Documentation

◆ getMinSize()

virtual void GUI::Widget::getMinSize ( int &  minWidth,
int &  minHeight 
)
inlinevirtual

Returns the minimal size the widget needs to have for its contents to fit

Reimplemented in GUI::DropdownButtonWidget, and GUI::ButtonWidget.

◆ markAsDirty()

virtual void GUI::Widget::markAsDirty ( )
virtual

Mark the widget and its children as dirty so they are redrawn on the next screen update

Reimplemented in GUI::TabWidget, GUI::RichTextWidget, and GUI::ScrollContainerWidget.

◆ draw()

virtual void GUI::Widget::draw ( )
virtual

Redraw the widget if it was marked as dirty, and recursively proceed with its children

Reimplemented in GUI::TabWidget, GUI::RichTextWidget, and GUI::ScrollContainerWidget.


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