Eliminated streams from scoredg.cpp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-01-08 09:14:35 +00:00
parent 90b1d65f2f
commit 0447ac8e64

View File

@@ -58,7 +58,7 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) :
wxString os; wxString os;
os << _T("Player\tWins\tGames\tScore\n"); os << wxT("Player\tWins\tGames\tScore\n");
for (unsigned int i = 0; i < players.Count(); i++) for (unsigned int i = 0; i < players.Count(); i++)
{ {
int wins, games, score; int wins, games, score;
@@ -69,12 +69,12 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile) :
average = (2 * score + games) / (2 * games); average = (2 * score + games) / (2 * games);
} }
os << players[i] << _T('\t') os << players[i] << wxT('\t')
<< wins << _T('\t') << wins << wxT('\t')
<< games << _T('\t') << games << wxT('\t')
<< average << _T('\n'); << average << wxT('\n');
} }
os << _T('\0'); os << wxT('\0');
m_text = os; m_text = os;
} }
@@ -86,7 +86,7 @@ void ScoreCanvas::OnDraw(wxDC& dc)
{ {
dc.SetFont(* m_font); dc.SetFont(* m_font);
const wxChar* str = m_text; const char* str = m_text;
unsigned int tab = 0; unsigned int tab = 0;
unsigned int tabstops[] = { 5, 100, 150, 200 }; unsigned int tabstops[] = { 5, 100, 150, 200 };
@@ -94,29 +94,29 @@ void ScoreCanvas::OnDraw(wxDC& dc)
int lineSpacing; int lineSpacing;
{ {
long w, h; long w, h;
dc.GetTextExtent(_T("Testing"), &w, &h); dc.GetTextExtent("Testing", &w, &h);
lineSpacing = (int)h; lineSpacing = (int)h;
} }
int y = 0; int y = 0;
while (*str) while (*str)
{ {
wxChar text[256]; char text[256];
wxChar* dest = text; char* dest = text;
while (*str && *str >= _T(' ')) *dest++ = *str++; while (*str && *str >= ' ') *dest++ = *str++;
*dest = _T('\0'); *dest = '\0';
dc.DrawText(text, tabstops[tab], y); dc.DrawText(text, tabstops[tab], y);
if (*str == _T('\t')) if (*str == '\t')
{ {
if (tab < sizeof(tabstops) / sizeof(tabstops[0]) - 1) if (tab < sizeof(tabstops) / sizeof(tabstops[0]) - 1)
{ {
tab++; tab++;
} }
} }
else if (*str == _T('\n')) else if (*str == '\n')
{ {
tab = 0; tab = 0;
y += lineSpacing; y += lineSpacing;
@@ -133,7 +133,7 @@ ScoreDialog::ScoreDialog(
wxWindow* parent, wxWindow* parent,
ScoreFile* file ScoreFile* file
) : ) :
wxDialog(parent, -1, _T("Scores"), wxDialog(parent, -1, "Scores",
wxDefaultPosition, wxSize(310, 200), wxDefaultPosition, wxSize(310, 200),
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE), wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE),
m_scoreFile(file) m_scoreFile(file)
@@ -142,7 +142,7 @@ ScoreDialog::ScoreDialog(
SetAutoLayout (TRUE); SetAutoLayout (TRUE);
ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile); ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile);
m_OK = new wxButton(this, wxID_OK, _T("OK")); m_OK = new wxButton(this, wxID_OK, "OK");
wxLayoutConstraints* layout; wxLayoutConstraints* layout;