+ void refresh ()
+ {
+ _list->DeleteAllItems ();
+
+ std::vector<T> current = _get ();
+ for (typename std::vector<T>::iterator i = current.begin (); i != current.end(); ++i) {
+ add_to_control (*i);
+ }
+ }
+
+ boost::optional<T> selection () const
+ {
+ int item = _list->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ if (item == -1) {
+ return boost::optional<T> ();
+ }
+
+ std::vector<T> all = _get ();
+ DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
+ return all[item];
+ }
+
+ void layout ()
+ {
+ _sizer->Layout ();
+ }
+
+ boost::signals2::signal<void ()> SelectionChanged;
+
+private:
+
+ void add_to_control (T item)