Horizon
selection_filter_dialog.hpp
1 #pragma once
2 #include <gtkmm.h>
3 #include "common/common.hpp"
4 #include "util/changeable.hpp"
5 #include <set>
6 namespace horizon {
7 
8 class SelectionFilterDialog : public Gtk::Window, public Changeable {
9 public:
10  SelectionFilterDialog(Gtk::Window *parent, class SelectionFilter &sf, class ImpBase &imp);
11  void update_layers();
12  bool get_filtered();
13  void set_work_layer(int layer);
14 
15 private:
16  SelectionFilter &selection_filter;
17  ImpBase &imp;
18  Gtk::ListBox *listbox = nullptr;
19 
20  class Type {
21  public:
22  Gtk::ToggleButton *expand_button = nullptr;
23  Gtk::CheckButton *checkbutton = nullptr;
24  std::map<int, Gtk::CheckButton *> layer_buttons;
25  Gtk::CheckButton *other_layer_checkbutton = nullptr;
26  void update();
27  bool get_all_active();
28  bool expanded = false;
29  bool blocked = false;
30  };
31 
32  std::map<ObjectType, Type> checkbuttons;
33  Gtk::Button *reset_button = nullptr;
34  void update();
35  void set_all(bool state);
36  void connect_doubleclick(Gtk::CheckButton *cb);
37  Gtk::CheckButton *add_layer_button(ObjectType type, int layer, int index, bool active = true);
38 
39  Gtk::CheckButton *work_layer_only_cb = nullptr;
40  void update_work_layer_only();
41  bool work_layer_only_before = false;
42  bool work_layer_only = false;
43  std::map<ObjectType, std::set<int>> saved;
44  int work_layer = 0;
45  void update_filter();
46 };
47 } // namespace horizon
horizon::SelectionFilter
Definition: selection_filter.hpp:6
horizon::SelectionFilterDialog
Definition: selection_filter_dialog.hpp:8
horizon::Changeable
Definition: changeable.hpp:5
horizon::ImpBase
Definition: imp.hpp:38