summaryrefslogtreecommitdiff
path: root/wx+/toggle_button.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2018-05-09 00:09:55 +0200
committerDaniel Wilhelm <shieldwed@outlook.com>2018-05-09 00:09:55 +0200
commit9b623ea3943165fe7efb5e47a0b5b9452c1599e6 (patch)
treedde40e07e907ac6e0ca9ea32524f2cd4810d4be6 /wx+/toggle_button.h
parent9.7 (diff)
downloadFreeFileSync-9b623ea3943165fe7efb5e47a0b5b9452c1599e6.tar.gz
FreeFileSync-9b623ea3943165fe7efb5e47a0b5b9452c1599e6.tar.bz2
FreeFileSync-9b623ea3943165fe7efb5e47a0b5b9452c1599e6.zip
9.8
Diffstat (limited to 'wx+/toggle_button.h')
-rwxr-xr-xwx+/toggle_button.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/wx+/toggle_button.h b/wx+/toggle_button.h
index 0172881e..f61c3857 100755
--- a/wx+/toggle_button.h
+++ b/wx+/toggle_button.h
@@ -10,6 +10,9 @@
#include <wx/bmpbuttn.h>
#include <wx+/bitmap_button.h>
+
+namespace zen
+{
class ToggleButton : public wxBitmapButton
{
public:
@@ -29,12 +32,11 @@ public:
const wxBitmap& inactiveBmp);
void setActive(bool value);
- bool isActive() const { return active; }
- void toggle() { setActive(!active); }
+ bool isActive() const { return active_; }
+ void toggle() { setActive(!active_); }
private:
- bool active = false;
-
+ bool active_ = false;
wxBitmap activeBmp_;
wxBitmap inactiveBmp_;
};
@@ -53,15 +55,16 @@ void ToggleButton::init(const wxBitmap& activeBmp,
activeBmp_ = activeBmp;
inactiveBmp_ = inactiveBmp;
- setActive(active);
+ setActive(active_);
}
inline
void ToggleButton::setActive(bool value)
{
- active = value;
- zen::setImage(*this, active ? activeBmp_ : inactiveBmp_);
+ active_ = value;
+ setImage(*this, active_ ? activeBmp_ : inactiveBmp_);
+}
}
#endif //TOGGLE_BUTTON_H_8173024810574556
bgstack15