summaryrefslogtreecommitdiff
path: root/src/gui/button.cpp
diff options
context:
space:
mode:
authorJoshua Langley <joshlangley[at]optusnet.com.au>2007-07-16 15:23:34 +0000
committerJoshua Langley <joshlangley[at]optusnet.com.au>2007-07-16 15:23:34 +0000
commit71532a23200b246f63ed1e0dc3d563bd1184b593 (patch)
tree2ce28dd04573bb40b31e367d7d980b32f113edab /src/gui/button.cpp
parentbb5f430e6f7e1471aefc1de22e423e6015d0236c (diff)
downloadmana-client-71532a23200b246f63ed1e0dc3d563bd1184b593.tar.gz
mana-client-71532a23200b246f63ed1e0dc3d563bd1184b593.tar.bz2
mana-client-71532a23200b246f63ed1e0dc3d563bd1184b593.tar.xz
mana-client-71532a23200b246f63ed1e0dc3d563bd1184b593.zip
Diffstat (limited to 'src/gui/button.cpp')
-rw-r--r--src/gui/button.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/button.cpp b/src/gui/button.cpp
index e607b66a..a9212e83 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -37,11 +37,26 @@
ImageRect Button::button[4];
int Button::mInstances = 0;
+Button::Button():
+ mIsLogged(false)
+{
+ init();
+}
+
Button::Button(const std::string& caption, const std::string &actionEventId,
gcn::ActionListener *listener):
gcn::Button(caption),
mIsLogged(false)
{
+ init();
+ setActionEventId(actionEventId);
+ if (listener) {
+ addActionListener(listener);
+ }
+}
+
+void Button::init()
+{
setBorderSize(0);
if (mInstances == 0)
@@ -72,12 +87,7 @@ Button::Button(const std::string& caption, const std::string &actionEventId,
btn[mode]->decRef();
}
}
-
mInstances++;
- setActionEventId(actionEventId);
- if (listener) {
- addActionListener(listener);
- }
}
Button::~Button()