X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54ff4a701f6c83aad8387a31b652f209681210cb..0828c0875e1516e4bfc0aa5b0a84195a2ac92cca:/samples/forty/scoredg.cpp diff --git a/samples/forty/scoredg.cpp b/samples/forty/scoredg.cpp index 765fa47b5d..de7d7a6a09 100644 --- a/samples/forty/scoredg.cpp +++ b/samples/forty/scoredg.cpp @@ -27,11 +27,16 @@ #include "wx/wx.h" #endif -#if defined(__WXMSW__) && !defined(GNUWIN32) +#if wxUSE_IOSTREAMH +#if defined(__WXMSW__) && !defined(__GNUWIN32__) #include #else #include #endif +#else +#include +using namespace std; +#endif #include "scorefil.h" #include "scoredg.h" @@ -64,7 +69,7 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) : ostrstream os; os << "Player\tWins\tGames\tScore\n"; - for (int i = 0; i < players.Count(); i++) + for (unsigned int i = 0; i < players.Count(); i++) { int wins, games, score; scoreFile->ReadPlayersScore(players[i], wins, games, score); @@ -91,7 +96,7 @@ ScoreCanvas::~ScoreCanvas() void ScoreCanvas::OnDraw(wxDC& dc) { - dc.SetFont(m_font); + dc.SetFont(* m_font); const char* str = m_text; unsigned int tab = 0; @@ -132,6 +137,9 @@ void ScoreCanvas::OnDraw(wxDC& dc) } } +BEGIN_EVENT_TABLE(ScoreDialog, wxDialog) + EVT_CLOSE(ScoreDialog::OnCloseWindow) +END_EVENT_TABLE() ScoreDialog::ScoreDialog( wxWindow* parent, @@ -178,10 +186,7 @@ void ScoreDialog::Display() Show(TRUE); } -bool ScoreDialog::OnClose() +void ScoreDialog::OnCloseWindow(wxCloseEvent& event) { - // hide the dialog - // NB don't return TRUE otherwise delete is called - Show(FALSE); - return FALSE; + EndModal(wxID_OK); }