Store subtitle language(s) in Film, and allow setup of those
[dcpomatic.git] / src / wx / editable_list.h
index ca58009a4b7059027700b9fde7181380742f26a1..7902d0b79b319c4660b4abb10d20b3e448b6a35c 100644 (file)
 class EditableListColumn
 {
 public:
-       EditableListColumn (std::string name_)
+       EditableListColumn (wxString name_)
                : name (name_)
                , growable (false)
        {}
 
-       EditableListColumn (std::string name_, boost::optional<int> width_, bool growable_)
+       EditableListColumn (wxString name_, boost::optional<int> width_, bool growable_)
                : name (name_)
                , width (width_)
                , growable (growable_)
        {}
 
-       std::string name;
+       wxString name;
        boost::optional<int> width;
        bool growable;
 };
@@ -78,7 +78,7 @@ public:
                SetSizer (_sizer);
 
                long style = wxLC_REPORT | wxLC_SINGLE_SEL;
-               if (title) {
+               if (!title) {
                        style |= wxLC_NO_HEADER;
                }
 
@@ -104,7 +104,7 @@ public:
                BOOST_FOREACH (EditableListColumn i, _columns) {
                        wxListItem ip;
                        ip.SetId (j);
-                       ip.SetText (std_to_wx(i.name));
+                       ip.SetText (i.name);
                        _list->InsertColumn (j, ip);
                        ++j;
                }
@@ -118,13 +118,13 @@ public:
                {
                        wxSizer* s = new wxBoxSizer (wxVERTICAL);
                        _add = new Button (this, _("Add..."));
-                       s->Add (_add, 0, wxTOP | wxBOTTOM, 2);
+                       s->Add (_add, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
                        if (can_edit) {
                                _edit = new Button (this, _("Edit..."));
-                               s->Add (_edit, 0, wxTOP | wxBOTTOM, 2);
+                               s->Add (_edit, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
                        }
                        _remove = new Button (this, _("Remove"));
-                       s->Add (_remove, 0, wxTOP | wxBOTTOM, 2);
+                       s->Add (_remove, 1, wxEXPAND | wxTOP | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
                        _sizer->Add (s, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP);
                }
 
@@ -136,7 +136,11 @@ public:
 
                _list->Bind (wxEVT_COMMAND_LIST_ITEM_SELECTED, boost::bind (&EditableList::selection_changed, this));
                _list->Bind (wxEVT_COMMAND_LIST_ITEM_DESELECTED, boost::bind (&EditableList::selection_changed, this));
+#if BOOST_VERSION >= 106100
+               _list->Bind (wxEVT_SIZE, boost::bind (&EditableList::resized, this, boost::placeholders::_1));
+#else
                _list->Bind (wxEVT_SIZE, boost::bind (&EditableList::resized, this, _1));
+#endif
 
                refresh ();
                selection_changed ();