-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.h
117 lines (91 loc) · 2.2 KB
/
gui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#ifndef GUI_H
#define GUI_H
#include <gtkmm.h>
struct WP {
double XMIN;
double XMAX;
double YMIN;
double YMAX;
int HEIGHT;
double ASP;
};
void set_sim_ptr();
class MyArea : public Gtk::DrawingArea{
public:
MyArea();
virtual ~MyArea();
void clear();
void draw();
void setWParam(WP x);
void refresh();
protected:
bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
void largerRatio(double new_aspect_ratio);
void smallerRatio(double new_aspect_ratio);
void draw_frame(const Cairo::RefPtr<Cairo::Context>& cr);
private:
bool empty;
WP prm_area_ref;
WP prm_area;
};
class Model_columns : public Gtk::TreeModel::ColumnRecord{
public:
Model_columns(){
add(_col_id);
add(_col_nbP);
add(_col_nbF);
add(_col_nbT);
add(_col_nbC);
add(_col_resource);
add(_col_resource_percentage);
}
Gtk::TreeModelColumn<int> _col_id;
Gtk::TreeModelColumn<int> _col_nbP;
Gtk::TreeModelColumn<int> _col_nbF;
Gtk::TreeModelColumn<int> _col_nbT;
Gtk::TreeModelColumn<int> _col_nbC;
Gtk::TreeModelColumn<double> _col_resource;
Gtk::TreeModelColumn<int> _col_resource_percentage;
};
class Gui : public Gtk::Window{
public:
Gui();
virtual ~Gui();
void packBoxes();
void createTreeView();
void assignButtons();
void tree_view_update();
protected:
Gtk::Box m_Box_Big;
Gtk::Box m_Box_High, m_Box_Low, m_Box_Left;
Gtk::Box m_Box_General, m_Box_Toggle, m_Box_Area;
Gtk::Separator m_Separator_G;
Gtk::Separator m_Separator_T;
Gtk::Label m_Label_General;
Gtk::Label m_Label_Toggle;
Gtk::Button m_Button_Exit;
Gtk::Button m_Button_Open;
Gtk::Button m_Button_Save;
Gtk::Button m_Button_Start;
Gtk::Button m_Button_Step;
Gtk::Button m_Button_Tog_Link;
Gtk::Button m_Button_Tog_Range;
MyArea m_Area;
bool on_idle();
bool on_key_press_event(GdkEventKey * key_event);
void on_button_clicked_Exit();
void on_button_clicked_Open();
void on_button_clicked_Save();
void on_button_clicked_Start();
void on_button_clicked_Step();
void on_button_clicked_Tog_Link();
void on_button_clicked_Tog_Range();
private:
bool started;
bool step;
Model_columns _columns;
Gtk::ScrolledWindow _scrolled_window;
Gtk::TreeView _tree_view;
unsigned count;
};
#endif