[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Camino-devel] camino/src/client ClientInterface.cpp Game.cpp ...
From: |
Pascal Audoux |
Subject: |
[Camino-devel] camino/src/client ClientInterface.cpp Game.cpp ... |
Date: |
Wed, 29 Jan 2003 14:42:03 -0500 |
CVSROOT: /cvsroot/camino
Module name: camino
Changes by: Pascal Audoux <address@hidden> 03/01/29 14:42:03
Modified files:
src/client : ClientInterface.cpp Game.cpp Game.h
TilePresentation.cpp TilePresentation.h
Log message:
add reupdate methods (for updating widget if a global parameter changed)
manage TileButton as toggle buttons
Patches:
Index: camino/src/client/ClientInterface.cpp
diff -u camino/src/client/ClientInterface.cpp:1.12
camino/src/client/ClientInterface.cpp:1.13
--- camino/src/client/ClientInterface.cpp:1.12 Tue Jan 28 16:54:27 2003
+++ camino/src/client/ClientInterface.cpp Wed Jan 29 14:42:03 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: ClientInterface.cpp,v 1.12 2003/01/28 21:54:27 pfremy Exp $
+** Version : $Id: ClientInterface.cpp,v 1.13 2003/01/29 19:42:03 Audoux Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 15/01/2003
@@ -226,7 +226,7 @@
break;
}
theme.setZoomLevel( level );
- //_game->reupdate();
+ _game->reupdate();
}
// the server widget must be created with the server, else, it loses some
messages
Index: camino/src/client/Game.cpp
diff -u camino/src/client/Game.cpp:1.8 camino/src/client/Game.cpp:1.9
--- camino/src/client/Game.cpp:1.8 Tue Jan 28 14:37:46 2003
+++ camino/src/client/Game.cpp Wed Jan 29 14:42:03 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: Game.cpp,v 1.8 2003/01/28 19:37:46 Audoux Exp $
+** Version : $Id: Game.cpp,v 1.9 2003/01/29 19:42:03 Audoux Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 15/01/2003
@@ -66,6 +66,13 @@
Game::~Game()
{
+}
+
+void Game::reupdate()
+{
+ //_actions->reupdate();
+ //_board->reupdate();
+ _presentation->reupdate();
}
void Game::connectToServer( QString host, int port, QString player )
Index: camino/src/client/Game.h
diff -u camino/src/client/Game.h:1.6 camino/src/client/Game.h:1.7
--- camino/src/client/Game.h:1.6 Tue Jan 28 14:37:46 2003
+++ camino/src/client/Game.h Wed Jan 29 14:42:03 2003
@@ -5,7 +5,7 @@
** Game.h
** Main widget of the game
**
-** Version : $Id: Game.h,v 1.6 2003/01/28 19:37:46 Audoux Exp $
+** Version : $Id: Game.h,v 1.7 2003/01/29 19:42:03 Audoux Exp $
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 15/01/2003
** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -56,6 +56,8 @@
virtual ~Game();
void connectToServer( QString host, int port, QString player );
+
+ void reupdate();
public slots:
void slot_message( const QString & msg );
Index: camino/src/client/TilePresentation.cpp
diff -u camino/src/client/TilePresentation.cpp:1.2
camino/src/client/TilePresentation.cpp:1.3
--- camino/src/client/TilePresentation.cpp:1.2 Tue Jan 28 15:37:00 2003
+++ camino/src/client/TilePresentation.cpp Wed Jan 29 14:42:03 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: TilePresentation.cpp,v 1.2 2003/01/28 20:37:00 Audoux Exp $
+** Version : $Id: TilePresentation.cpp,v 1.3 2003/01/29 19:42:03 Audoux Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 28/01/2003
@@ -36,6 +36,8 @@
TilePresentation::TilePresentation( QWidget * parent, const char * name )
: QWidget( parent, name )
{
+ _toggled = -1;
+ QSignalMapper * sigmap = new QSignalMapper( this );
QVBoxLayout * layout = new QVBoxLayout( this );
layout->addStretch( 1 );
@@ -43,8 +45,34 @@
_buttons[i] = new TileButton( this );
layout->addWidget( _buttons[i] );
layout->addStretch( 1 );
+ sigmap->setMapping( _buttons[i], i );
+ connect( _buttons[i], SIGNAL( clicked() ), sigmap, SLOT( map()
) );
}
layout->activate();
+
+ connect( sigmap, SIGNAL( mapped( int ) ), SLOT( slot_toggle( int ) ) );
+}
+
+void TilePresentation::reupdate()
+{
+ for( int i = 0; i < 6; i++ ) {
+ _buttons[i]->reinit();
+ }
+}
+
+void TilePresentation::slot_toggle( int num )
+{
+ if( _toggled != -1 ) {
+ if( num != _toggled ) {
+ _buttons[_toggled]->toggle();
+ }
+ }
+ if( num == _toggled ) {
+ _toggled = -1;
+ } else {
+ _toggled = num;
+ }
+ emit sig_tile( _toggled );
}
//
@@ -56,6 +84,7 @@
{
_type = Tile::TILE_UNKNOWN;
setFlat( true );
+ setToggleButton( true );
reinit();
}
Index: camino/src/client/TilePresentation.h
diff -u camino/src/client/TilePresentation.h:1.2
camino/src/client/TilePresentation.h:1.3
--- camino/src/client/TilePresentation.h:1.2 Tue Jan 28 15:37:00 2003
+++ camino/src/client/TilePresentation.h Wed Jan 29 14:42:03 2003
@@ -5,7 +5,7 @@
** TilePresentation.h
** Displays tiles of the player
**
-** Version : $Id: TilePresentation.h,v 1.2 2003/01/28 20:37:00 Audoux Exp $
+** Version : $Id: TilePresentation.h,v 1.3 2003/01/29 19:42:03 Audoux Exp $
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 28/01/2003
** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -47,13 +47,22 @@
/** comment for the class */
class TilePresentation : public QWidget
{
-
+ Q_OBJECT
public:
/** Constructor */
TilePresentation( QWidget * parent = 0, const char * name = 0 );
+ void reupdate();
+
+public slots:
+ void slot_toggle( int num );
+
+signals:
+ void sig_tile( int num );
+
protected:
TileButton * _buttons[6];
+ int _toggled;
};
class TileButton : public QPushButton
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Camino-devel] camino/src/client ClientInterface.cpp Game.cpp ...,
Pascal Audoux <=