-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain_window.hpp
More file actions
92 lines (77 loc) · 2.82 KB
/
main_window.hpp
File metadata and controls
92 lines (77 loc) · 2.82 KB
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
#ifndef PSTACK_GUI_MAIN_WINDOW_HPP
#define PSTACK_GUI_MAIN_WINDOW_HPP
#include <wx/checkbox.h>
#include <wx/frame.h>
#include <wx/gauge.h>
#include <wx/sizer.h>
#include <wx/spinctrl.h>
#include <wx/string.h>
#include <memory>
#include <optional>
#include <vector>
#include "pstack/calc/stacker_thread.hpp"
#include "pstack/calc/stacker.hpp"
#include "pstack/gui/controls.hpp"
#include "pstack/gui/parts_list.hpp"
#include "pstack/gui/preferences.hpp"
#include "pstack/gui/results_list.hpp"
namespace pstack::gui {
class viewport;
class main_window : public wxFrame {
public:
main_window(const wxString& title);
private:
viewport* _viewport = nullptr;
controls _controls;
preferences _preferences;
calc::stack_settings stack_settings() const;
void stack_settings(const calc::stack_settings&);
calc::sinterbox_settings sinterbox_settings() const;
void sinterbox_settings(const calc::sinterbox_settings&);
void on_select_parts(const std::vector<std::size_t>& indices);
parts_list _parts_list{};
struct _current_part_t {
calc::part* part;
std::size_t index;
};
std::vector<_current_part_t> _current_parts{};
void enable_part_settings(bool enable);
void on_select_results(const std::vector<std::size_t>& indices);
void set_result(std::size_t index);
void unset_result();
results_list _results_list{};
calc::stack_result* _current_result = nullptr;
void on_switch_tab(wxBookCtrlEvent& event);
void on_stacking(wxCommandEvent& event);
void on_stacking_start();
void on_stacking_stop();
void on_stacking_success(calc::stack_result result, std::chrono::system_clock::duration elapsed);
void enable_on_stacking(bool starting);
calc::stacker_thread _stacker_thread;
wxMenuBar* make_menu_bar();
std::vector<wxMenuItem*> _disableable_menu_items;
void try_load_environment();
bool load_project(std::string json_path);
void bind_all_controls();
void on_new(wxCommandEvent& event);
void on_close(wxCloseEvent& event);
void on_open(wxCommandEvent& event);
void on_save(wxCommandEvent& event);
void on_import_part(wxCommandEvent& event);
void on_delete_part(wxCommandEvent& event);
void on_reload_part(wxCommandEvent& event);
void on_export_result(wxCommandEvent& event);
void on_delete_result(wxCommandEvent& event);
void on_sinterbox_result(wxCommandEvent& event);
wxSizer* arrange_all_controls();
wxSizer* arrange_part_buttons();
wxSizer* arrange_result_buttons();
wxSizer* arrange_bottom_section1();
wxSizer* arrange_bottom_section2();
wxNotebook* arrange_tabs();
void arrange_tab_part_settings(wxPanel* panel);
void arrange_tab_stack_settings(wxPanel* panel);
void arrange_tab_results(wxPanel* panel);
};
} // namespace pstack::gui
#endif // PSTACK_GUI_MAIN_WINDOW_HPP