diff options
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; + } + } } + + + |
