}
+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
{
void add(wxString const& entry, wxString const& data);
void add(std::string const& entry);
void set(int index);
+ void set_by_data(wxString const& data);
boost::optional<int> get() const;
boost::optional<wxString> get_data() const;