Add Choice::get_data().
[dcpomatic.git] / src / wx / dcpomatic_choice.cc
index 168d76430bfc3822fce2a2685c6980fbf74d6142..cf43b13edc2a8ba1e6b0954db64816b80f3a424c 100644 (file)
@@ -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();
+}
+