summaryrefslogtreecommitdiff
path: root/wx+/toggle_button.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:09 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:24:09 +0200
commit110fc5dee14fc7988f631a158e50d283446aba7a (patch)
tree7c19dfd3bdb8c4636409ec80a38c70499ac006db /wx+/toggle_button.h
parent5.14 (diff)
downloadFreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.gz
FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.tar.bz2
FreeFileSync-110fc5dee14fc7988f631a158e50d283446aba7a.zip
5.15
Diffstat (limited to 'wx+/toggle_button.h')
-rw-r--r--wx+/toggle_button.h34
1 files changed, 9 insertions, 25 deletions
diff --git a/wx+/toggle_button.h b/wx+/toggle_button.h
index 666f291d..548def1d 100644
--- a/wx+/toggle_button.h
+++ b/wx+/toggle_button.h
@@ -28,8 +28,7 @@ public:
void init(const wxBitmap& activeBmp,
const wxBitmap& inactiveBmp,
- const wxString& activeTooltip,
- const wxString& inactiveTooltip = wxString());
+ const wxString& tooltip);
void setActive(bool value);
bool isActive() const { return active; }
@@ -38,11 +37,8 @@ public:
private:
bool active;
- wxBitmap m_activeBmp;
- wxString m_activeTooltip;
-
- wxBitmap m_inactiveBmp;
- wxString m_inactiveTooltip;
+ wxBitmap activeBmp_;
+ wxBitmap inactiveBmp_;
};
@@ -61,15 +57,13 @@ private:
inline
void ToggleButton::init(const wxBitmap& activeBmp,
const wxBitmap& inactiveBmp,
- const wxString& activeTooltip,
- const wxString& inactiveTooltip)
+ const wxString& tooltip)
{
- m_activeBmp = activeBmp;
- m_activeTooltip = activeTooltip;
- m_inactiveBmp = inactiveBmp;
- m_inactiveTooltip = inactiveTooltip.empty() ? activeTooltip : inactiveTooltip;
+ SetToolTip(tooltip);
+
+ activeBmp_ = activeBmp;
+ inactiveBmp_ = inactiveBmp;
- //load resources
setActive(active);
}
@@ -78,17 +72,7 @@ inline
void ToggleButton::setActive(bool value)
{
active = value;
-
- if (active)
- {
- SetBitmapLabel(m_activeBmp);
- SetToolTip(m_activeTooltip);
- }
- else
- {
- SetBitmapLabel(m_inactiveBmp);
- SetToolTip(m_inactiveTooltip);
- }
+ SetBitmapLabel(active ? activeBmp_ : inactiveBmp_);
}
#endif // TOGGLEBUTTON_H_INCLUDED
bgstack15