From: Carl Hetherington Date: Tue, 1 Nov 2022 19:57:55 +0000 (+0100) Subject: Add get() and bind() to CheckBox. X-Git-Tag: v2.16.33~28 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=98a8b5835aca46d8abb6f59513a56648f2c234ba Add get() and bind() to CheckBox. --- 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 LIBDCP_ENABLE_WARNINGS +#include 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 + void bind(Args... args) { + Bind(wxEVT_CHECKBOX, boost::bind(std::forward(args)...)); + } };