-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmainwindow.h
More file actions
74 lines (69 loc) · 1.46 KB
/
mainwindow.h
File metadata and controls
74 lines (69 loc) · 1.46 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSpinBox>
#include <QMessageBox>
#include <QCommonStyle>
#include <QSignalMapper>
#include <QString>
#include <vector>
#include "pushbutton.h"
#include "nonogram.h"
#define MIN_PUZZLE_SIZE 3
#define MAX_PUZZLE_SIZE 30
#define DEFAULT_PUZZLE_SIZE 10
#define UNKNOWN 2
#define DOT 1
#define SOLID 0
class MainWindow : public QMainWindow {
Q_OBJECT
private:
QWidget *window;
QMenuBar *menu;
QMenu *fileMenu;
QMenu *helpMenu;
QAction *exitAction;
QAction *aboutAction;
QAction *helpAction;
QSpinBox *widthBox;
QSpinBox *heightBox;
QVBoxLayout *layout;
QHBoxLayout *top;
QGridLayout *grid;
QCommonStyle *style;
QLabel *widthLabel;
QLabel *heightLabel;
QPushButton *generate;
QPushButton *surrender;
QSignalMapper *mapperLeftButton;
QSignalMapper *mapperRightButton;
vector<PushButton*> puzzle;
vector<QLabel*> xAxis, yAxis;
vector<size_t> **xAxisClue;
vector<size_t> **yAxisClue;
vector<int> status;
int width, height, mouseButton;
bool firstClick, lockAction;
Nonogram *ngram;
void cleanUp();
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void generatePuzzle();
void giveUp();
void solidClicked(int position);
void dotClicked(int position);
void checkSolution();
void quit();
void help();
void about();
};
#endif