Mana
|
A tabbed area, the same as the guichan tabbed area in 0.8, but extended. More...
#include <tabbedarea.h>
Public Member Functions | |
TabbedArea () | |
void | draw (gcn::Graphics *graphics) override |
Draw the tabbed area. | |
int | getNumberOfTabs () const |
Return how many tabs have been created. | |
Tab * | getTab (const std::string &name) const |
Return tab with specified name as caption. | |
gcn::Widget * | getWidget (const std::string &name) const |
Returns the widget with the tab that has specified caption. | |
gcn::Widget * | getCurrentWidget () |
Returns the widget for the current tab. | |
void | addTab (gcn::Tab *tab, gcn::Widget *widget) override |
Add a tab. | |
void | addTab (const std::string &caption, gcn::Widget *widget) override |
Add a tab. | |
void | removeTab (gcn::Tab *tab) override |
Override the remove tab function as it's broken in guichan 0.8. | |
void | logic () override |
Override the logic function since it's broken in guichan 0.8. | |
int | getContainerHeight () const |
void | setSelectedTab (unsigned int index) override |
void | setSelectedTab (gcn::Tab *tab) override |
void | widgetResized (const gcn::Event &event) override |
void | adjustTabPositions () |
void | action (const gcn::ActionEvent &actionEvent) override |
void | mousePressed (gcn::MouseEvent &mouseEvent) override |
Private Member Functions | |
void | updateArrowEnableState () |
Check whether the arrow should be clickable. | |
void | updateTabsWidth () |
Update the overall width of all tab. | |
void | updateVisibleTabsWidth () |
Update the overall width of visible tab. | |
Private Attributes | |
std::unique_ptr< Button > | mArrowButton [2] |
The tab arrows. | |
int | mTabsWidth = 0 |
The overall width of all tab. | |
int | mVisibleTabsWidth = 0 |
The overall width of visible tab. | |
unsigned | mTabScrollIndex = 0 |
The tab scroll index. | |
A tabbed area, the same as the guichan tabbed area in 0.8, but extended.
Definition at line 39 of file tabbedarea.h.
TabbedArea::TabbedArea | ( | ) |
Definition at line 30 of file tabbedarea.cpp.
|
override |
Definition at line 260 of file tabbedarea.cpp.
|
override |
Add a tab.
Overridden since it needs to create an instance of Tab instead of gcn::Tab.
caption | The Caption to display |
widget | The widget to show when tab is selected |
Definition at line 106 of file tabbedarea.cpp.
|
override |
Add a tab.
Overridden since it needs to size the widget.
tab | The tab widget for the tab. |
widget | The widget to view when the tab is selected. |
Definition at line 93 of file tabbedarea.cpp.
void TabbedArea::adjustTabPositions | ( | ) |
Definition at line 228 of file tabbedarea.cpp.
|
override |
Draw the tabbed area.
Definition at line 61 of file tabbedarea.cpp.
|
inline |
Definition at line 98 of file tabbedarea.h.
gcn::Widget * TabbedArea::getCurrentWidget | ( | ) |
Returns the widget for the current tab.
Definition at line 85 of file tabbedarea.cpp.
int TabbedArea::getNumberOfTabs | ( | ) | const |
Return how many tabs have been created.
Definition at line 46 of file tabbedarea.cpp.
Tab * TabbedArea::getTab | ( | const std::string & | name | ) | const |
Return tab with specified name as caption.
Definition at line 51 of file tabbedarea.cpp.
gcn::Widget * TabbedArea::getWidget | ( | const std::string & | name | ) | const |
Returns the widget with the tab that has specified caption.
Definition at line 74 of file tabbedarea.cpp.
|
override |
Override the logic function since it's broken in guichan 0.8.
Definition at line 150 of file tabbedarea.cpp.
|
override |
Definition at line 155 of file tabbedarea.cpp.
|
override |
Override the remove tab function as it's broken in guichan 0.8.
Definition at line 115 of file tabbedarea.cpp.
|
override |
Definition at line 173 of file tabbedarea.cpp.
|
inlineoverride |
Definition at line 101 of file tabbedarea.h.
|
private |
Check whether the arrow should be clickable.
Definition at line 286 of file tabbedarea.cpp.
|
private |
Update the overall width of all tab.
Used to know whether the arrows have to be drawn or not.
Definition at line 212 of file tabbedarea.cpp.
|
private |
Update the overall width of visible tab.
Used to know whether the arrows have to be enable or not.
Definition at line 221 of file tabbedarea.cpp.
|
override |
Definition at line 183 of file tabbedarea.cpp.
|
private |
The tab arrows.
Definition at line 118 of file tabbedarea.h.
|
private |
The tab scroll index.
When scrolling with the arrows, the tabs must be displayed according to the current index. So the first tab displayed may not be the first in the list.
Definition at line 152 of file tabbedarea.h.
|
private |
The overall width of all tab.
Definition at line 132 of file tabbedarea.h.
|
private |
The overall width of visible tab.
Definition at line 143 of file tabbedarea.h.