-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
107 lines (78 loc) · 2.01 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "mode.h"
#include "mapview.h"
#include "nodeeditorwidget.h"
#include "pathbehavioreditor.h"
#include "mapobjecteditor.h"
#include "spriteseditor.h"
#include "animationseditor.h"
#include <QMainWindow>
#include <QCoreApplication>
#include <QSettings>
#include <QScrollArea>
#include <QResizeEvent>
#include <QDockWidget>
#include <QComboBox>
#include <QMenu>
namespace Ui {
class MainWindow;
}
class QScrollAreaRE : public QScrollArea
{
Q_OBJECT
public:
QScrollAreaRE() {}
virtual ~QScrollAreaRE() {}
signals:
void resized(QResizeEvent* evt);
protected:
void resizeEvent(QResizeEvent* evt)
{
QScrollArea::resizeEvent(evt);
emit resized(evt);
}
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
QMenu* createPopupMenu() Q_DECL_OVERRIDE;
private slots:
void onLoad();
void on_actionNew_triggered();
void on_actionOpen_triggered();
void on_actionSave_triggered();
void on_actionSaveAs_triggered();
void on_actionGrid_triggered(bool checked);
private slots:
void modeChanged(int modeIndex);
void mapScrollTo(int x, int y);
void mapScrollTo(QPoint p);
void mapScrollTo_(int x, int y);
void on_actionZoomIn_triggered();
void on_actionZoom100_triggered();
void on_actionZoomOut_triggered();
void on_actionMaximumZoom_triggered();
void on_actionMinimumZoom_triggered();
void on_actionExportC_triggered();
private:
Ui::MainWindow *ui;
QSettings* settings;
QComboBox* modeBox;
QList<Mode> modes;
Map* map;
MapView* mapView;
QScrollAreaRE* mapViewArea;
NodeEditorWidget* nodeEditor;
PathBehaviorEditor* pathBehaviorEditor;
MapObjectEditor* mapObjectEditor;
SpritesEditor* spritesEditor;
AnimationsEditor* animationsEditor;
void updateMap(QFile* file=NULL);
void setMapName(QString mapName="Untitled Map");
};
#endif // MAINWINDOW_H