[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Camino-devel] camino/src/client BoardCanvas.cpp BoardCanvas.h...
From: |
Pascal Audoux |
Subject: |
[Camino-devel] camino/src/client BoardCanvas.cpp BoardCanvas.h... |
Date: |
Thu, 23 Jan 2003 17:34:27 -0500 |
CVSROOT: /cvsroot/camino
Module name: camino
Changes by: Pascal Audoux <address@hidden> 03/01/23 17:34:27
Modified files:
src/client : BoardCanvas.cpp BoardCanvas.h Theme.cpp Theme.h
Log message:
improve tile position on board
Patches:
Index: camino/src/client/BoardCanvas.cpp
diff -u camino/src/client/BoardCanvas.cpp:1.2
camino/src/client/BoardCanvas.cpp:1.3
--- camino/src/client/BoardCanvas.cpp:1.2 Wed Jan 22 17:57:23 2003
+++ camino/src/client/BoardCanvas.cpp Thu Jan 23 17:34:27 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: BoardCanvas.cpp,v 1.2 2003/01/22 22:57:23 Audoux Exp $
+** Version : $Id: BoardCanvas.cpp,v 1.3 2003/01/23 22:34:27 Audoux Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 22/01/2003
@@ -26,17 +26,26 @@
// include files for QT
// application specific include files
#include "BoardCanvas.h"
+#include "client/Theme.h"
#include "client/TileSprite.h"
+extern Theme theme;
+
BoardCanvas::BoardCanvas( QWidget * parent, const char * name )
: QCanvas( parent, name )
{
- resize( 400, 400 );
+ resize( theme.getZoomSize() * 10, theme.getZoomSize() * 14 );
+ setBackgroundColor( Qt::black );
}
void BoardCanvas::addTile( int row, int col )
{
TileSprite * tile = new TileSprite( this );
- tile->move( row * 70, col * 70 );
+ tile->move( (row-1) * 70, (col-1) * 70 );
tile->show();
+}
+
+void BoardCanvas::clear()
+{
+
}
Index: camino/src/client/BoardCanvas.h
diff -u camino/src/client/BoardCanvas.h:1.2 camino/src/client/BoardCanvas.h:1.3
--- camino/src/client/BoardCanvas.h:1.2 Wed Jan 22 17:57:23 2003
+++ camino/src/client/BoardCanvas.h Thu Jan 23 17:34:27 2003
@@ -5,7 +5,7 @@
** BoardCanvas.h
** Canvas for the board view
**
-** Version : $Id: BoardCanvas.h,v 1.2 2003/01/22 22:57:23 Audoux Exp $
+** Version : $Id: BoardCanvas.h,v 1.3 2003/01/23 22:34:27 Audoux Exp $
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 22/01/2003
** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -49,6 +49,8 @@
BoardCanvas( QWidget * parent = 0, const char * name = 0 );
void addTile( int row, int col );
+
+ void clear();
};
#endif // BOARDCANVAS_H
Index: camino/src/client/Theme.cpp
diff -u camino/src/client/Theme.cpp:1.1 camino/src/client/Theme.cpp:1.2
--- camino/src/client/Theme.cpp:1.1 Wed Jan 22 17:49:57 2003
+++ camino/src/client/Theme.cpp Thu Jan 23 17:34:27 2003
@@ -2,7 +2,7 @@
**
** Camino
**
-** Version : $Id: Theme.cpp,v 1.1 2003/01/22 22:49:57 Audoux Exp $
+** Version : $Id: Theme.cpp,v 1.2 2003/01/23 22:34:27 Audoux Exp $
**
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 22/01/2003
@@ -64,6 +64,26 @@
}
}
}
+}
+
+int Theme::getZoomSize()
+{
+ int ret = 0;
+
+ // XXX: should be read in theme data
+ switch( _level ) {
+ case 1:
+ ret = 30;
+ break;
+ case 2:
+ ret = 50;
+ break;
+ case 3:
+ ret = 70;
+ break;
+ }
+
+ return ret;
}
QCanvasPixmapArray * Theme::tile( int num, int side )
Index: camino/src/client/Theme.h
diff -u camino/src/client/Theme.h:1.1 camino/src/client/Theme.h:1.2
--- camino/src/client/Theme.h:1.1 Wed Jan 22 17:49:57 2003
+++ camino/src/client/Theme.h Thu Jan 23 17:34:27 2003
@@ -5,7 +5,7 @@
** Theme.h
** Manage theme data and pictures
**
-** Version : $Id: Theme.h,v 1.1 2003/01/22 22:49:57 Audoux Exp $
+** Version : $Id: Theme.h,v 1.2 2003/01/23 22:34:27 Audoux Exp $
** Author(s) : Philippe Fremy, Pascal Audoux
** Creation : 22/01/2003
** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -59,6 +59,8 @@
void setZoomLevel( int level ) { _level = level; }
int getZoomLevel() { return _level; }
+
+ int getZoomSize();
protected:
int _level;