summaryrefslogtreecommitdiff
path: root/src/wx/dcpomatic_choice.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-08-09 02:20:36 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-03 17:02:24 +0200
commit6c5cd3e54f7a63ca89a824944b3c87236815764b (patch)
treee75327860d23ecfdcd2eda47da332ef4e43b285d /src/wx/dcpomatic_choice.cc
parentcc090db73c3ababa4b208711c1a2098f393e8dcd (diff)
Add some convenience methods to the Choice class.
Diffstat (limited to 'src/wx/dcpomatic_choice.cc')
-rw-r--r--src/wx/dcpomatic_choice.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc
index ab7823901..52aaa4fc4 100644
--- a/src/wx/dcpomatic_choice.cc
+++ b/src/wx/dcpomatic_choice.cc
@@ -83,6 +83,13 @@ Choice::add_entry(wxString const& entry, wxString const& data)
void
+Choice::add_entry(wxString const& entry, string const& data)
+{
+ add_entry(entry, std_to_wx(data));
+}
+
+
+void
Choice::set_entries(wxArrayString const& entries)
{
if (GetStrings() == entries) {
@@ -115,6 +122,13 @@ Choice::set_by_data(wxString const& data)
}
+void
+Choice::set_by_data(string const& data)
+{
+ set_by_data(std_to_wx(data));
+}
+
+
optional<int>
Choice::get() const
{
@@ -138,3 +152,10 @@ Choice::get_data() const
return dynamic_cast<wxStringClientData*>(GetClientObject(*index))->GetData();
}
+
+void
+Choice::clear()
+{
+ Clear();
+}
+