Skip to content

Commit

Permalink
Globally replace _T() with wxT().
Browse files Browse the repository at this point in the history
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see wxWidgets#10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
  • Loading branch information
vadz committed Jul 23, 2009
1 parent 32cdc45 commit 9a83f86
Show file tree
Hide file tree
Showing 798 changed files with 10,394 additions and 10,373 deletions.
18 changes: 9 additions & 9 deletions build/bakefiles/wxpresets/sample/minimal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
// create the main application window
MyFrame *frame = new MyFrame(_T("Minimal wxWindows App"));
MyFrame *frame = new MyFrame(wxT("Minimal wxWindows App"));

// and show it (the frames, unlike simple controls, are not shown when
// created initially)
Expand Down Expand Up @@ -143,14 +143,14 @@ MyFrame::MyFrame(const wxString& title)

// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog"));
helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog"));

menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));

// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, _T("&File"));
menuBar->Append(helpMenu, _T("&Help"));
menuBar->Append(menuFile, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help"));

// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
Expand All @@ -159,7 +159,7 @@ MyFrame::MyFrame(const wxString& title)
#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
SetStatusText(_T("Welcome to wxWindows!"));
SetStatusText(wxT("Welcome to wxWindows!"));
#endif // wxUSE_STATUSBAR
}

Expand All @@ -175,8 +175,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
msg.Printf( _T("This is the About dialog of the minimal sample.\n")
_T("Welcome to %s"), wxVERSION_STRING);
msg.Printf( wxT("This is the About dialog of the minimal sample.\n")
wxT("Welcome to %s"), wxVERSION_STRING);

wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this);
wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this);
}
6 changes: 3 additions & 3 deletions demos/forty/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ FortyCanvas::FortyCanvas(wxWindow* parent, const wxPoint& pos, const wxSize& siz
m_arrowCursor = new wxCursor(wxCURSOR_ARROW);

wxString name = wxTheApp->GetAppName();
if (name.Length() <= 0) name = _T("forty");
if (name.Length() <= 0) name = wxT("forty");
m_scoreFile = new ScoreFile(name);
m_game = new Game(0, 0, 0);
m_game->Deal();
Expand Down Expand Up @@ -156,8 +156,8 @@ Called when the main frame is closed
bool FortyCanvas::OnCloseCanvas()
{
if (m_game->InPlay() &&
wxMessageBox(_T("Are you sure you want to\nabandon the current game?"),
_T("Warning"), wxYES_NO | wxICON_QUESTION) == wxNO)
wxMessageBox(wxT("Are you sure you want to\nabandon the current game?"),
wxT("Warning"), wxYES_NO | wxICON_QUESTION) == wxNO)
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions demos/forty/card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ Card::Card(int value, WayUp way_up) :
m_symbolBmap = new wxBitmap(symbols_xpm);
if (!m_symbolBmap->Ok())
{
::wxMessageBox(_T("Failed to load bitmap CardSymbols"), _T("Error"));
::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error"));
}
}
if (!m_pictureBmap)
{
m_pictureBmap = new wxBitmap(Pictures);
if (!m_pictureBmap->Ok())
{
::wxMessageBox(_T("Failed to load bitmap CardPictures"), _T("Error"));
::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error"));
}
}

Expand Down
54 changes: 27 additions & 27 deletions demos/forty/forty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ bool FortyApp::OnInit()

wxSize size(668,510);

if ((argc > 1) && (!wxStrcmp(argv[1],_T("-L"))))
if ((argc > 1) && (!wxStrcmp(argv[1],wxT("-L"))))
{
largecards = true;
size = wxSize(1000,750);
}

FortyFrame* frame = new FortyFrame(
0,
_T("Forty Thieves"),
wxT("Forty Thieves"),
wxDefaultPosition,
size,
largecards
Expand Down Expand Up @@ -140,50 +140,50 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos
#endif
// set the icon
#ifdef __WXMSW__
SetIcon(wxIcon(_T("CardsIcon")));
SetIcon(wxIcon(wxT("CardsIcon")));
#else
SetIcon(wxIcon(forty_xpm));
#endif

// Make a menu bar
wxMenu* gameMenu = new wxMenu;
gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _T("Start a new game"));
gameMenu->Append(SCORES, _T("&Scores..."), _T("Displays scores"));
gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), _T("Exits Forty Thieves"));
gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), wxT("Start a new game"));
gameMenu->Append(SCORES, wxT("&Scores..."), wxT("Displays scores"));
gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), wxT("Exits Forty Thieves"));

wxMenu* editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), _T("Undo the last move"));
editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), _T("Redo a move that has been undone"));
editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), wxT("Undo the last move"));
editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), wxT("Redo a move that has been undone"));

wxMenu* optionsMenu = new wxMenu;
optionsMenu->Append(RIGHT_BUTTON_UNDO,
_T("&Right button undo"),
_T("Enables/disables right mouse button undo and redo"),
wxT("&Right button undo"),
wxT("Enables/disables right mouse button undo and redo"),
true
);
optionsMenu->Append(HELPING_HAND,
_T("&Helping hand"),
_T("Enables/disables hand cursor when a card can be moved"),
wxT("&Helping hand"),
wxT("Enables/disables hand cursor when a card can be moved"),
true
);
optionsMenu->Append(LARGE_CARDS,
_T("&Large cards"),
_T("Enables/disables large cards for high resolution displays"),
wxT("&Large cards"),
wxT("Enables/disables large cards for high resolution displays"),
true
);
optionsMenu->Check(HELPING_HAND, true);
optionsMenu->Check(RIGHT_BUTTON_UNDO, true);
optionsMenu->Check(LARGE_CARDS, largecards ? true : false);

wxMenu* helpMenu = new wxMenu;
helpMenu->Append(wxID_HELP_CONTENTS, _T("&Help Contents"), _T("Displays information about playing the game"));
helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About Forty Thieves"));
helpMenu->Append(wxID_HELP_CONTENTS, wxT("&Help Contents"), wxT("Displays information about playing the game"));
helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("About Forty Thieves"));

m_menuBar = new wxMenuBar;
m_menuBar->Append(gameMenu, _T("&Game"));
m_menuBar->Append(editMenu, _T("&Edit"));
m_menuBar->Append(optionsMenu, _T("&Options"));
m_menuBar->Append(helpMenu, _T("&Help"));
m_menuBar->Append(gameMenu, wxT("&Game"));
m_menuBar->Append(editMenu, wxT("&Edit"));
m_menuBar->Append(optionsMenu, wxT("&Options"));
m_menuBar->Append(helpMenu, wxT("&Help"));

SetMenuBar(m_menuBar);

Expand Down Expand Up @@ -247,11 +247,11 @@ void
FortyFrame::About(wxCommandEvent&)
{
wxMessageBox(
_T("Forty Thieves\n\n")
_T("A free card game written with the wxWidgets toolkit\n")
_T("Author: Chris Breeze (c) 1992-2004\n")
_T("email: [email protected]"),
_T("About Forty Thieves"),
wxT("Forty Thieves\n\n")
wxT("A free card game written with the wxWidgets toolkit\n")
wxT("Author: Chris Breeze (c) 1992-2004\n")
wxT("email: [email protected]"),
wxT("About Forty Thieves"),
wxOK|wxICON_INFORMATION, this
);
}
Expand Down Expand Up @@ -326,7 +326,7 @@ bool FortyAboutDialog::AddControls(wxWindow* parent)
file.Open();
for ( htmlText = file.GetFirstLine();
!file.Eof();
htmlText << file.GetNextLine() << _T("\n") ) ;
htmlText << file.GetNextLine() << wxT("\n") ) ;
}
}

Expand All @@ -336,7 +336,7 @@ bool FortyAboutDialog::AddControls(wxWindow* parent)
}

// Customize the HTML
htmlText.Replace(wxT("$DATE$"), _T(__DATE__));
htmlText.Replace(wxT("$DATE$"), wxT(__DATE__));

wxSize htmlSize(400, 290);

Expand Down
30 changes: 15 additions & 15 deletions demos/forty/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest)
{
if (src == dest)
{
wxMessageBox(_T("Game::DoMove() src == dest"), _T("Debug message"),
wxMessageBox(wxT("Game::DoMove() src == dest"), wxT("Debug message"),
wxOK | wxICON_EXCLAMATION);
}
m_moves[m_moveIndex].src = src;
Expand All @@ -170,7 +170,7 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest)
}
else
{
wxMessageBox(_T("Game::DoMove() Undo buffer full"), _T("Debug message"),
wxMessageBox(wxT("Game::DoMove() Undo buffer full"), wxT("Debug message"),
wxOK | wxICON_EXCLAMATION);
}

Expand Down Expand Up @@ -198,8 +198,8 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest)
// Redraw the score box to update games won
DisplayScore(dc);

if (wxMessageBox(_T("Do you wish to play again?"),
_T("Well Done, You have won!"), wxYES_NO | wxICON_QUESTION) == wxYES)
if (wxMessageBox(wxT("Do you wish to play again?"),
wxT("Well Done, You have won!"), wxYES_NO | wxICON_QUESTION) == wxYES)
{
Deal();
canvas->Refresh();
Expand Down Expand Up @@ -236,25 +236,25 @@ void Game::DisplayScore(wxDC& dc)
wxCoord w, h;
{
wxCoord width, height;
dc.GetTextExtent(_T("Average score:m_x"), &width, &height);
dc.GetTextExtent(wxT("Average score:m_x"), &width, &height);
w = width;
h = height;
}
dc.DrawRectangle(x + w, y, 20, 4 * h);

wxString str;
str.Printf(_T("%d"), m_currentScore);
dc.DrawText(_T("Score:"), x, y);
str.Printf(wxT("%d"), m_currentScore);
dc.DrawText(wxT("Score:"), x, y);
dc.DrawText(str, x + w, y);
y += h;

str.Printf(_T("%d"), m_numGames);
dc.DrawText(_T("Games played:"), x, y);
str.Printf(wxT("%d"), m_numGames);
dc.DrawText(wxT("Games played:"), x, y);
dc.DrawText(str, x + w, y);
y += h;

str.Printf(_T("%d"), m_numWins);
dc.DrawText(_T("Games won:"), x, y);
str.Printf(wxT("%d"), m_numWins);
dc.DrawText(wxT("Games won:"), x, y);
dc.DrawText(str, x + w, y);
y += h;

Expand All @@ -263,8 +263,8 @@ void Game::DisplayScore(wxDC& dc)
{
average = (2 * (m_currentScore + m_totalScore) + m_numGames ) / (2 * m_numGames);
}
str.Printf(_T("%d"), average);
dc.DrawText(_T("Average score:"), x, y);
str.Printf(wxT("%d"), average);
dc.DrawText(wxT("Average score:"), x, y);
dc.DrawText(str, x + w, y);
}

Expand Down Expand Up @@ -794,7 +794,7 @@ void Pack::Redraw(wxDC& dc)
Pile::Redraw(dc);

wxString str;
str.Printf(_T("%d "), m_topCard + 1);
str.Printf(wxT("%d "), m_topCard + 1);

dc.SetBackgroundMode( wxSOLID );
dc.SetTextBackground(FortyApp::BackgroundColour());
Expand All @@ -811,7 +811,7 @@ void Pack::AddCard(Card* card)
}
else
{
wxMessageBox(_T("Pack::AddCard() Undo error"), _T("Forty Thieves: Warning"),
wxMessageBox(wxT("Pack::AddCard() Undo error"), wxT("Forty Thieves: Warning"),
wxOK | wxICON_EXCLAMATION);
}
card->TurnCard(facedown);
Expand Down
10 changes: 5 additions & 5 deletions demos/forty/playerdg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ PlayerSelectionDialog::PlayerSelectionDialog(
wxWindow* parent,
ScoreFile* file
) :
wxDialog(parent, wxID_ANY, _T("Player Selection"), wxDefaultPosition),
wxDialog(parent, wxID_ANY, wxT("Player Selection"), wxDefaultPosition),
m_scoreFile(file)
{
wxStaticText* msg = new wxStaticText(this, wxID_ANY, _T("Please select a name or type a new one:"));
wxStaticText* msg = new wxStaticText(this, wxID_ANY, wxT("Please select a name or type a new one:"));

wxListBox* list = new wxListBox(
this, ID_LISTBOX,
Expand Down Expand Up @@ -116,9 +116,9 @@ void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event)
wxString name = m_textField->GetValue();
if (!name.IsNull() && name.Length() > 0)
{
if (name.Contains(_T('@')))
if (name.Contains(wxT('@')))
{
wxMessageBox(_T("Names should not contain the '@' character"), _T("Forty Thieves"));
wxMessageBox(wxT("Names should not contain the '@' character"), wxT("Forty Thieves"));
}
else
{
Expand All @@ -128,7 +128,7 @@ void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event)
}
else
{
wxMessageBox(_T("Please enter your name"), _T("Forty Thieves"));
wxMessageBox(wxT("Please enter your name"), wxT("Forty Thieves"));
}
}
else
Expand Down
14 changes: 7 additions & 7 deletions demos/forty/scoredg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) :
average = (2 * score + games) / (2 * games);
}
list->SetCellValue(i,0,players[i]);
string_value.Printf( _T("%u"), wins );
string_value.Printf( wxT("%u"), wins );
list->SetCellValue(i,1,string_value);
string_value.Printf( _T("%u"), games );
string_value.Printf( wxT("%u"), games );
list->SetCellValue(i,2,string_value);
string_value.Printf( _T("%u"), average );
string_value.Printf( wxT("%u"), average );
list->SetCellValue(i,3,string_value);
}
list->SetColLabelValue(0, _T("Players"));
list->SetColLabelValue(1, _T("Wins"));
list->SetColLabelValue(2, _T("Games"));
list->SetColLabelValue(3, _T("Score"));
list->SetColLabelValue(0, wxT("Players"));
list->SetColLabelValue(1, wxT("Wins"));
list->SetColLabelValue(2, wxT("Games"));
list->SetColLabelValue(3, wxT("Score"));
list->SetEditable(false);
list->AutoSizeColumns();
list->AutoSizeRows();
Expand Down
Loading

0 comments on commit 9a83f86

Please sign in to comment.