ScummVM
GUI::Widget Class Referenceabstract

#include <widget.h>

Inheritance diagram for GUI::Widget:
Collaboration diagram for GUI::Widget:

Public Member Functions

 Widget (GuiObject *boss, int x, int y, int w, int h, const char *tooltip=0)
 
 Widget (GuiObject *boss, const Common::String &name, const char *tooltip=0)
 
virtual ~Widget ()
 
void init ()
 
void resize (int x, int y, int w, int h)
 
void setNext (Widget *w)
 
Widgetnext ()
 
virtual int16 getAbsX () const
 
virtual int16 getAbsY () const
 
virtual void setPos (int x, int y)
 
virtual void setSize (int w, int h)
 
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)
 
virtual void handleMouseWheel (int x, int y, int direction)
 
virtual bool handleKeyDown (Common::KeyState state)
 
virtual bool handleKeyUp (Common::KeyState state)
 
virtual void handleTickle ()
 
virtual void markAsDirty ()
 Mark the widget and its children as dirty so they are redrawn on the next screen update. More...
 
virtual void draw ()
 Redraw the widget if it was marked as dirty, and recursively proceed with its children. More...
 
void receivedFocus ()
 
void lostFocus ()
 
virtual bool wantsFocus ()
 
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
 
uint8 parseHotkey (const Common::String &label)
 
Common::String cleanupHotkey (const Common::String &label)
 
bool hasTooltip () const
 
const Common::StringgetTooltip () const
 
void setTooltip (const Common::String &tooltip)
 
virtual bool containsWidget (Widget *) const
 
void read (Common::String str)
 
- Public Member Functions inherited from GUI::GuiObject
 GuiObject (int x, int y, int w, int h)
 
 GuiObject (const Common::String &name)
 
 ~GuiObject ()
 
virtual void setTextDrawableArea (const Common::Rect &r)
 
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
 Returns the clipping rect to be used when drawing the children widgets of this object. More...
 

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 ()
 
void handleCommand (CommandSender *sender, uint32 cmd, uint32 data)
 
- Protected Member Functions inherited from GUI::CommandReceiver
virtual ~CommandReceiver ()
 

Protected Attributes

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

Private Attributes

uint16 _flags
 
bool _needsRedraw
 

Friends

class Dialog
 

Detailed Description

Definition at line 96 of file widget.h.

Constructor & Destructor Documentation

◆ Widget() [1/2]

GUI::Widget::Widget ( GuiObject boss,
int  x,
int  y,
int  w,
int  h,
const char *  tooltip = 0 
)

Definition at line 38 of file widget.cpp.

◆ Widget() [2/2]

GUI::Widget::Widget ( GuiObject boss,
const Common::String name,
const char *  tooltip = 0 
)

Definition at line 44 of file widget.cpp.

◆ ~Widget()

GUI::Widget::~Widget ( )
virtual

Definition at line 57 of file widget.cpp.

Member Function Documentation

◆ cleanupHotkey()

Common::String GUI::Widget::cleanupHotkey ( const Common::String label)

Definition at line 251 of file widget.cpp.

◆ clearFlags()

void GUI::Widget::clearFlags ( int  flags)

Definition at line 74 of file widget.cpp.

◆ containsWidget()

virtual bool GUI::Widget::containsWidget ( Widget ) const
inlinevirtual

Reimplemented in GUI::ContainerWidget, GUI::TabWidget, GUI::ListWidget, and GUI::ScrollContainerWidget.

Definition at line 170 of file widget.h.

◆ containsWidgetInChain()

bool GUI::Widget::containsWidgetInChain ( Widget start,
Widget search 
)
static

Definition at line 173 of file widget.cpp.

◆ draw()

void GUI::Widget::draw ( )
virtual

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

Reimplemented in GUI::TabWidget.

Definition at line 101 of file widget.cpp.

◆ drawWidget()

◆ findWidget()

virtual Widget* GUI::Widget::findWidget ( int  x,
int  y 
)
inlineprotectedvirtual

Reimplemented in GUI::ContainerWidget, GUI::TabWidget, GUI::ListWidget, and GUI::ScrollContainerWidget.

Definition at line 182 of file widget.h.

◆ findWidgetInChain() [1/2]

Widget * GUI::Widget::findWidgetInChain ( Widget start,
int  x,
int  y 
)
static

Definition at line 151 of file widget.cpp.

◆ findWidgetInChain() [2/2]

Widget * GUI::Widget::findWidgetInChain ( Widget start,
const char *  name 
)
static

Definition at line 163 of file widget.cpp.

◆ getAbsX()

virtual int16 GUI::Widget::getAbsX ( ) const
inlinevirtual

Reimplemented from GUI::GuiObject.

Definition at line 127 of file widget.h.

◆ getAbsY()

virtual int16 GUI::Widget::getAbsY ( ) const
inlinevirtual

Reimplemented from GUI::GuiObject.

Definition at line 128 of file widget.h.

◆ getFlags()

int GUI::Widget::getFlags ( ) const
inline

Definition at line 155 of file widget.h.

◆ getTooltip()

const Common::String& GUI::Widget::getTooltip ( ) const
inline

Definition at line 167 of file widget.h.

◆ handleCommand()

void GUI::Widget::handleCommand ( CommandSender sender,
uint32  cmd,
uint32  data 
)
inlineprotectedvirtual

Reimplemented from GUI::CommandReceiver.

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

Definition at line 187 of file widget.h.

◆ handleKeyDown()

virtual bool GUI::Widget::handleKeyDown ( Common::KeyState  state)
inlinevirtual

Reimplemented in GUI::ListWidget, GUI::TabWidget, and GUI::EditableWidget.

Definition at line 139 of file widget.h.

◆ handleKeyUp()

virtual bool GUI::Widget::handleKeyUp ( Common::KeyState  state)
inlinevirtual

Reimplemented in GUI::ListWidget.

Definition at line 140 of file widget.h.

◆ handleMouseDown()

virtual void GUI::Widget::handleMouseDown ( int  x,
int  y,
int  button,
int  clickCount 
)
inlinevirtual

◆ handleMouseEntered()

virtual void GUI::Widget::handleMouseEntered ( int  button)
inlinevirtual

◆ handleMouseLeft()

virtual void GUI::Widget::handleMouseLeft ( int  button)
inlinevirtual

◆ handleMouseMoved()

virtual void GUI::Widget::handleMouseMoved ( int  x,
int  y,
int  button 
)
inlinevirtual

Reimplemented in GUI::SliderWidget, GUI::ListWidget, GUI::TabWidget, and GUI::ScrollBarWidget.

Definition at line 137 of file widget.h.

◆ handleMouseUp()

virtual void GUI::Widget::handleMouseUp ( int  x,
int  y,
int  button,
int  clickCount 
)
inlinevirtual

◆ handleMouseWheel()

virtual void GUI::Widget::handleMouseWheel ( int  x,
int  y,
int  direction 
)
inlinevirtual

◆ handleTickle()

virtual void GUI::Widget::handleTickle ( )
inlinevirtual

Reimplemented in GUI::ListWidget, GUI::ScrollBarWidget, and GUI::EditableWidget.

Definition at line 141 of file widget.h.

◆ hasTooltip()

bool GUI::Widget::hasTooltip ( ) const
inline

Definition at line 166 of file widget.h.

◆ init()

void GUI::Widget::init ( void  )

Definition at line 50 of file widget.cpp.

◆ isEnabled()

bool GUI::Widget::isEnabled ( ) const

Definition at line 193 of file widget.cpp.

◆ isVisible()

bool GUI::Widget::isVisible ( ) const
virtual

Implements GUI::GuiObject.

Definition at line 207 of file widget.cpp.

◆ lostFocus()

void GUI::Widget::lostFocus ( )
inline

Definition at line 150 of file widget.h.

◆ lostFocusWidget()

virtual void GUI::Widget::lostFocusWidget ( )
inlineprotectedvirtual

Reimplemented in GUI::ListWidget, and GUI::EditTextWidget.

Definition at line 180 of file widget.h.

◆ markAsDirty()

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.

Definition at line 91 of file widget.cpp.

◆ next()

Widget* GUI::Widget::next ( )
inline

Definition at line 125 of file widget.h.

◆ parseHotkey()

uint8 GUI::Widget::parseHotkey ( const Common::String label)

Definition at line 214 of file widget.cpp.

◆ read()

void GUI::Widget::read ( Common::String  str)

Definition at line 261 of file widget.cpp.

◆ receivedFocus()

void GUI::Widget::receivedFocus ( )
inline

Definition at line 149 of file widget.h.

◆ receivedFocusWidget()

virtual void GUI::Widget::receivedFocusWidget ( )
inlineprotectedvirtual

Reimplemented in GUI::ListWidget, and GUI::EditTextWidget.

Definition at line 179 of file widget.h.

◆ releaseFocus()

void GUI::Widget::releaseFocus ( )
inlineprotectedvirtual

Implements GUI::GuiObject.

Definition at line 184 of file widget.h.

◆ resize()

void GUI::Widget::resize ( int  x,
int  y,
int  w,
int  h 
)

Definition at line 62 of file widget.cpp.

◆ setEnabled()

void GUI::Widget::setEnabled ( bool  e)

Definition at line 182 of file widget.cpp.

◆ setFlags()

void GUI::Widget::setFlags ( int  flags)

Definition at line 69 of file widget.cpp.

◆ setNext()

void GUI::Widget::setNext ( Widget w)
inline

Definition at line 124 of file widget.h.

◆ setPos()

virtual void GUI::Widget::setPos ( int  x,
int  y 
)
inlinevirtual

Definition at line 130 of file widget.h.

◆ setSize()

virtual void GUI::Widget::setSize ( int  w,
int  h 
)
inlinevirtual

Definition at line 131 of file widget.h.

◆ setTooltip()

void GUI::Widget::setTooltip ( const Common::String tooltip)
inline

Definition at line 168 of file widget.h.

◆ setVisible()

void GUI::Widget::setVisible ( bool  e)

Definition at line 200 of file widget.cpp.

◆ updateState()

void GUI::Widget::updateState ( int  oldFlags,
int  newFlags 
)
protected

Definition at line 79 of file widget.cpp.

◆ wantsFocus()

virtual bool GUI::Widget::wantsFocus ( )
inlinevirtual

Reimplemented in GUI::ListWidget, GUI::ScrollBarWidget, and GUI::EditTextWidget.

Definition at line 151 of file widget.h.

Friends And Related Function Documentation

◆ Dialog

friend class Dialog
friend

Definition at line 97 of file widget.h.

Member Data Documentation

◆ _boss

GuiObject* GUI::Widget::_boss
protected

Definition at line 100 of file widget.h.

◆ _flags

uint16 GUI::Widget::_flags
private

Definition at line 108 of file widget.h.

◆ _hasFocus

bool GUI::Widget::_hasFocus
protected

Definition at line 103 of file widget.h.

◆ _id

uint16 GUI::Widget::_id
protected

Definition at line 102 of file widget.h.

◆ _needsRedraw

bool GUI::Widget::_needsRedraw
private

Definition at line 109 of file widget.h.

◆ _next

Widget* GUI::Widget::_next
protected

Definition at line 101 of file widget.h.

◆ _state

ThemeEngine::WidgetStateInfo GUI::Widget::_state
protected

Definition at line 104 of file widget.h.

◆ _tooltip

Common::String GUI::Widget::_tooltip
protected

Definition at line 105 of file widget.h.

◆ _type

uint32 GUI::Widget::_type
protected

Definition at line 99 of file widget.h.


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