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