Horizon
entity_editor.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "common/common.hpp"
4 #include "editor_interface.hpp"
5 
6 namespace horizon {
7 
8 class EntityEditor : public Gtk::Box, public PoolEditorInterface {
9  friend class GateEditor;
10 
11 public:
12  EntityEditor(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class Entity &e, class IPool &p);
13  static EntityEditor *create(class Entity &e, class IPool &p);
14  void reload() override;
15 
16  virtual ~EntityEditor(){};
17 
18 private:
19  class Entity &entity;
20  Gtk::Entry *name_entry = nullptr;
21  Gtk::Entry *manufacturer_entry = nullptr;
22  Gtk::Entry *prefix_entry = nullptr;
23  class TagEntry *tag_entry = nullptr;
24 
25  Gtk::ListBox *gates_listbox = nullptr;
26  Gtk::ToolButton *refresh_button = nullptr;
27  Gtk::ToolButton *add_button = nullptr;
28  Gtk::ToolButton *delete_button = nullptr;
29 
30  Glib::RefPtr<Gtk::SizeGroup> sg_name;
31  Glib::RefPtr<Gtk::SizeGroup> sg_suffix;
32  Glib::RefPtr<Gtk::SizeGroup> sg_swap_group;
33  Glib::RefPtr<Gtk::SizeGroup> sg_unit;
34 
35  void handle_add();
36  void handle_delete();
37  IPool &pool;
38 
39  void bind_entry(Gtk::Entry *e, std::string &s);
40 };
41 } // namespace horizon
horizon::GateEditor
Definition: entity_editor.cpp:16
horizon::TagEntry
Definition: tag_entry.hpp:9
horizon::Entity
Definition: entity.hpp:14
horizon::EntityEditor
Definition: entity_editor.hpp:8
horizon::IPool
Definition: ipool.hpp:12
horizon::PoolEditorInterface
Definition: editor_interface.hpp:6