You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
54 lines
1.1 KiB
/*
|
|
* $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:
|
|
*/
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include <tdeactionclasses.h>
|
|
#include <tdemenubar.h>
|
|
|
|
#include <kiconloader.h>
|
|
|
|
|
|
MainWindow::MainWindow(TQWidget* parent, const char* name) : TDEMainWindow(parent, name)
|
|
{
|
|
TDEAction* actionQuit = KStdAction::quit(this, SLOT(close()), 0);
|
|
TDEAction* actionNew = new TDEAction( "&New Game", "reload", TQt::CTRL + TQt::Key_N, this, SLOT(newGame()), this, "New Game");
|
|
|
|
mMenu = new TDEPopupMenu(this);
|
|
mMenu->insertItem(SmallIcon("images_display"), "Load an image", this, SLOT(loadImage()), TQt::CTRL + TQt::Key_L);
|
|
mMenu->insertSeparator();
|
|
|
|
actionNew->plug(mMenu);
|
|
actionQuit->plug(mMenu);
|
|
menuBar()->insertItem(tr("Menu"), mMenu);
|
|
|
|
mBoard = new GameBoard(this);
|
|
setCentralWidget(mBoard);
|
|
}
|
|
|
|
MainWindow::~MainWindow()
|
|
{
|
|
delete mBoard;
|
|
delete mMenu;
|
|
}
|
|
|
|
void MainWindow::newGame()
|
|
{
|
|
mBoard->newGame();
|
|
}
|
|
|
|
void MainWindow::loadImage()
|
|
{
|
|
mBoard->loadImage();
|
|
}
|
|
|
|
#include "mainwindow.moc"
|