camino-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Camino-devel] camino/src/client TilePresentation.h TilePresen...


From: Pascal Audoux
Subject: [Camino-devel] camino/src/client TilePresentation.h TilePresen...
Date: Tue, 28 Jan 2003 15:37:01 -0500

CVSROOT:        /cvsroot/camino
Module name:    camino
Changes by:     Pascal Audoux <address@hidden>  03/01/28 15:37:01

Modified files:
        src/client     : TilePresentation.h TilePresentation.cpp 

Log message:
        display TileButton

Patches:
Index: camino/src/client/TilePresentation.cpp
diff -u camino/src/client/TilePresentation.cpp:1.1 
camino/src/client/TilePresentation.cpp:1.2
--- camino/src/client/TilePresentation.cpp:1.1  Tue Jan 28 14:33:14 2003
+++ camino/src/client/TilePresentation.cpp      Tue Jan 28 15:37:00 2003
@@ -2,7 +2,7 @@
 **
 ** Camino
 **
-** Version : $Id: TilePresentation.cpp,v 1.1 2003/01/28 19:33:14 Audoux Exp $
+** Version : $Id: TilePresentation.cpp,v 1.2 2003/01/28 20:37:00 Audoux Exp $
 **
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 28/01/2003
@@ -25,15 +25,50 @@
 
 // generic include files
 // include files for QT
+#include <qlayout.h>
+#include <qsignalmapper.h>
 // application specific include files
+#include "client/Theme.h"
 #include "TilePresentation.h"
 
+extern Theme theme;
 
 TilePresentation::TilePresentation( QWidget * parent, const char * name )
        : QWidget( parent, name )
 {
 
+       QVBoxLayout * layout = new QVBoxLayout( this );
+       layout->addStretch( 1 );
+       for( int i = 0; i < 6; i++ ) {
+               _buttons[i] = new TileButton( this );
+               layout->addWidget( _buttons[i] );
+               layout->addStretch( 1 );
+       }
+       layout->activate();
 }
 
+//
+// ----- TileButton -----
+//
 
+TileButton::TileButton( QWidget * parent, const char * name )
+: QPushButton( parent, name )
+{
+       _type = Tile::TILE_UNKNOWN;
+       setFlat( true );
+       reinit();
+}
+
+void TileButton::setTile( Tile::TileType type )
+{
+       _type = type;
+       int size = theme.getZoomSize();
+       setFixedSize( size+2, size+2 );
+       setPixmap( theme.getTilePixmap( (int)type, 0 ) );
+}
+
+void TileButton::reinit()
+{
+       setTile( _type );
+}
 
Index: camino/src/client/TilePresentation.h
diff -u camino/src/client/TilePresentation.h:1.1 
camino/src/client/TilePresentation.h:1.2
--- camino/src/client/TilePresentation.h:1.1    Tue Jan 28 14:33:14 2003
+++ camino/src/client/TilePresentation.h        Tue Jan 28 15:37:00 2003
@@ -5,7 +5,7 @@
 ** TilePresentation.h
 ** Displays tiles of the player
 **
-** Version : $Id: TilePresentation.h,v 1.1 2003/01/28 19:33:14 Audoux Exp $
+** Version : $Id: TilePresentation.h,v 1.2 2003/01/28 20:37:00 Audoux Exp $
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 28/01/2003
 ** Copyright: Pascal Audoux, Philippe Fremy 2003
@@ -30,10 +30,14 @@
 
 // generic include files
 // include files for QT
+#include <qpushbutton.h>
 #include <qwidget.h>
 // application specific include files
+#include "common/Tile.h"
 
 
+class TileButton;
+
 /*              ------------------------------
  *                      TilePresentation
  *              ------------------------------ */
@@ -47,6 +51,22 @@
 public:
        /** Constructor */
        TilePresentation( QWidget * parent = 0, const char * name = 0 );
+
+protected:
+       TileButton * _buttons[6];
+};
+
+class TileButton : public QPushButton
+{
+public:
+       TileButton( QWidget * parent = 0, const char * name = 0 );
+
+       void setTile( Tile::TileType type );
+
+       void reinit();
+
+protected:
+       Tile::TileType _type;
 };
 
 #endif // TILEPRESENTATION_H




reply via email to

[Prev in Thread] Current Thread [Next in Thread]