diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/dcpomatic_choice.cc | 12 | ||||
| -rw-r--r-- | src/wx/dcpomatic_choice.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc index cf43b13ed..b639dd0f9 100644 --- a/src/wx/dcpomatic_choice.cc +++ b/src/wx/dcpomatic_choice.cc @@ -71,6 +71,18 @@ Choice::add(wxString const& entry, wxClientData* data) void +Choice::add(wxString const& entry, wxString const& data) +{ + if (_needs_clearing) { + Clear(); + _needs_clearing = false; + } + + Append(entry, new wxStringClientData(data)); +} + + +void Choice::set(int index) { SetSelection(index); diff --git a/src/wx/dcpomatic_choice.h b/src/wx/dcpomatic_choice.h index 7c1fadcc0..33d655ad5 100644 --- a/src/wx/dcpomatic_choice.h +++ b/src/wx/dcpomatic_choice.h @@ -34,6 +34,7 @@ public: void add(wxString const& entry); void add(wxString const& entry, wxClientData* data); + void add(wxString const& entry, wxString const& data); void add(std::string const& entry); void set(int index); boost::optional<int> get() const; |
