diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 15 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 6 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 6ba27622..20c100e5 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -56,7 +56,6 @@ void TabbedArea::draw(gcn::Graphics *graphics) return; } - std::vector< std::pair<gcn::Tab*, gcn::Widget*> >::iterator itr; unsigned int i; for (i = 0; i < mTabs.size(); i++) { @@ -71,3 +70,17 @@ void TabbedArea::draw(gcn::Graphics *graphics) gcn::TabbedArea::draw(graphics); } + +gcn::Widget* TabbedArea::getWidget(const std::string &name) +{ + unsigned int i; + for (i = 0; i < mTabs.size(); i++) + { + if (mTabs[i].first->getCaption() == name) + { + return mTabs[i].second; + } + } + + return NULL; +} diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 42275fae..3f58acde 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -24,6 +24,7 @@ #ifndef _TMW_TABBEDAREA_H #define _TMW_TABBEDAREA_H +#include <guichan/widget.hpp> #include <guichan/widgets/tab.hpp> #include <guichan/widgets/tabbedarea.hpp> @@ -54,6 +55,11 @@ class TabbedArea : public gcn::TabbedArea * Return tab with specified name as caption */ gcn::Tab* getTab(const std::string &name); + + /** + * Return selected tab's widget + */ + gcn::Widget* getWidget(const std::string &name); }; #endif |