ScummVM API documentation
GUI::TabWidget Class Reference
Inheritance diagram for GUI::TabWidget:
GUI::Widget GUI::GuiObject GUI::CommandReceiver

Public Member Functions

 TabWidget (GuiObject *boss, int x, int y, int w, int h, ThemeEngine::TextAlignVertical alignV=ThemeEngine::kTextAlignVTop)
 
 TabWidget (GuiObject *boss, const Common::String &name, ThemeEngine::TextAlignVertical alignV=ThemeEngine::kTextAlignVTop)
 
void init ()
 
int addTab (const Common::U32String &title, const Common::String &dialogName)
 
void removeTab (int tabID)
 
int getActiveTab ()
 
void setActiveTab (int tabID)
 
void setTabTitle (int tabID, const Common::U32String &title)
 
void handleMouseDown (int x, int y, int button, int clickCount) override
 
void handleMouseMoved (int x, int y, int button) override
 
void handleMouseLeft (int button) override
 
bool handleKeyDown (Common::KeyState state) override
 
void handleMouseWheel (int x, int y, int direction) override
 
void handleCommand (CommandSender *sender, uint32 cmd, uint32 data) override
 
virtual int getFirstVisible () const
 
virtual void setFirstVisible (int tabID, bool adjustIfRoom=false)
 
bool containsWidget (Widget *) const override
 
void reflowLayout () override
 
void draw () override
 
void markAsDirty () override
 
- Public Member Functions inherited from GUI::Widget
 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 handleMouseUp (int x, int y, int button, int clickCount)
 
virtual void handleMouseEntered (int button)
 
virtual bool handleKeyUp (Common::KeyState state)
 
virtual void handleOtherEvent (const Common::Event &evt)
 
virtual void handleTickle ()
 
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)
 
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 uint16 getWidth () const
 
virtual void removeWidget (Widget *widget)
 
virtual bool isPointIn (int x, int y)
 
virtual Common::Rect getClipRect () const
 
virtual void handleTooltipUpdate (int x, int y)
 

Protected Member Functions

void recalc ()
 
int16 getChildY () const override
 
uint16 getHeight () const override
 
void drawWidget () override
 
WidgetfindWidget (int x, int y) override
 
virtual void adjustTabs (int value)
 
virtual void computeLastVisibleTab (bool adjustFirstIfRoom)
 
- Protected Member Functions inherited from GUI::Widget
void updateState (int oldFlags, int newFlags)
 
virtual void receivedFocusWidget ()
 
virtual void lostFocusWidget ()
 
void releaseFocus () override
 

Protected Attributes

int _activeTab
 
int _firstVisibleTab
 
int _lastVisibleTab
 
TabList _tabs
 
int _tabHeight
 
int _minTabWidth
 
int _titleSpacing
 
ThemeEngine::TextAlignVertical _alignV
 
int _bodyRP
 
int _bodyTP
 
int _bodyLP
 
int _bodyBP
 
ThemeEngine::DialogBackground _bodyBackgroundType
 
int _titleVPad
 
int _butRP
 
int _butTP
 
int _butW
 
int _butH
 
ButtonWidget_navLeft
 
ButtonWidget_navRight
 
bool _navButtonsVisible
 
int _lastRead
 
- Protected Attributes inherited from GUI::Widget
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
 

Additional Inherited Members

- Static Public Member Functions inherited from GUI::Widget
static WidgetfindWidgetInChain (Widget *start, int x, int y)
 
static WidgetfindWidgetInChain (Widget *start, const char *name)
 
static bool containsWidgetInChain (Widget *start, Widget *search)
 

Member Function Documentation

◆ addTab()

int GUI::TabWidget::addTab ( const Common::U32String title,
const Common::String dialogName 
)

Add a new tab with the given title. Returns a unique ID which can be used to identify the tab (to remove it / activate it etc.).

◆ removeTab()

void GUI::TabWidget::removeTab ( int  tabID)

Remove the tab with the given tab ID. Disposes all child widgets of that tab. TODO: This code is unfinished. In particular, it changes the tabIDs, so that they are not unique anymore! This is bad. If we need to, we could fix this by changing the tab IDs from being an index into the _tabs array to a real "unique" ID, which gets stored in the Tab struct. It won't be difficult to implement this, but since currently no code seems to make use of the feature...

◆ setActiveTab()

void GUI::TabWidget::setActiveTab ( int  tabID)

Set the active tab by specifying a valid tab ID. setActiveTab changes the value of _firstWidget. This means new Widgets are always added to the active tab.

◆ draw()

void GUI::TabWidget::draw ( )
overridevirtual

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

Reimplemented from GUI::Widget.

◆ markAsDirty()

void GUI::TabWidget::markAsDirty ( )
overridevirtual

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

Reimplemented from GUI::Widget.


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