summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-11-01 20:57:55 +0100
committerCarl Hetherington <cth@carlh.net>2022-11-02 01:16:45 +0100
commit98a8b5835aca46d8abb6f59513a56648f2c234ba (patch)
tree88dbd39b319ffac08905d448da556e306ec5ba2a
parent452e4844326048da0f1fdc8dbf623b43cb400798 (diff)
Add get() and bind() to CheckBox.
-rw-r--r--src/wx/check_box.cc8
-rw-r--r--src/wx/check_box.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/wx/check_box.cc b/src/wx/check_box.cc
index 710ba6334..baec651c1 100644
--- a/src/wx/check_box.cc
+++ b/src/wx/check_box.cc
@@ -45,3 +45,11 @@ CheckBox::get_text () const
{
return GetLabel ();
}
+
+
+bool
+CheckBox::get() const
+{
+ return GetValue();
+}
+
diff --git a/src/wx/check_box.h b/src/wx/check_box.h
index 6e54ef411..4b3fddb9f 100644
--- a/src/wx/check_box.h
+++ b/src/wx/check_box.h
@@ -28,6 +28,7 @@
LIBDCP_DISABLE_WARNINGS
#include <wx/wx.h>
LIBDCP_ENABLE_WARNINGS
+#include <boost/bind/bind.hpp>
class CheckBox : public wxCheckBox, public I18NHook
@@ -37,6 +38,12 @@ public:
void set_text (wxString text) override;
wxString get_text () const override;
+ bool get() const;
+
+ template <typename... Args>
+ void bind(Args... args) {
+ Bind(wxEVT_CHECKBOX, boost::bind(std::forward<Args>(args)...));
+ }
};