eliot-dev
[Top][All Lists]
Advanced

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

[Eliot-dev] Changes to eliot/wxwin/gfxboard.cc [antoine-1]


From: eliot-dev
Subject: [Eliot-dev] Changes to eliot/wxwin/gfxboard.cc [antoine-1]
Date: Sun, 23 Oct 2005 16:59:34 -0400

Index: eliot/wxwin/gfxboard.cc
diff -u eliot/wxwin/gfxboard.cc:1.5.2.1 eliot/wxwin/gfxboard.cc:1.5.2.2
--- eliot/wxwin/gfxboard.cc:1.5.2.1     Sun Oct 23 17:10:46 2005
+++ eliot/wxwin/gfxboard.cc     Sun Oct 23 20:58:20 2005
@@ -17,8 +17,6 @@
 /* along with this program; if not, write to the Free Software               */
 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
*/
 
-/* $Id: gfxboard.cc,v 1.5.2.1 2005/10/23 17:10:46 afrab Exp $ */
-
 /**
  *  \file gfxboard.cc
  *  \brief  Game board graphical view
@@ -39,7 +37,7 @@
 #include "gfxboard.h"
 
 #ifdef DEBUG_
-#   define GFXDEBUG(x) x 
+#   define GFXDEBUG(x) x
 #else
 #   define GFXDEBUG(x)
 #endif
@@ -56,8 +54,8 @@
     /* ************************************************** */
 
 GfxBoard::GfxBoard(wxFrame *parent, Game &iGame) :
-       wxWindow(parent, wxWindowID(-1), wxDefaultPosition, wxDefaultSize, 
-                wxNO_BORDER | wxFULL_REPAINT_ON_RESIZE, wxT("gfxboard")), 
+       wxWindow(parent, wxWindowID(-1), wxDefaultPosition, wxDefaultSize,
+                wxNO_BORDER | wxFULL_REPAINT_ON_RESIZE, wxT("gfxboard")),
        m_game(iGame)
 {
     bmp          = NULL;
@@ -89,7 +87,7 @@
 }
 
 /**
- * Make new dimensions available for the next OnPaint 
+ * Make new dimensions available for the next OnPaint
  * event. The BMP is deleted if it exists.
  */
 
@@ -120,7 +118,7 @@
 }
 
 /**
- * Creates a BMP in memory and draws the board inside 
+ * Creates a BMP in memory and draws the board inside
  */
 
 void
@@ -131,7 +129,7 @@
        {
            wxSize bs = GetClientSize();
            bmp=new wxBitmap(bs.x,bs.y);
-           GFXDEBUG(std::cerr << " new bmp (" << bs.x << "," << bs.y << ")"); 
+           GFXDEBUG(std::cerr << " new bmp (" << bs.x << "," << bs.y << ")");
            if (bmp)
                {
                    wxMemoryDC memDC;
@@ -139,7 +137,7 @@
                    DrawBoard(&memDC);
                    memDC.SelectObject(wxNullBitmap);
                }
-       } 
+       }
     GFXDEBUG(std::cerr << endl);
 }
 
@@ -183,7 +181,7 @@
 {
     wxSize cs = GetClientSize();
     board_size = cs.GetWidth() < cs.GetHeight() ? cs.GetWidth() : 
cs.GetHeight();
-    tile_size  = (int)((float)board_size / (float)(BOARD_SIZE)) - LINE_WIDTH;  
  
+    tile_size  = (int)((float)board_size / (float)(BOARD_SIZE)) - LINE_WIDTH;
     wxRect r (0,0,cs.GetWidth(),cs.GetHeight());
     RefreshSquare(r);
 }
@@ -267,12 +265,12 @@
  */
 
 #define TILE_LEFT(col) (col*(tile_size+LINE_WIDTH) + TopLeft.x)
-#define TILE_TOP(row) (row*(tile_size+LINE_WIDTH) + TopLeft.y) 
+#define TILE_TOP(row) (row*(tile_size+LINE_WIDTH) + TopLeft.y)
 
-/* 
+/*
    TODO
    - ajuster avec une LINE_SIZE differente
-   - calculer la taille de la police 
+   - calculer la taille de la police
 */
 
 /*    TILE_LEFT
@@ -293,7 +291,7 @@
        |
        LINE_WIDTH
 */
-  
+
 void
 GfxBoard::DrawTile(wxDC *dc, wxString& wxs, int row, int column, bool 
testtile, bool drawtileback)
 {
@@ -301,10 +299,10 @@
     wxCoord width, height;
     wxCoord posx, posy;
     wxCoord left,top;
-    // redraw borders 
+    // redraw borders
     left = TILE_LEFT(column);
     top  = TILE_TOP(row);
-    
+
     if (wxs.length() > 0 && *wxs.GetData())
        {
            // we got a letter (or 2 chars for coordinates > 9)
@@ -314,7 +312,7 @@
                    DrawTileBack(dc,
                                 top  + LINE_WIDTH,
                                 left + LINE_WIDTH,
-                                tile_size, testtile); 
+                                tile_size, testtile);
                }
            // draw letter
            if (testtile)
@@ -325,7 +323,7 @@
                {
                    colour = config.getColour(wxString(BCOLOURLETTERS));
                }
-           
+
            dc->SetTextForeground(colour);
            dc->GetTextExtent(wxs,&width,&height);
            posx = left + LINE_WIDTH + (tile_size - width) / 2;
@@ -418,7 +416,7 @@
                        {
                            dc->SetBrush(*Wx3Brush);
                        }
-                   else 
+                   else
                        {
                            dc->SetBrush(*BackgroundBrush);
                        }
@@ -445,7 +443,7 @@
 
                    paintedboard_char[row - BOARD_MIN][column - BOARD_MIN] = 
*wxs.GetData();
                    paintedboard_attr[row - BOARD_MIN][column - BOARD_MIN] = 
attr;
-                
+
                    DrawTile(dc,wxs,row,column,attr & ATTR_TEST,drawtiles);
                }
        }




reply via email to

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