projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
String fix.
[dcpomatic.git]
/
src
/
wx
/
dcpomatic_choice.cc
diff --git
a/src/wx/dcpomatic_choice.cc
b/src/wx/dcpomatic_choice.cc
index 168d76430bfc3822fce2a2685c6980fbf74d6142..b639dd0f912540c5e8e060784970dac16599764a 100644
(file)
--- 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)
{
void
Choice::set(int index)
{
@@
-88,3
+100,15
@@
Choice::get() const
return sel;
}
return sel;
}
+
+optional<wxString>
+Choice::get_data() const
+{
+ auto index = get();
+ if (!index) {
+ return {};
+ }
+
+ return dynamic_cast<wxStringClientData*>(GetClientObject(*index))->GetData();
+}
+