- wxBoxSizer* 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->Add (_targets, 1, wxEXPAND | wxTOP | wxRIGHT, DCPOMATIC_SIZER_GAP);
-
- _root = _targets->AddRoot ("Foo");
-
- list<shared_ptr<Cinema> > c = Config::instance()->cinemas ();
- for (list<shared_ptr<Cinema> >::iterator i = c.begin(); i != c.end(); ++i) {
- add_cinema (*i);
- }
-
- _targets->ExpandAll ();
-
- wxBoxSizer* target_buttons = new wxBoxSizer (wxVERTICAL);
-
- _add_cinema = new wxButton (this, wxID_ANY, _("Add Cinema..."));
- target_buttons->Add (_add_cinema, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _edit_cinema = new wxButton (this, wxID_ANY, _("Edit Cinema..."));
- target_buttons->Add (_edit_cinema, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _remove_cinema = new wxButton (this, wxID_ANY, _("Remove Cinema"));
- target_buttons->Add (_remove_cinema, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
-
- _add_screen = new wxButton (this, wxID_ANY, _("Add Screen..."));
- target_buttons->Add (_add_screen, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _edit_screen = new wxButton (this, wxID_ANY, _("Edit Screen..."));
- target_buttons->Add (_edit_screen, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _remove_screen = new wxButton (this, wxID_ANY, _("Remove Screen"));
- target_buttons->Add (_remove_screen, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
+#ifdef __WXGTK3__
+ int const height = 30;
+#else
+ int const height = -1;
+#endif
+
+ _search = new wxSearchCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, height));
+#ifndef __WXGTK3__
+ /* The cancel button seems to be strangely broken in GTK3; clicking on it twice sometimes works */
+ _search->ShowCancelButton (true);
+#endif
+ sizer->Add (_search, 0, wxBOTTOM, DCPOMATIC_SIZER_GAP);
+
+ auto targets = new wxBoxSizer (wxHORIZONTAL);
+ _targets = new TreeCtrl (this);
+ targets->Add (_targets, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_GAP);
+
+ add_cinemas ();
+
+ auto target_buttons = new wxBoxSizer (wxVERTICAL);
+
+ _add_cinema = new Button (this, _("Add Cinema..."));
+ target_buttons->Add (_add_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _edit_cinema = new Button (this, _("Edit Cinema..."));
+ target_buttons->Add (_edit_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _remove_cinema = new Button (this, _("Remove Cinema"));
+ target_buttons->Add (_remove_cinema, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _add_screen = new Button (this, _("Add Screen..."));
+ target_buttons->Add (_add_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _edit_screen = new Button (this, _("Edit Screen..."));
+ target_buttons->Add (_edit_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
+ _remove_screen = new Button (this, _("Remove Screen"));
+ target_buttons->Add (_remove_screen, 1, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);