summaryrefslogtreecommitdiff
path: root/src/wx/ratio_picker.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-06-21 10:16:00 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-10 23:13:14 +0200
commit09b4dcf460d6fbe69139eca40f1c890ea5f33a5d (patch)
treeb9f5ecb37e62baa21ae24bf671de3b939589d0e7 /src/wx/ratio_picker.h
parent4e244c8a4b34268445123b7d6df54ff303561fa5 (diff)
Extract ratio setup UI to a separate class.
Diffstat (limited to 'src/wx/ratio_picker.h')
-rw-r--r--src/wx/ratio_picker.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/wx/ratio_picker.h b/src/wx/ratio_picker.h
new file mode 100644
index 000000000..93e78ae9f
--- /dev/null
+++ b/src/wx/ratio_picker.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2025 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include <wx/wx.h>
+#include <boost/optional.hpp>
+#include <boost/signals2.hpp>
+
+
+class CheckBox;
+class Choice;
+
+
+class RatioPicker : public wxPanel
+{
+public:
+ RatioPicker(wxWindow* parent, boost::optional<float> ratio);
+
+ CheckBox* enable_checkbox() const {
+ return _enable;
+ }
+
+ void set(boost::optional<float> ratio);
+
+ boost::signals2::signal<void (boost::optional<float>)> Changed;
+
+private:
+ void enable_changed();
+ void preset_changed();
+ void custom_changed();
+
+ void set_preset(boost::optional<float> ratio);
+ void set_custom(boost::optional<float> ratio);
+ void setup_sensitivity();
+
+ CheckBox* _enable;
+ Choice* _preset;
+ wxTextCtrl* _custom;
+
+ bool _ignore_changes = false;
+};