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