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

Diff of /eliot/wxwin/printout.cc

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

revision 1.6 by ipkiss, Sun Oct 23 14:53:44 2005 UTC revision 1.6.2.1 by afrab, Sun Oct 23 17:10:47 2005 UTC
# Line 1  Line 1 
1  /* Eliot                                                                     */  /* Eliot                                                                     */
2  /* Copyright (C) 1999  Antoine Fraboulet                                     */  /* Copyright (C) 1999  Antoine Fraboulet                                     */
 /* Antoine.Fraboulet@free.fr                                                 */  
3  /*                                                                           */  /*                                                                           */
4  /* This program is free software; you can redistribute it and/or modify      */  /* This file is part of Eliot.                                               */
5    /*                                                                           */
6    /* Eliot is free software; you can redistribute it and/or modify             */
7  /* it under the terms of the GNU General Public License as published by      */  /* it under the terms of the GNU General Public License as published by      */
8  /* the Free Software Foundation; either version 2 of the License, or         */  /* the Free Software Foundation; either version 2 of the License, or         */
9  /* (at your option) any later version.                                       */  /* (at your option) any later version.                                       */
10  /*                                                                           */  /*                                                                           */
11  /* This program is distributed in the hope that it will be useful,           */  /* Eliot is distributed in the hope that it will be useful,                  */
12  /* but WITHOUT ANY WARRANTY; without even the implied warranty of            */  /* but WITHOUT ANY WARRANTY; without even the implied warranty of            */
13  /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */  /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             */
14  /* GNU General Public License for more details.                              */  /* GNU General Public License for more details.                              */
# Line 151  GamePrintout::DrawTextLine(wxDC *dc, int Line 152  GamePrintout::DrawTextLine(wxDC *dc, int
152          + numline * (config.getDyT1() + heightT + config.getDyT2());          + numline * (config.getDyT1() + heightT + config.getDyT2());
153      w = config.getDxText(0);      w = config.getDxText(0);
154      str = wxT("");      str = wxT("");
155    
156        int NRounds = m_game.getHistory().getSize();
157    
158      // num      // num
159      if (numline < m_game.getNRounds())      if (numline < NRounds)
160      {      {
161            str = wxT("");
162          str << (numline + 1);          str << (numline + 1);
163          DRW(0);          DRW(0);
164      }      }
165      // rack      // rack
166      DIM(1);      DIM(1);
167      if (numline < m_game.getNRounds())      if (numline < NRounds)
168      {      {
169          str = wxU(m_game.getPlayedRack(numline).c_str());          str = wxU(m_game.getHistory().getTurn(numline).getPlayedRack().toString().c_str());
170          DRW(1);          DRW(1);
171      }      }
172      // word      // word
173      DIM(2);      DIM(2);
174      if ((numline > 0) && (numline <= m_game.getNRounds()))      if ((numline > 0) && (numline <= NRounds))
175      {      {
176          str = wxU(m_game.getPlayedWord(numline - 1).c_str());          str = wxU(m_game.getHistory().getTurn(numline - 1).getRound().getWord().c_str());
177          DRW(2);          DRW(2);
178      }      }
179      // pos      // pos
180      DIM(3);      DIM(3);
181      if ((numline > 0) && (numline <= m_game.getNRounds()))      if ((numline > 0) && (numline <= NRounds))
182      {      {
183          str = wxU(m_game.getPlayedCoords(numline - 1).c_str());          str = wxU(m_game.getHistory().getTurn(numline - 1).getRound().getCoord().toString().c_str());
184          DRW(3);          DRW(3);
185      }      }
186      // pts      // pts
187      DIM(4);      DIM(4);
188      if ((numline > 0) && (numline <= m_game.getNRounds()))      if ((numline > 0) && (numline <= NRounds))
189      {      {
190          str << m_game.getPlayedPoints(numline - 1);          str = wxT("");
191            str << m_game.getHistory().getTurn(numline - 1).getRound().getPoints();
192          DRW(4);          DRW(4);
193      }      }
194      // total points      // total points
195      if (numline == m_game.getNRounds() + 1)      if (numline == NRounds + 1)
196      {      {
197          str << m_game.getPlayerPoints(0);          str = wxT("");
198            str << m_game.getPlayer(0).getPoints();
199          DRW(4);          DRW(4);
200      }      }
201  #undef DIM  #undef DIM
# Line 254  GamePrintout::DrawPage(wxDC *dc) Line 261  GamePrintout::DrawPage(wxDC *dc)
261       basey = config.getMarginY() + config.getDyH1() + heightH + config.getDyH2();       basey = config.getMarginY() + config.getDyH1() + heightH + config.getDyH2();
262       dc->SetFont(Tfont);       dc->SetFont(Tfont);
263       heightT = (long) (dc->GetCharHeight() / mmToLogical);       heightT = (long) (dc->GetCharHeight() / mmToLogical);
264       for(i=0; i < (m_game.getNRounds()+3);i++)       int NRounds = m_game.getHistory().getSize();
265         for(i=0; i < (NRounds+3);i++)
266       {       {
267           DrawTextLine(dc,i,basey,heightT,mmToLogical);           DrawTextLine(dc,i,basey,heightT,mmToLogical);
268       }       }
# Line 275  GamePrintout::DrawGameLines(wxDC *dc, lo Line 283  GamePrintout::DrawGameLines(wxDC *dc, lo
283      float SCALE = config.getPrintLineScale();      float SCALE = config.getPrintLineScale();
284      dc->SetUserScale(SCALE,SCALE);      dc->SetUserScale(SCALE,SCALE);
285    
286      nTextLines = m_game.getNRounds() + 2;      int NRounds = m_game.getHistory().getSize();
287        nTextLines = NRounds + 2;
288      StartX = config.getMarginX();      StartX = config.getMarginX();
289      StartY = config.getMarginY();      StartY = config.getMarginY();
290    
# Line 314  GamePrintout::DrawGameLines(wxDC *dc, lo Line 323  GamePrintout::DrawGameLines(wxDC *dc, lo
323          lin = StartY + HeadHeight + i * LineHeight;          lin = StartY + HeadHeight + i * LineHeight;
324      }      }
325  }  }
326    
327    
328    /// Local Variables:
329    /// mode: hs-minor
330    /// c-basic-offset: 4
331    /// End:

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

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