diff options
Diffstat (limited to 'src/wx/dcpomatic_choice.cc')
| -rw-r--r-- | src/wx/dcpomatic_choice.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc index b639dd0f9..2f1a6f0e9 100644 --- a/src/wx/dcpomatic_choice.cc +++ b/src/wx/dcpomatic_choice.cc @@ -89,6 +89,20 @@ Choice::set(int index) } +void +Choice::set_by_data(wxString const& data) +{ + for (unsigned int i = 0; i < GetCount(); ++i) { + if (auto client_data = dynamic_cast<wxStringClientData*>(GetClientObject(i))) { + if (client_data->GetData() == data) { + set(i); + return; + } + } + } +} + + optional<int> Choice::get() const { |
