From 7bc591abc86ed4742f21f45ca1d6151cb14bc100 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 19 Mar 2022 22:34:00 +0100 Subject: Add config option for default KDM type. --- src/wx/kdm_choice.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/wx/kdm_choice.cc') diff --git a/src/wx/kdm_choice.cc b/src/wx/kdm_choice.cc index 64a43f765..c8685e22c 100644 --- a/src/wx/kdm_choice.cc +++ b/src/wx/kdm_choice.cc @@ -32,9 +32,31 @@ KDMChoice::KDMChoice (wxWindow* parent) } +dcp::Formulation +KDMChoice::get_formulation (unsigned int n) const +{ + return static_cast(reinterpret_cast(GetClientData(n))); +} + + dcp::Formulation KDMChoice::get () const { - return static_cast(reinterpret_cast(GetClientData(GetSelection()))); + return get_formulation(GetSelection()); +} + + +void +KDMChoice::set (dcp::Formulation type) +{ + for (unsigned int i = 0; i < GetCount(); ++i) { + if (get_formulation(i) == type) { + SetSelection(i); + return; + } + } } + + + -- cgit v1.2.3