summaryrefslogtreecommitdiff
path: root/src/gui/tabbedcontainer.cpp
diff options
context:
space:
mode:
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);
}