sizer->Add (_search, 0, wxBOTTOM, DCPOMATIC_SIZER_GAP);
auto targets = new wxBoxSizer (wxHORIZONTAL);
- _targets = new wxTreeCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT | wxTR_MULTIPLE | wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT);
+ _targets = new TreeCtrl (this);
targets->Add (_targets, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_GAP);
add_cinemas ();
_ignore_selection_change = false;
}
+
+
+wxIMPLEMENT_DYNAMIC_CLASS (TreeCtrl, wxTreeCtrl);
+
+
+int
+TreeCtrl::OnCompareItems (wxTreeItemId const& a, wxTreeItemId const& b)
+{
+ return strcoll (wx_to_std(GetItemText(a)).c_str(), wx_to_std(GetItemText(b)).c_str());
+}
+
class Screen;
}
+
class Cinema;
+
+/** Shim around wxTreeCtrl so we can use strcoll() to compare things */
+class TreeCtrl : public wxTreeCtrl
+{
+public:
+ wxDECLARE_DYNAMIC_CLASS (TreeCtrl);
+
+ TreeCtrl () {}
+
+ TreeCtrl (wxWindow* parent)
+ : wxTreeCtrl (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HIDE_ROOT | wxTR_MULTIPLE | wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT)
+ {}
+
+ virtual ~TreeCtrl () {}
+
+private:
+ int OnCompareItems (wxTreeItemId const& a, wxTreeItemId const& b);
+};
+
+
class ScreensPanel : public wxPanel
{
public:
void search_changed ();
wxSearchCtrl* _search;
- wxTreeCtrl* _targets;
+ TreeCtrl* _targets;
wxButton* _add_cinema;
wxButton* _edit_cinema;
wxButton* _remove_cinema;