Horizon
unplaced_box.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include <map>
4 #include <set>
5 #include "util/uuid.hpp"
6 
7 namespace horizon {
8 class UnplacedBox : public Gtk::Box {
9 public:
10  UnplacedBox(const std::string &title);
11 
12  void update(const std::map<UUID, std::string> &items);
13  typedef sigc::signal<void, std::set<UUID>> type_signal_place;
14  type_signal_place signal_place()
15  {
16  return s_signal_place;
17  }
18 
19 private:
20  class ListColumns : public Gtk::TreeModelColumnRecord {
21  public:
22  ListColumns()
23  {
24  Gtk::TreeModelColumnRecord::add(text);
25  Gtk::TreeModelColumnRecord::add(uuid);
26  }
27  Gtk::TreeModelColumn<Glib::ustring> text;
28  Gtk::TreeModelColumn<UUID> uuid;
29  };
30  ListColumns list_columns;
31 
32  Gtk::TreeView *view = nullptr;
33  Glib::RefPtr<Gtk::ListStore> store;
34  Gtk::ToolButton *button_place = nullptr;
35 
36  type_signal_place s_signal_place;
37  void row_activated(const Gtk::TreeModel::Path &path, Gtk::TreeViewColumn *column);
38 };
39 } // namespace horizon
horizon::UnplacedBox
Definition: unplaced_box.hpp:8