summaryrefslogtreecommitdiffstats
path: root/views/controls/button
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls/button')
-rw-r--r--views/controls/button/checkbox.cc6
-rw-r--r--views/controls/button/checkbox.h3
-rw-r--r--views/controls/button/native_button.h2
3 files changed, 10 insertions, 1 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc
index c45bd52..9120ace 100644
--- a/views/controls/button/checkbox.cc
+++ b/views/controls/button/checkbox.cc
@@ -165,6 +165,12 @@ void Checkbox::InitBorder() {
// No border, so we do nothing.
}
+void Checkbox::SetLabel(const std::wstring& label) {
+ NativeButton::SetLabel(label);
+ if (!native_wrapper_->UsesNativeLabel())
+ label_->SetText(label);
+}
+
////////////////////////////////////////////////////////////////////////////////
// Checkbox, protected:
diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h
index bae6bde..e138885 100644
--- a/views/controls/button/checkbox.h
+++ b/views/controls/button/checkbox.h
@@ -54,6 +54,9 @@ class Checkbox : public NativeButton {
virtual void WillGainFocus();
virtual void WillLoseFocus();
+ // Overridden from NativeButton:
+ virtual void SetLabel(const std::wstring& label);
+
protected:
virtual std::string GetClassName() const;
diff --git a/views/controls/button/native_button.h b/views/controls/button/native_button.h
index 22dc60a..428d0ad 100644
--- a/views/controls/button/native_button.h
+++ b/views/controls/button/native_button.h
@@ -25,7 +25,7 @@ class NativeButton : public Button {
virtual ~NativeButton();
// Sets/Gets the text to be used as the button's label.
- void SetLabel(const std::wstring& label);
+ virtual void SetLabel(const std::wstring& label);
std::wstring label() const { return label_; }
// Sets the font to be used when displaying the button's label.