summaryrefslogtreecommitdiff
path: root/noncore/games/minesweep/minesweep.cpp
Unidiff
Diffstat (limited to 'noncore/games/minesweep/minesweep.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/minesweep/minesweep.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp
index 814070b..48644b3 100644
--- a/noncore/games/minesweep/minesweep.cpp
+++ b/noncore/games/minesweep/minesweep.cpp
@@ -4,49 +4,49 @@
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "minesweep.h" 21#include "minesweep.h"
22#include "minefield.h" 22#include "minefield.h"
23 23
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25#include <qpe/config.h> 25#include <qpe/config.h>
26 26
27#include <qpe/qpetoolbar.h> 27#include <qpe/qpetoolbar.h>
28#include <qpe/qpemenubar.h> 28#include <qmenubar.h>
29#include <qpopupmenu.h> 29#include <qpopupmenu.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31#include <qlcdnumber.h> 31#include <qlcdnumber.h>
32#include <qmessagebox.h> 32#include <qmessagebox.h>
33#include <qtimer.h> 33#include <qtimer.h>
34#include <qpalette.h> 34#include <qpalette.h>
35#include <qapplication.h> 35#include <qapplication.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qlabel.h> 37#include <qlabel.h>
38 38
39#include <stdlib.h> 39#include <stdlib.h>
40#include <time.h> 40#include <time.h>
41 41
42 42
43 43
44 44
45static const char *pix_new[]={ 45static const char *pix_new[]={
46"20 20 3 1", 46"20 20 3 1",
47" c None", 47" c None",
48"# c #00FF00", 48"# c #00FF00",
49". c #000000", 49". c #000000",
50" ", 50" ",
51" ...... ", 51" ...... ",
52" ..######.. ", 52" ..######.. ",
@@ -222,49 +222,49 @@ void ResultIndicator::timerEvent( QTimerEvent *te )
222class MineFrame : public QFrame 222class MineFrame : public QFrame
223{ 223{
224public: 224public:
225 MineFrame( QWidget *parent, const char *name = 0 ) 225 MineFrame( QWidget *parent, const char *name = 0 )
226 :QFrame( parent, name ) {} 226 :QFrame( parent, name ) {}
227 void setField( MineField *f ) { field = f; } 227 void setField( MineField *f ) { field = f; }
228protected: 228protected:
229 void resizeEvent( QResizeEvent *e ) { 229 void resizeEvent( QResizeEvent *e ) {
230 field->setAvailableRect( contentsRect()); 230 field->setAvailableRect( contentsRect());
231 QFrame::resizeEvent(e); 231 QFrame::resizeEvent(e);
232 } 232 }
233private: 233private:
234 MineField *field; 234 MineField *field;
235}; 235};
236 236
237 237
238 238
239MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f ) 239MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
240: QMainWindow( parent, name, f ) 240: QMainWindow( parent, name, f )
241{ 241{
242 srand(::time(0)); 242 srand(::time(0));
243 setCaption( tr("Mine Hunt") ); 243 setCaption( tr("Mine Hunt") );
244 setIcon( Resource::loadPixmap( "minesweep_icon" ) ); 244 setIcon( Resource::loadPixmap( "minesweep_icon" ) );
245 245
246 QPEToolBar *toolBar = new QPEToolBar( this ); 246 QToolBar *toolBar = new QToolBar( this );
247 toolBar->setHorizontalStretchable( TRUE ); 247 toolBar->setHorizontalStretchable( TRUE );
248 248
249 QMenuBar *menuBar = new QMenuBar( toolBar ); 249 QMenuBar *menuBar = new QMenuBar( toolBar );
250 250
251 QPopupMenu *gameMenu = new QPopupMenu( this ); 251 QPopupMenu *gameMenu = new QPopupMenu( this );
252 gameMenu->insertItem( tr("Beginner"), this, SLOT( beginner() ) ); 252 gameMenu->insertItem( tr("Beginner"), this, SLOT( beginner() ) );
253 gameMenu->insertItem( tr("Advanced"), this, SLOT( advanced() ) ); 253 gameMenu->insertItem( tr("Advanced"), this, SLOT( advanced() ) );
254 gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) ); 254 gameMenu->insertItem( tr("Expert"), this, SLOT( expert() ) );
255 255
256 menuBar->insertItem( tr("Game"), gameMenu ); 256 menuBar->insertItem( tr("Game"), gameMenu );
257 257
258 guessLCD = new QLCDNumber( toolBar ); 258 guessLCD = new QLCDNumber( toolBar );
259 toolBar->setStretchableWidget( guessLCD ); 259 toolBar->setStretchableWidget( guessLCD );
260 260
261 QPalette lcdPal( red ); 261 QPalette lcdPal( red );
262 lcdPal.setColor( QColorGroup::Background, QApplication::palette().active().background() ); 262 lcdPal.setColor( QColorGroup::Background, QApplication::palette().active().background() );
263 lcdPal.setColor( QColorGroup::Button, QApplication::palette().active().button() ); 263 lcdPal.setColor( QColorGroup::Button, QApplication::palette().active().button() );
264 264
265// guessLCD->setPalette( lcdPal ); 265// guessLCD->setPalette( lcdPal );
266 guessLCD->setSegmentStyle( QLCDNumber::Flat ); 266 guessLCD->setSegmentStyle( QLCDNumber::Flat );
267 guessLCD->setFrameStyle( QFrame::NoFrame ); 267 guessLCD->setFrameStyle( QFrame::NoFrame );
268 guessLCD->setNumDigits( 2 ); 268 guessLCD->setNumDigits( 2 );
269 guessLCD->setBackgroundMode( PaletteButton ); 269 guessLCD->setBackgroundMode( PaletteButton );
270 newGameButton = new QPushButton( toolBar ); 270 newGameButton = new QPushButton( toolBar );