Horizon
entity_editor.hpp
1#pragma once
2#include <gtkmm.h>
3#include "common/common.hpp"
4#include "editor_interface.hpp"
5#include "util/sort_helper.hpp"
6
7namespace horizon {
8
9class EntityEditor : public Gtk::Box, public PoolEditorInterface {
10 friend class GateEditor;
11
12public:
13 EntityEditor(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class Entity &e, class IPool &p);
14 static EntityEditor *create(class Entity &e, class IPool &p);
15 void reload() override;
16
17 virtual ~EntityEditor(){};
18
19private:
20 class Entity &entity;
21 Gtk::Entry *name_entry = nullptr;
22 Gtk::Entry *manufacturer_entry = nullptr;
23 Gtk::Entry *prefix_entry = nullptr;
24 class TagEntry *tag_entry = nullptr;
25
26 Gtk::ListBox *gates_listbox = 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 sort();
40 SortHelper sort_helper;
41
42 void bind_entry(Gtk::Entry *e, std::string &s);
43};
44} // namespace horizon
Definition: entity_editor.hpp:9
Definition: entity.hpp:13
Definition: entity_editor.cpp:17
Definition: ipool.hpp:14
Definition: editor_interface.hpp:6
Definition: sort_helper.hpp:6
Definition: tag_entry.hpp:9
_t< detail::sort_< L, Fn > > sort
Return a new meta::list that is sorted according to invocable predicate Fn.
Definition: meta.hpp:3277