Add get() and bind() to CheckBox.
authorCarl Hetherington <cth@carlh.net>
Tue, 1 Nov 2022 19:57:55 +0000 (20:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 2 Nov 2022 00:16:45 +0000 (01:16 +0100)
src/wx/check_box.cc
src/wx/check_box.h

index 710ba6334ff15483b11f6491ff3630b573904c69..baec651c1b8ca58e18ee8c07e10e79958c374571 100644 (file)
@@ -45,3 +45,11 @@ CheckBox::get_text () const
 {
        return GetLabel ();
 }
+
+
+bool
+CheckBox::get() const
+{
+       return GetValue();
+}
+
index 6e54ef4116b6cb4ca815ee792c60299c263be336..4b3fddb9fdf65fa4f55226c203f740eb2a9dd97b 100644 (file)
@@ -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)...));
+       }
 };