diff options
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() |