diff options
| author | Denis Kozadaev <denis@dilos.org> | 2020-03-28 14:31:25 +0300 |
|---|---|---|
| committer | gregory guy <gregory-tde@laposte.net> | 2020-12-01 12:20:38 +0100 |
| commit | b4978e97409c609686dc6eb97b150ed2e677ff13 (patch) | |
| tree | cdaa6c2b2860f61df0d8942d8b8c6ea6dca98bb0 /q15/src/mainwindow.cpp | |
| parent | 66bc1814115c78f72920527f7ad1495a8317acac (diff) | |
| download | tdegames-b4978e97409c609686dc6eb97b150ed2e677ff13.tar.gz tdegames-b4978e97409c609686dc6eb97b150ed2e677ff13.zip | |
fifteen puzzle game
Signed-off-by: Denis Kozadaev <denis@dilos.org>
Diffstat (limited to 'q15/src/mainwindow.cpp')
| -rw-r--r-- | q15/src/mainwindow.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/q15/src/mainwindow.cpp b/q15/src/mainwindow.cpp new file mode 100644 index 00000000..6b771e74 --- /dev/null +++ b/q15/src/mainwindow.cpp @@ -0,0 +1,73 @@ +/* + * $Id: mainwindow.cpp,v 0.1 2005/08/14 11:25:03 denis Exp $ + * + * Author: Denis Kozadaev (denis@tambov.ru) + * Description: + * + * See also: style(9) + * + * Hacked by: + */ + +#if QT_VERSION >= 0x040000 +#include <QtGui/QApplication> +#else +#include <ntqapplication.h> +#endif + +#include "mainwindow.h" + +#if QT_VERSION >= 0x040000 +MainWindow::MainWindow(QWidget *parent) + :QMainWindow(parent) +#else +MainWindow::MainWindow(TQWidget *parent, const char *name) + :TQMainWindow(parent, name) +#endif +{ + +#if QT_VERSION >= 0x040000 + file = new QMenu(tr("File"), this); + file->addAction(tr("New"), this, SLOT(newGame()), Qt::CTRL + Qt::Key_N); + file->addAction(tr("Load an image"), this, SLOT(loadImage()), + Qt::CTRL + Qt::Key_L); + file->addAction(tr("Quit"), qApp, SLOT(quit()), Qt::CTRL + Qt::Key_Q); + + menuBar()->addMenu(file); +#else + file = new TQPopupMenu(this); + file->insertItem(tr("New"), this, SLOT(newGame()), TQt::CTRL + TQt::Key_N); + file->insertItem(tr("Load an image"), this, SLOT(loadImage()), + TQt::CTRL + TQt::Key_L); + file->insertItem(tr("Quit"), tqApp, SLOT(quit()), TQt::CTRL + TQt::Key_Q); + + menuBar()->insertItem(tr("File"), file); +#endif + gb = new GameBoard(this); + setCentralWidget(gb); +} + +MainWindow::~MainWindow() +{ + + delete gb; + delete file; +} + + +void +MainWindow::newGame() +{ + + gb->newGame(); +} + + +void +MainWindow::loadImage() +{ + + gb->loadImage(); +} + +#include "mainwindow.moc" |
