Horizon
unit_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 
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 IPool &p);
14  static UnitEditor *create(class Unit &u, class IPool &p);
15  void select(const ItemSet &items) override;
16 
17  virtual ~UnitEditor(){};
18 
19 private:
20  class Unit &unit;
21  Gtk::Entry *name_entry = nullptr;
22  Gtk::Entry *manufacturer_entry = nullptr;
23  Gtk::ListBox *pins_listbox = nullptr;
24  Gtk::Button *add_button = nullptr;
25  Gtk::Button *delete_button = nullptr;
26  Gtk::CheckButton *cross_probing_cb = nullptr;
27 
28  Glib::RefPtr<Gtk::SizeGroup> sg_direction;
29  Glib::RefPtr<Gtk::SizeGroup> sg_name;
30  Glib::RefPtr<Gtk::SizeGroup> sg_names;
31 
32  void handle_add();
33  void handle_delete();
34  void sort();
35  void handle_activate(class PinEditor *ed);
36 
37  SortHelper sort_helper;
38 
39  IPool &pool;
40 };
41 } // namespace horizon
Definition: ipool.hpp:14
Definition: unit_editor.cpp:15
Definition: editor_interface.hpp:6
Definition: sort_helper.hpp:6
Definition: unit_editor.hpp:9
A Unit is the template for a Gate inside of an Entity.
Definition: unit.hpp:71
_t< detail::sort_< L, Fn > > sort
Return a new meta::list that is sorted according to invocable predicate Fn.
Definition: meta.hpp:3277