diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-19 22:34:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-19 22:34:23 +0100 |
| commit | 7bc591abc86ed4742f21f45ca1d6151cb14bc100 (patch) | |
| tree | 661f3e1c78e80be366f0caad720f10e835a9f573 /src/wx/kdm_choice.cc | |
| parent | c7d1f6e7988888811fdac36c465919f170a06c7a (diff) | |
Add config option for default KDM type.
Diffstat (limited to 'src/wx/kdm_choice.cc')
| -rw-r--r-- | src/wx/kdm_choice.cc | 24 |
1 files changed, 23 insertions, 1 deletions
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 @@ -33,8 +33,30 @@ KDMChoice::KDMChoice (wxWindow* parent) dcp::Formulation +KDMChoice::get_formulation (unsigned int n) const +{ + return static_cast<dcp::Formulation>(reinterpret_cast<intptr_t>(GetClientData(n))); +} + + +dcp::Formulation KDMChoice::get () const { - return static_cast<dcp::Formulation>(reinterpret_cast<intptr_t>(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; + } + } } + + + |
