#include "nimform.h" #include "optionsform.h" #include "stapeldisplay.h" #include #include #include #include #include #include NimForm::NimForm( ) : QMainWindow( 0, 0, WDestructiveClose) { QAction *fileNewAction; QAction *fileQuitAction; fileNewAction = new QAction( "New Game", "&New", CTRL+Key_N,this, "new"); connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) ); fileQuitAction = new QAction( "Quit", "&Quit", CTRL+Key_Q, this, "quit" ); connect( fileQuitAction, SIGNAL( activated() ), this, SLOT( fileQuit() ) ); fileMenu = new QPopupMenu( this ); menuBar()->insertItem( "&File", fileMenu ); fileNewAction->addTo( fileMenu ); fileQuitAction->addTo ( fileMenu ); QAction *helpHelpAction; QAction *helpAboutAction; helpHelpAction = new QAction( "H&elp", "H&elp", CTRL+Key_H,this, "help"); connect( fileNewAction, SIGNAL( activated() ), this, SLOT( helpHelp() ) ); helpAboutAction = new QAction( "&About", "&About", CTRL+Key_A,this, "about"); connect( fileNewAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) ); helpMenu = new QPopupMenu( this ); menuBar()->insertItem( "&Help", helpMenu ); helpHelpAction->addTo ( helpMenu ); helpAboutAction->addTo ( helpMenu ); int Y = 0; // for(int i = 0; i < 4; i++) { // Y = Y + 70; testbox = new StapelGroupBox( this, "x" ); testbox->setXY( 10, Y ); StapelGroupBox * tb2; tb2 = new StapelGroupBox( this, "y" ); tb2->setXY(10,100); // } resize( QSize(600, 480).expandedTo(minimumSizeHint()) ); clearWState( WState_Polished ); } NimForm::~NimForm() { } void NimForm::createGame() { } //void NimForm::closeEvent( QCloseEvent * ) //{ // //} void NimForm::fileNew() { OptionsForm * optionsForm = new OptionsForm( this ); if ( optionsForm->exec() ) { aantalStapels = optionsForm->stapelsSlider->value(); } delete optionsForm; } void NimForm::fileQuit() { qApp->exit ( 0 ); } void NimForm::helpHelp() { delete testbox; } void NimForm::helpAbout() { }