From 95af8dff734d6931c93d2bb79c73c330eb4aa83a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 1 Mar 2023 01:23:54 +0100 Subject: Add Choice::add() with a client string. --- src/wx/dcpomatic_choice.cc | 12 ++++++++++++ src/wx/dcpomatic_choice.h | 1 + 2 files changed, 13 insertions(+) (limited to 'src') 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 @@ -70,6 +70,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) { 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 get() const; -- cgit v1.2.3