summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/tabbedarea.cpp14
-rw-r--r--src/gui/widgets/tabbedarea.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index da6dfb64c..6c2ef5b25 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -428,6 +428,20 @@ void TabbedArea::updateArrowEnableState()
}
}
+Tab *TabbedArea::getTabByIndex(int index) const
+{
+ if (index < 0 || index >= static_cast<int>(mTabs.size()))
+ return 0;
+ return static_cast<Tab*>(mTabs[index].first);
+}
+
+gcn::Widget *TabbedArea::getWidgetByIndex(int index) const
+{
+ if (index < 0 || index >= static_cast<int>(mTabs.size()))
+ return 0;
+ return mTabs[index].second;
+}
+
/*
void TabbedArea::moveLeft(gcn::Tab *tab)
{
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index 00c1aaf23..dccf72357 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -70,6 +70,10 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener
*/
Tab *getTab(const std::string &name) const;
+ Tab *getTabByIndex(int index) const;
+
+ gcn::Widget *getWidgetByIndex(int index) const;
+
/**
* Returns the widget with the tab that has specified caption
*/