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  void force_work_layer_only(bool force);
15 
16 private:
17  SelectionFilter &selection_filter;
18  ImpBase &imp;
19  Gtk::ListBox *listbox = nullptr;
20 
21  class Type {
22  public:
23  Gtk::ToggleButton *expand_button = nullptr;
24  Gtk::CheckButton *checkbutton = nullptr;
25  std::map<int, Gtk::CheckButton *> layer_buttons;
26  Gtk::CheckButton *other_layer_checkbutton = nullptr;
27  void update();
28  bool get_all_active();
29  bool expanded = false;
30  bool blocked = false;
31  bool work_layer_only_enabled = false;
32  };
33 
34  std::map<ObjectType, Type> checkbuttons;
35  Gtk::Button *reset_button = nullptr;
36  void update();
37  void set_all(bool state);
38  void connect_doubleclick(Gtk::CheckButton *cb);
39  Gtk::CheckButton *add_layer_button(ObjectType type, int layer, int index, bool active = true);
40 
41  Gtk::CheckButton *work_layer_only_cb = nullptr;
42  void update_work_layer_only();
43  bool work_layer_only_before = false;
44  bool work_layer_only = false;
45  std::map<ObjectType, std::set<int>> saved;
46  int work_layer = 0;
47  void update_filter();
48  bool work_layer_only_before_force = false;
49 };
50 } // namespace horizon
Definition: changeable.hpp:5
Definition: imp.hpp:38
Definition: selection_filter_dialog.hpp:8
Definition: selection_filter.hpp:6