Horizon
unit_editor.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "common/common.hpp"
4 #include "core/core.hpp"
5 #include "editor_interface.hpp"
6 
7 namespace horizon {
8 
9 class UnitEditor : public Gtk::Box, public PoolEditorInterface {
10  friend class PinEditor;
11 
12 public:
13  UnitEditor(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class Unit *u, class Pool *p);
14  static UnitEditor *create(class Unit *u, class Pool *p);
15 
16  virtual ~UnitEditor(){};
17 
18 private:
19  class Unit *unit = nullptr;
20  Gtk::Entry *name_entry = nullptr;
21  Gtk::Entry *manufacturer_entry = nullptr;
22  Gtk::ListBox *pins_listbox = nullptr;
23  Gtk::ToolButton *refresh_button = nullptr;
24  Gtk::ToolButton *add_button = nullptr;
25  Gtk::ToolButton *delete_button = nullptr;
26 
27  Glib::RefPtr<Gtk::SizeGroup> sg_direction;
28  Glib::RefPtr<Gtk::SizeGroup> sg_name;
29  Glib::RefPtr<Gtk::SizeGroup> sg_swap_group;
30 
31  void handle_add();
32  void handle_delete();
33  void sort();
34  void handle_activate(class PinEditor *ed);
35 
36  Pool *pool;
37 };
38 } // namespace horizon
Definition: editor_interface.hpp:5
A Unit is the template for a Gate inside of an Entity.
Definition: unit.hpp:53
Definition: unit_editor.cpp:11
Definition: unit_editor.hpp:9
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:19
Definition: block.cpp:9