-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
194 lines (130 loc) · 3.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "command.h"
//#include "Dialogs/posdialog.h"
#include "QRecentFilesMenu.h"
#include <QMainWindow>
#include <QLabel>
#include <QCheckBox>
namespace Ui {
class MainWindow;
}
class Command;
class PosDialog;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
int getPenWidth();
Qt::PenStyle getPenStyle();
QColor getPenColor();
QBrush getPenBrush();
QFont getFont();
QFont btnFont(int size);
void showScale(QString s);
void showCoordinate(QString s);
void DraftStatusBar(bool on);
int getPace();
public slots:
void on_Open_triggered();
void on_Save_triggered();
void on_NewView_triggered();
void on_Print_triggered();
void on_tabView_tabCloseRequested(int index);
void on_action_Current_triggered();
void on_action_All_triggered();
void on_action_Exit_triggered();
void on_startBtn_clicked();
void on_action_Open_triggered();
void on_action_New_triggered();
void on_action_Save_triggered();
void on_openBtn_clicked();
void on_Image_triggered();
void addRecentFile(const QString &name);
void on_ColorPicker_clicked();
void on_BrushPicker_clicked();
void on_FontPicker_clicked();
void on_translateAct_triggered();
void on_rotateAct_triggered();
void on_changeStyleAct_triggered();
void on_ResetStyle_clicked();
void on_brushAct_triggered();
void on_zoomIn_triggered();
void on_zoomOut_triggered();
void on_deleteAct_triggered();
void on_infoAct_triggered();
void on_StretchAct_triggered();
void on_action_PDF_triggered();
void on_actionX_triggered();
void on_actionY_triggered();
void SwitchSceneMode();
void showFullView(bool full);
void InitWorkWidgets(bool on);
signals:
void toFont(QFont f);
private slots:
void on_lineAngle_triggered();
void on_fullViewAct_triggered();
void on_zoomInView_triggered();
void on_zoomOutView_triggered();
void on_smartZoomAct_triggered();
void on_areaZoom_triggered();
void on_cutAct_triggered();
void on_copyAct_triggered();
void on_pasteAct_triggered();
void on_insertPix_triggered();
void on_insertWidget_triggered();
void on_SVG_triggered();
void on_Instruction_triggered();
void on_About_triggered();
void on_action_Publish_triggered();
void on_animation_triggered();
void on_ToolBarCmd_triggered();
void on_FloatBarCmd_triggered();
private:
Ui::MainWindow *ui;
QString dirPath,filePath;
QString fullName;
QString ModifiedTime;
QStringList TabNameList;
PosDialog* dlg;
QRecentFilesMenu *recentFilesMenu;
QMenu *ptMenu, *lineMenu, *rectMenu, *ellipseMenu;
QList<QAction*> ptActions;
QList<QAction*> lineActions;
QList<QAction*> rectActions;
QList<QAction*> ellipseActions;
QList<QAction*> textActions;
QList<QAction*> SceneModes;
bool m_modified;
MyView *newView;
int PenWidth;
Qt::PenStyle PenStyle;
QColor PenColor;
QBrush PenBrush;
QFont TextFont;
QLabel* scale, *MousePos;
QPushButton *SceneMode, *Normal, *AreaZoom, *SmartZoom, *Reset, *Empty ;
QCheckBox *CatchMode,*DraftMode;
Command* Cmd;
QToolBar *floatToolBar;
private:
void InitUi();
void CreateActions();
void CreateStatusBar();
void CreateToolWidget(QPushButton* btn);
void CreateToolBar();
void CreateMenus();
void CreateConnects(MyView* view);
void CreateCorner();
void CreateDir();
void ShowSaveBox();
MyView* getCurrentView();
QString getCurrentTabName();
protected:
void contextMenuEvent(QContextMenuEvent *event);
void keyPressEvent(QKeyEvent *event);
};
#endif // MAINWINDOW_H