summaryrefslogtreecommitdiff
path: root/src/gui/tabbedcontainer.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-19 15:09:27 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-19 15:09:27 +0000
commit3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (patch)
tree5084eaa47d4874a3a573de226f19c4be072e4888 /src/gui/tabbedcontainer.cpp
parent19d5cc3a6bbbd911361b7e8b956840d0189d4c2b (diff)
downloadmana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.gz
mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.bz2
mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.xz
mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.zip
Reverted changeset r2269 (toString) as requested by ElvenProgrammer.
Diffstat (limited to 'src/gui/tabbedcontainer.cpp')
-rw-r--r--src/gui/tabbedcontainer.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui/tabbedcontainer.cpp b/src/gui/tabbedcontainer.cpp
index f1927c6f..f19524e1 100644
--- a/src/gui/tabbedcontainer.cpp
+++ b/src/gui/tabbedcontainer.cpp
@@ -23,9 +23,9 @@
#include "tabbedcontainer.h"
-#include "button.h"
+#include <sstream>
-#include "../utils/tostring.h"
+#include "button.h"
#define TABWIDTH 60
#define TABHEIGHT 20
@@ -48,9 +48,12 @@ TabbedContainer::~TabbedContainer()
void TabbedContainer::addTab(gcn::Widget *widget, const std::string &caption)
{
+ std::stringstream ss;
int tabNumber = mTabs.size();
- Button *tab = new Button(caption, toString(tabNumber), this);
+ ss << tabNumber;
+
+ Button *tab = new Button(caption, ss.str(), this);
tab->setSize(TABWIDTH, TABHEIGHT);
add(tab, TABWIDTH * tabNumber, 0);
@@ -80,12 +83,14 @@ 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;
- gcn::Widget *newContent = mContents[tabNo];
- if (newContent) {
+ if ((newContent = mContents[tabNo])) {
if (mActiveContent) {
remove(mActiveContent);
}