-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
128 lines (102 loc) · 2.79 KB
/
mainwindow.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
118
119
120
121
122
123
124
125
126
127
128
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QAction>
#include <QActionGroup>
#include <QMenu>
#include <QMenuBar>
#include <QStatusBar>
#include <QToolBar>
#include <QVBoxLayout>
#include "viewer.h"
#include "scene.h"
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void spiritsNumChanged(int);
void scenePaused();
void sceneResumed();
void sceneSpeedLevel(int level);
private:
// tool actions
QAction *actionCursor;
QAction *actionEraser;
QAction *actionBlock;
QAction *actionCheese;
QAction *actionNail;
QAction *actionBomb;
QAction *actionMouse;
QAction *actionCat;
QAction *actionElephant;
QActionGroup *toolGroup;
// control actions
QAction *actionPause_Resume;
QAction *actionSpeedUp;
QAction *actionSpeedDown;
// menubar, toolbar, statusbar
QMenuBar *menuBar;
QMenu *menuScene;
QAction *actionNew;
QAction *actionOpen;
QMenu *menuDemo;
enum { MaxDemoScenes = 10};
QAction *demoSceneActs[MaxDemoScenes];
QAction *actionSave;
QAction *actionSave_as;
QAction *actionQuit;
QMenu *menuOptions;
QAction *actionConfigure;
QMenu *menuTools;
QAction *actionGenRand;
QMenu *menuHelp;
QAction *actionHelp_App;
QAction *actionAbout_App;
QAction *actionAbout_GAMCS;
QToolBar *toolBar;
QStatusBar *statusBar;
// viewer and scene
QVBoxLayout *verticalLayout;
QWidget *centralWidget;
Viewer *viewer;
Scene *scene;
void initUi();
protected:
virtual void closeEvent(QCloseEvent *e);
private slots:
void on_actionCursor_triggered();
void on_actionEraser_triggered();
void on_actionBlock_triggered();
void on_actionCheese_triggered();
void on_actionNail_triggered();
void on_actionBomb_triggered();
void on_actionMouse_triggered();
void on_actionCat_triggered();
void on_actionElephant_triggered();
void on_actionPause_Resume_toggled(bool arg1);
void on_actionSpeedUp_triggered();
void on_actionSpeedDown_triggered();
void on_actionNew_triggered();
void on_actionOpen_triggered();
void on_actionSave_triggered();
void on_actionSave_as_triggered();
void on_actionQuit_triggered();
void on_actionGenRand_triggered();
void on_actionConfigure_triggered();
void on_actionHelp_App_triggered();
void on_actionAbout_App_triggered();
void on_actionAbout_GAMCS_triggered();
void openDemoScene();
private:
QString filename;
bool confirmClose();
void openScene(const QString &file);
void saveScene(const QString &file);
void setCurrentFileName(const QString &file);
void updateDemoSceneActions();
};
#endif // MAINWINDOW_H