summaryrefslogtreecommitdiff
path: root/noncore/games/fifteen/fifteen.cpp
authormickeyl <mickeyl>2003-12-07 14:06:21 (UTC)
committer mickeyl <mickeyl>2003-12-07 14:06:21 (UTC)
commit4518f62746143246d29eb9f08030e241ac33eeb7 (patch) (side-by-side diff)
treebeda04d2c1ddadefd4d0dc2bb18774a15da03bf2 /noncore/games/fifteen/fifteen.cpp
parentc648101ca50a9782911b58b5158b31e1d0427ab3 (diff)
downloadopie-4518f62746143246d29eb9f08030e241ac33eeb7.zip
opie-4518f62746143246d29eb9f08030e241ac33eeb7.tar.gz
opie-4518f62746143246d29eb9f08030e241ac33eeb7.tar.bz2
s/QPEToolBar/QToolBar:
- remove usage of deprecated classses - makes it easier to migrate to OToolBar in the future
Diffstat (limited to 'noncore/games/fifteen/fifteen.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/fifteen/fifteen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/games/fifteen/fifteen.cpp b/noncore/games/fifteen/fifteen.cpp
index 212f7b1..2e4ed94 100644
--- a/noncore/games/fifteen/fifteen.cpp
+++ b/noncore/games/fifteen/fifteen.cpp
@@ -1,99 +1,99 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "fifteen.h"
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qvbox.h>
#include <qaction.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qmessagebox.h>
#include <qpe/qpetoolbar.h>
-#include <qpe/qpemenubar.h>
+#include <qmenubar.h>
#include <qstringlist.h>
#include <qapplication.h>
#include <stdlib.h>
#include <time.h>
FifteenMainWindow::FifteenMainWindow(QWidget *parent, const char* name)
: QMainWindow( parent, name )
{
// random seed
srand(time(0));
setToolBarsMovable( FALSE );
QVBox *vbox = new QVBox( this );
PiecesTable *table = new PiecesTable( vbox );
setCentralWidget(vbox);
- QPEToolBar *toolbar = new QPEToolBar(this);
+ QToolBar *toolbar = new QToolBar(this);
toolbar->setHorizontalStretchable( TRUE );
addToolBar(toolbar);
QMenuBar *menubar = new QMenuBar( toolbar );
menubar->setMargin(0);
QPopupMenu *game = new QPopupMenu( this );
QWidget *spacer = new QWidget( toolbar );
spacer->setBackgroundMode( PaletteButton );
toolbar->setStretchableWidget( spacer );
QAction *a = new QAction( tr( "Randomize" ), Resource::loadPixmap( "new" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), table, SLOT( slotRandomize() ) );
a->addTo( game );
a->addTo( toolbar );
a = new QAction( tr( "Solve" ), Resource::loadPixmap( "repeat" ),
QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), table, SLOT( slotReset() ) );
a->addTo( game );
a->addTo( toolbar );
menubar->insertItem( tr( "Game" ), game );
}
PiecesTable::PiecesTable(QWidget* parent, const char* name )
: QTableView(parent, name), _menu(0), _randomized(false)
{
// setup table view
setFrameStyle(StyledPanel | Sunken);
setBackgroundMode(NoBackground);
setMouseTracking(true);
setNumRows(4);
setNumCols(4);
// init arrays
initMap();
readConfig();
initColors();
// set font
QFont f = font();
f.setPixelSize(18);
f.setBold( TRUE );
setFont(f);