summaryrefslogtreecommitdiff
path: root/src/wx/dcpomatic_choice.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-01 01:23:44 +0100
committerCarl Hetherington <cth@carlh.net>2023-03-03 01:27:53 +0100
commit2f518094d7db4e8586eba9c741289735794c572c (patch)
treeb53aaa64dc8d6f36d12fe748b2a7a7e41a788161 /src/wx/dcpomatic_choice.cc
parent1695ad102d21c601592e8895d8b402ceebf4f1b0 (diff)
Add Choice::get_data().
Diffstat (limited to 'src/wx/dcpomatic_choice.cc')
-rw-r--r--src/wx/dcpomatic_choice.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc
index 168d76430..cf43b13ed 100644
--- a/src/wx/dcpomatic_choice.cc
+++ b/src/wx/dcpomatic_choice.cc
@@ -88,3 +88,15 @@ Choice::get() const
return sel;
}
+
+optional<wxString>
+Choice::get_data() const
+{
+ auto index = get();
+ if (!index) {
+ return {};
+ }
+
+ return dynamic_cast<wxStringClientData*>(GetClientObject(*index))->GetData();
+}
+