]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/forty/scoredg.cpp
More SC++ fixes; HelpGen starting to compile with VC++; image sample now compiles...
[wxWidgets.git] / samples / forty / scoredg.cpp
index bd4d9b93b655081d5ff58f44c0113c001625455d..befb3725cdca16033ec08496915fd3772a41a503 100644 (file)
 #include "wx/wx.h"
 #endif
 
 #include "wx/wx.h"
 #endif
 
-#if defined(__WXMSW__) && !defined(GNUWIN32)
+#if wxUSE_IOSTREAMH
+#if defined(__WXMSW__) && !defined(__GNUWIN32__)
 #include <strstrea.h>
 #else
 #include <strstream.h>
 #endif
 #include <strstrea.h>
 #else
 #include <strstream.h>
 #endif
+#else
+#include <strstream>
+using namespace std;
+#endif
 #include "scorefil.h"
 #include "scoredg.h"
 
 #include "scorefil.h"
 #include "scoredg.h"
 
@@ -58,14 +63,13 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) :
        m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
 #endif
 
        m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
 #endif
 
-       wxString* players = 0;
-       int length = 0;
-       scoreFile->GetPlayerList(&players, length);
+        wxArrayString players;
+       scoreFile->GetPlayerList( players);
 
        ostrstream os;
 
        os << "Player\tWins\tGames\tScore\n";
 
        ostrstream os;
 
        os << "Player\tWins\tGames\tScore\n";
-       for (int i = 0; i < length; i++)
+       for (unsigned int i = 0; i < players.Count(); i++)
        {
                int wins, games, score;
                scoreFile->ReadPlayersScore(players[i], wins, games, score);
        {
                int wins, games, score;
                scoreFile->ReadPlayersScore(players[i], wins, games, score);
@@ -84,7 +88,6 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) :
        char* str = os.str();
        m_text = str;
        delete str;
        char* str = os.str();
        m_text = str;
        delete str;
-       delete players;
 }
 
 ScoreCanvas::~ScoreCanvas()
 }
 
 ScoreCanvas::~ScoreCanvas()
@@ -93,7 +96,7 @@ ScoreCanvas::~ScoreCanvas()
 
 void ScoreCanvas::OnDraw(wxDC& dc)
 {
 
 void ScoreCanvas::OnDraw(wxDC& dc)
 {
-       dc.SetFont(m_font);
+       dc.SetFont(m_font);
 
        const char* str = m_text;
        unsigned int tab = 0;
 
        const char* str = m_text;
        unsigned int tab = 0;