diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-19 20:43:10 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2006-03-19 20:43:10 +0000 |
commit | 654d24e74c56d240b8d622840c135e22a029636d (patch) | |
tree | 5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/tabbedcontainer.cpp | |
parent | 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff) | |
download | mana-654d24e74c56d240b8d622840c135e22a029636d.tar.gz mana-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2 mana-654d24e74c56d240b8d622840c135e22a029636d.tar.xz mana-654d24e74c56d240b8d622840c135e22a029636d.zip |
Unreverted latest change by Doener due to my lack of proper communication abilities.
Diffstat (limited to 'src/gui/tabbedcontainer.cpp')
-rw-r--r-- | src/gui/tabbedcontainer.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gui/tabbedcontainer.cpp b/src/gui/tabbedcontainer.cpp index f19524e1..f1927c6f 100644 --- a/src/gui/tabbedcontainer.cpp +++ b/src/gui/tabbedcontainer.cpp @@ -23,10 +23,10 @@ #include "tabbedcontainer.h" -#include <sstream> - #include "button.h" +#include "../utils/tostring.h" + #define TABWIDTH 60 #define TABHEIGHT 20 @@ -48,12 +48,9 @@ TabbedContainer::~TabbedContainer() void TabbedContainer::addTab(gcn::Widget *widget, const std::string &caption) { - std::stringstream ss; int tabNumber = mTabs.size(); - ss << tabNumber; - - Button *tab = new Button(caption, ss.str(), this); + Button *tab = new Button(caption, toString(tabNumber), this); tab->setSize(TABWIDTH, TABHEIGHT); add(tab, TABWIDTH * tabNumber, 0); @@ -83,14 +80,12 @@ void TabbedContainer::logic() void TabbedContainer::action(const std::string &event) { + std::stringstream ss(event); int tabNo; - std::stringstream ss; - gcn::Widget *newContent; - - ss << event; ss >> tabNo; - if ((newContent = mContents[tabNo])) { + gcn::Widget *newContent = mContents[tabNo]; + if (newContent) { if (mActiveContent) { remove(mActiveContent); } |