/[eliot]/eliot/wxwin/gfxboard.cc
ViewVC logotype

Diff of /eliot/wxwin/gfxboard.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by ipkiss, Sun Oct 23 14:53:44 2005 UTC revision 1.6 by ipkiss, Fri Nov 4 20:00:06 2005 UTC
# Line 16  Line 16 
16  /* along with this program; if not, write to the Free Software               */  /* along with this program; if not, write to the Free Software               */
17  /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */  /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
18    
 /* $Id$ */  
   
19  #include <string.h>  #include <string.h>
20  #include <math.h>  #include <math.h>
21  #include <ctype.h>  #include <ctype.h>
# Line 66  GfxBoard::OnSize(wxSizeEvent& e) Line 64  GfxBoard::OnSize(wxSizeEvent& e)
64  {  {
65    size = GetClientSize();    size = GetClientSize();
66    
67    board_size = size.GetWidth() < size.GetHeight() ?    board_size = size.GetWidth() < size.GetHeight() ?
68      size.GetWidth() : size.GetHeight();      size.GetWidth() : size.GetHeight();
69    
70    tile_size = (int)((float)board_size / (float)(BOARD_SIZE)) - LINE_WIDTH;    tile_size = (int)((float)board_size / (float)(BOARD_SIZE)) - LINE_WIDTH;
# Line 188  GfxBoard::DrawTile(wxDC *dc, wxString& w Line 186  GfxBoard::DrawTile(wxDC *dc, wxString& w
186    wxCoord width, height;    wxCoord width, height;
187    wxCoord posx, posy;    wxCoord posx, posy;
188    
189    // redraw borders    // redraw borders
190    if (row && column)    if (row && column)
191      dc->DrawRectangle(column*(tile_size+LINE_WIDTH) + TopLeft.x,      dc->DrawRectangle(column*(tile_size+LINE_WIDTH) + TopLeft.x,
192                        row*(tile_size+LINE_WIDTH)    + TopLeft.y,                        row*(tile_size+LINE_WIDTH)    + TopLeft.y,
# Line 210  GfxBoard::DrawTile(wxDC *dc, wxString& w Line 208  GfxBoard::DrawTile(wxDC *dc, wxString& w
208        dc->GetTextExtent(wxs,&width,&height);        dc->GetTextExtent(wxs,&width,&height);
209        posx = TopLeft.x + column*(tile_size+LINE_WIDTH) + LINE_WIDTH +        posx = TopLeft.x + column*(tile_size+LINE_WIDTH) + LINE_WIDTH +
210          (tile_size - width) / 2;          (tile_size - width) / 2;
211        posy = TopLeft.y +    row*(tile_size+LINE_WIDTH) + LINE_WIDTH +        posy = TopLeft.y +    row*(tile_size+LINE_WIDTH) + LINE_WIDTH +
212          (tile_size - height) / 2;          (tile_size - height) / 2;
213        dc->DrawText(wxs,posx,posy);        dc->DrawText(wxs,posx,posy);
214      }      }
# Line 241  GfxBoard::DrawBoard(wxDC *dc) Line 239  GfxBoard::DrawBoard(wxDC *dc)
239    wxColour colLx2         = config.getColour(wxString(BCOLOURLX2));    wxColour colLx2         = config.getColour(wxString(BCOLOURLX2));
240    
241    wxPen   *LinesPen = wxThePenList->FindOrCreatePen(colLines, 1, wxSOLID);    wxPen   *LinesPen = wxThePenList->FindOrCreatePen(colLines, 1, wxSOLID);
242    wxBrush *BackgroundBrush = wxTheBrushList->FindOrCreateBrush(colBackground,    wxBrush *BackgroundBrush = wxTheBrushList->FindOrCreateBrush(colBackground,
243                                                                 wxSOLID);                                                                 wxSOLID);
244    
245    wxBrush *Wx3Brush = wxTheBrushList->FindOrCreateBrush(colWx3, wxSOLID);    wxBrush *Wx3Brush = wxTheBrushList->FindOrCreateBrush(colWx3, wxSOLID);

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26