summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-08 10:30:08 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-08 10:45:38 +0200
commitd90dffbf4240650cf95f3dddf2273cb92d0cc39d (patch)
treea8f2fa7b464ce355299689412da7eb2f6b3b16bd
parenta16629925147248c01ee7d967c38fdeb65d55def (diff)
downloadmana-client-d90dffbf4240650cf95f3dddf2273cb92d0cc39d.tar.gz
mana-client-d90dffbf4240650cf95f3dddf2273cb92d0cc39d.tar.bz2
mana-client-d90dffbf4240650cf95f3dddf2273cb92d0cc39d.tar.xz
mana-client-d90dffbf4240650cf95f3dddf2273cb92d0cc39d.zip
Got rid of the non-functional TextFieldListener
Pointed out by Jaxad0127. We might want to enable its intended functionality in a different way later.
-rw-r--r--src/gui/setup_colors.cpp7
-rw-r--r--src/gui/setup_colors.h8
-rw-r--r--src/gui/widgets/textfield.cpp3
-rw-r--r--src/gui/widgets/textfield.h25
4 files changed, 13 insertions, 30 deletions
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 352338e9..86184eab 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -31,6 +31,7 @@
#include "gui/widgets/listbox.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/slider.h"
+#include "gui/widgets/textfield.h"
#include "gui/widgets/textpreview.h"
#include "configuration.h"
@@ -96,7 +97,6 @@ Setup_Colors::Setup_Colors() :
mGradDelayText->setWidth(40);
mGradDelayText->setRange(20, 100);
mGradDelayText->setNumeric(true);
- mGradDelayText->addListener(this);
mGradDelayText->setEnabled(false);
mGradDelaySlider = new Slider(20, 100);
@@ -112,7 +112,6 @@ Setup_Colors::Setup_Colors() :
mRedText->setWidth(40);
mRedText->setRange(0, 255);
mRedText->setNumeric(true);
- mRedText->addListener(this);
mRedText->setEnabled(false);
mRedSlider = new Slider(0, 255);
@@ -128,7 +127,6 @@ Setup_Colors::Setup_Colors() :
mGreenText->setWidth(40);
mGreenText->setRange(0, 255);
mGreenText->setNumeric(true);
- mGreenText->addListener(this);
mGreenText->setEnabled(false);
mGreenSlider = new Slider(0, 255);
@@ -144,7 +142,6 @@ Setup_Colors::Setup_Colors() :
mBlueText->setWidth(40);
mBlueText->setRange(0, 255);
mBlueText->setNumeric(true);
- mBlueText->addListener(this);
mBlueText->setEnabled(false);
mBlueSlider = new Slider(0, 255);
@@ -407,6 +404,7 @@ void Setup_Colors::cancel()
setEntry(mBlueSlider, mBlueText, col->b);
}
+#if 0
void Setup_Colors::listen(const TextField *tf)
{
if (tf == mGradDelayText)
@@ -420,6 +418,7 @@ void Setup_Colors::listen(const TextField *tf)
updateColor();
}
+#endif
void Setup_Colors::updateGradType()
{
diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h
index 10a3437c..75c4c07c 100644
--- a/src/gui/setup_colors.h
+++ b/src/gui/setup_colors.h
@@ -24,8 +24,6 @@
#include "gui/setuptab.h"
-#include "gui/widgets/textfield.h"
-
#include "guichanfwd.h"
#include <guichan/actionlistener.hpp>
@@ -33,10 +31,10 @@
#include <string>
class BrowserBox;
+class TextField;
class TextPreview;
-class Setup_Colors : public SetupTab, public gcn::ActionListener,
- public TextFieldListener
+class Setup_Colors : public SetupTab, public gcn::ActionListener
{
public:
Setup_Colors();
@@ -46,8 +44,6 @@ class Setup_Colors : public SetupTab, public gcn::ActionListener,
void cancel();
void action(const gcn::ActionEvent &event);
- void listen(const TextField *tf);
-
private:
static const std::string rawmsg;
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index d830f8d4..75144658 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -42,8 +42,7 @@ ImageRect TextField::skin;
TextField::TextField(const std::string &text):
gcn::TextField(text),
- mNumeric(false),
- mListener(0)
+ mNumeric(false)
{
setFrameSize(2);
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index 070d86ae..30ff2338 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -27,12 +27,6 @@
class ImageRect;
class TextField;
-class TextFieldListener
-{
- public:
- virtual void listen(const TextField *value) = 0;
-};
-
/**
* A text field.
*
@@ -46,9 +40,6 @@ class TextField : public gcn::TextField
*/
TextField(const std::string &text = "");
- /**
- * Destructor.
- */
~TextField();
/**
@@ -69,7 +60,11 @@ class TextField : public gcn::TextField
/**
* Set the range on the field if it is numeric
*/
- void setRange(int min, int max) {mMinimum = min; mMaximum = max; }
+ void setRange(int min, int max)
+ {
+ mMinimum = min;
+ mMaximum = max;
+ }
/**
* Processes one keypress.
@@ -79,23 +74,18 @@ class TextField : public gcn::TextField
/**
* Set the minimum value for a range
*/
- void setMinimum(int min) {mMinimum = min; }
+ void setMinimum(int min) { mMinimum = min; }
/**
* Set the maximum value for a range
*/
- void setMaximum(int max) {mMaximum = max; }
+ void setMaximum(int max) { mMaximum = max; }
/**
* Return the value for a numeric field
*/
int getValue() const;
- /**
- * Add a listener
- */
- void addListener(TextFieldListener *listener) {mListener = listener; }
-
private:
static int instances;
static float mAlpha;
@@ -103,7 +93,6 @@ class TextField : public gcn::TextField
bool mNumeric;
int mMinimum;
int mMaximum;
- TextFieldListener *mListener;
};
#endif