24#include <guichan/widget.hpp>
25#include <guichan/widgetlistener.hpp>
26#include <guichan/widgets/container.hpp>
27#include <guichan/widgets/tabbedarea.hpp>
39class TabbedArea final :
public gcn::TabbedArea,
public gcn::WidgetListener
59 Tab *
getTab(
const std::string &name)
const;
64 gcn::Widget *
getWidget(
const std::string &name)
const;
77 void addTab(gcn::Tab* tab, gcn::Widget* widget)
override;
86 void addTab(
const std::string &caption, gcn::Widget *widget)
override;
96 void logic()
override;
99 {
return mWidgetContainer->getHeight(); }
102 { gcn::TabbedArea::setSelectedTab(index); }
110 void action(
const gcn::ActionEvent& actionEvent)
override;
114 void mousePressed(gcn::MouseEvent &mouseEvent)
override;
A tab, the same as the Guichan tab in 0.8, but extended to allow transparency.
A tabbed area, the same as the guichan tabbed area in 0.8, but extended.
void draw(gcn::Graphics *graphics) override
Draw the tabbed area.
void updateVisibleTabsWidth()
Update the overall width of visible tab.
int mVisibleTabsWidth
The overall width of visible tab.
void action(const gcn::ActionEvent &actionEvent) override
void logic() override
Override the logic function since it's broken in guichan 0.8.
int getContainerHeight() const
void widgetResized(const gcn::Event &event) override
void addTab(gcn::Tab *tab, gcn::Widget *widget) override
Add a tab.
int mTabsWidth
The overall width of all tab.
void mousePressed(gcn::MouseEvent &mouseEvent) override
gcn::Widget * getCurrentWidget()
Returns the widget for the current tab.
void removeTab(gcn::Tab *tab) override
Override the remove tab function as it's broken in guichan 0.8.
void updateTabsWidth()
Update the overall width of all tab.
void setSelectedTab(unsigned int index) override
Tab * getTab(const std::string &name) const
Return tab with specified name as caption.
void adjustTabPositions()
int getNumberOfTabs() const
Return how many tabs have been created.
gcn::Widget * getWidget(const std::string &name) const
Returns the widget with the tab that has specified caption.
void updateArrowEnableState()
Check whether the arrow should be clickable.
std::unique_ptr< Button > mArrowButton[2]
The tab arrows.
unsigned mTabScrollIndex
The tab scroll index.