-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
99 lines (82 loc) · 2.08 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtGui>
#include "tabwidget.h"
#include "choosetoolbutton.h"
// #define ChooseToolButton QToolButton
class MainWindow : public QMainWindow
{
Q_OBJECT
// file
QToolBar *toolFile;
QAction *actNew;
QAction *actOpen;
QAction *actSave;
QAction *actSaveAs;
QAction *actExit;
// edit
QToolBar *toolEdit;
QActionGroup *agEditMode;
QAction *actMoveMode;
QAction *actEditMode;
QAction *actMarkMode;
QAction *actLineMode;
QAction *actLabelMode;
QAction *actTerritoryMode;
ChooseToolButton *tbMove;
QActionGroup *agMove;
QAction *actMoveBlack;
QAction *actMoveWhite;
ChooseToolButton *tbEdit;
QActionGroup *agEdit;
QAction *actEditBlack;
QAction *actEditWhite;
QAction *actEditEmpty;
ChooseToolButton *tbMark;
QActionGroup *agMark;
QAction *actMarkVoid;
QAction *actMarkCircle;
QAction *actMarkCross;
QAction *actMarkSquare;
QAction *actMarkTriangle;
QAction *actMarkSelection;
ChooseToolButton *tbLine;
QActionGroup *agLine;
QAction *actLine;
QAction *actArrow;
// help
QAction *actAbout;
QAction *actAboutQt;
QTabWidget *tabWidget;
void retranslateUi();
virtual void changeEvent(QEvent *);
TabWidget* createTab(QSize s = QSize(19, 19), SgfGame::Rules rules = SgfGame::JapaneseRules);
void setTurn(Color color);
void setEditColor(Color color);
void setMarkup(Markup m);
void setLineStyle(LineStyle s);
void setEditMode(AbstractBoard::BoardEditMode);
void closeEvent(QCloseEvent *);
protected slots:
void setTurnFromGame(Color color);
void setEditMode(QAction *a);
void setMoveTurn(QAction* a);
void setEditPen(QAction* a);
void setMarkPen(QAction* a);
void setLinePen(QAction* a);
void activeTabChanged(int index);
void tabCloseRequested(int index);
public:
QSize sizeHint() const;
inline TabWidget* activeTab() { return qobject_cast<TabWidget*>(tabWidget->currentWidget()); }
explicit MainWindow(QWidget *parent = 0);
signals:
public slots:
void newTab();
void openFile();
void saveFile(TabWidget* tab = 0);
void saveFileAs(TabWidget* tab = 0);
void about();
};
#endif // MAINWINDOW_H