summaryrefslogtreecommitdiff
path: root/src/gui/button.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-09-19 17:28:33 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-09-19 17:28:33 +0000
commit1a9320fafb23940d0463e6f384713d0f99fc0c61 (patch)
treed152680dbdc8febf0b5a445ba760255068d72f04 /src/gui/button.cpp
parent2f027ebcf8f0ad78f7edf58af7dda94d89034c85 (diff)
downloadmana-1a9320fafb23940d0463e6f384713d0f99fc0c61.tar.gz
mana-1a9320fafb23940d0463e6f384713d0f99fc0c61.tar.bz2
mana-1a9320fafb23940d0463e6f384713d0f99fc0c61.tar.xz
mana-1a9320fafb23940d0463e6f384713d0f99fc0c61.zip
Merged 0.0 changes from revision 3362 to 3580 to trunk.
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 4e236c33..0379ebc0 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -60,11 +60,26 @@ static ButtonData const data[BUTTON_COUNT] = {
ImageRect Button::button[BUTTON_COUNT];
+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)
@@ -91,12 +106,7 @@ Button::Button(const std::string& caption, const std::string &actionEventId,
btn[mode]->decRef();
}
}
-
mInstances++;
- setActionEventId(actionEventId);
- if (listener) {
- addActionListener(listener);
- }
}
Button::~Button()