summaryrefslogtreecommitdiffstats
path: root/q15/src/mainwindow.cpp
blob: 6b771e7417279f986639853dbe5c65d3b13866d3 (plain)
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
/*
 * $Id: mainwindow.cpp,v 0.1 2005/08/14 11:25:03 denis Exp $
 *
 * Author: Denis Kozadaev ([email protected])
 * 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"