diff options
author | Joshua Langley <joshlangley[at]optusnet.com.au> | 2007-07-16 15:23:34 +0000 |
---|---|---|
committer | Joshua Langley <joshlangley[at]optusnet.com.au> | 2007-07-16 15:23:34 +0000 |
commit | 71532a23200b246f63ed1e0dc3d563bd1184b593 (patch) | |
tree | 2ce28dd04573bb40b31e367d7d980b32f113edab /src/gui/button.cpp | |
parent | bb5f430e6f7e1471aefc1de22e423e6015d0236c (diff) | |
download | mana-71532a23200b246f63ed1e0dc3d563bd1184b593.tar.gz mana-71532a23200b246f63ed1e0dc3d563bd1184b593.tar.bz2 mana-71532a23200b246f63ed1e0dc3d563bd1184b593.tar.xz mana-71532a23200b246f63ed1e0dc3d563bd1184b593.zip |
Diffstat (limited to 'src/gui/button.cpp')
-rw-r--r-- | src/gui/button.cpp | 20 |
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() |