summaryrefslogtreecommitdiff
path: root/src/gui/tabbedcontainer.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
commit654d24e74c56d240b8d622840c135e22a029636d (patch)
tree5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/tabbedcontainer.cpp
parent3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff)
downloadmana-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.cpp17
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);
}