Remove (most) occurrences of wxT() macro from the samples

Also replace wxChar* with wxString.

Closes https://github.com/wxWidgets/wxWidgets/pull/945
This commit is contained in:
Blake-Eryx
2018-09-23 01:15:08 +02:00
committed by Vadim Zeitlin
parent e768046774
commit f58ea62596
93 changed files with 4362 additions and 4358 deletions

View File

@@ -73,7 +73,7 @@ wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent)
panel->SetHelpText( wxT( "Panel with a Button" ) );
#endif
(void) new wxButton( panel, wxID_ANY, wxT("Button"),
(void) new wxButton( panel, wxID_ANY, "Button",
wxPoint(10, 10), wxDefaultSize );
return panel;
@@ -88,18 +88,18 @@ wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent)
#endif
wxString animals[] =
{ wxT("Fox"), wxT("Hare"), wxT("Rabbit"),
wxT("Sabre-toothed tiger"), wxT("T Rex") };
{ "Fox", "Hare", "Rabbit",
"Sabre-toothed tiger", "T Rex" };
wxRadioBox *radiobox1 = new wxRadioBox(panel, wxID_ANY, wxT("Choose one"),
wxRadioBox *radiobox1 = new wxRadioBox(panel, wxID_ANY, "Choose one",
wxDefaultPosition, wxDefaultSize, 5, animals, 2, wxRA_SPECIFY_ROWS);
wxString computers[] =
{ wxT("Amiga"), wxT("Commodore 64"), wxT("PET"),
wxT("Another") };
{ "Amiga", "Commodore 64", "PET",
"Another" };
wxRadioBox *radiobox2 = new wxRadioBox(panel, wxID_ANY,
wxT("Choose your favourite"), wxDefaultPosition, wxDefaultSize,
"Choose your favourite", wxDefaultPosition, wxDefaultSize,
4, computers, 0, wxRA_SPECIFY_COLS);
wxBoxSizer *sizerPanel = new wxBoxSizer(wxVERTICAL);
@@ -119,7 +119,7 @@ wxPanel *CreateVetoPage(wxBookCtrlBase *parent)
#endif
(void) new wxStaticText( panel, wxID_ANY,
wxT("This page intentionally left blank"),
"This page intentionally left blank",
wxPoint(10, 10) );
return panel;
@@ -133,7 +133,7 @@ wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent)
panel->SetHelpText( wxT( "Panel with a maximized button" ) );
#endif
wxButton *buttonBig = new wxButton(panel, wxID_ANY, wxT("Maximized button"));
wxButton *buttonBig = new wxButton(panel, wxID_ANY, "Maximized button");
wxBoxSizer *sizerPanel = new wxBoxSizer(wxVERTICAL);
sizerPanel->Add(buttonBig, 1, wxEXPAND);
@@ -150,9 +150,9 @@ wxPanel *CreateInsertPage(wxBookCtrlBase *parent)
panel->SetHelpText( wxT( "Maroon panel" ) );
#endif
panel->SetBackgroundColour( wxColour( wxT("MAROON") ) );
panel->SetBackgroundColour( wxColour( "MAROON" ) );
(void) new wxStaticText( panel, wxID_ANY,
wxT("This page has been inserted, not added."),
"This page has been inserted, not added.",
wxPoint(10, 10) );
return panel;
@@ -211,7 +211,7 @@ wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName)
if ( pageName == MAXIMIZED_BUTTON_PAGE_NAME )
return CreateBigButtonPage(parent);
wxFAIL_MSG( wxT("unknown page name") );
wxFAIL_MSG( "unknown page name" );
return NULL;
}
@@ -282,7 +282,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
wxEND_EVENT_TABLE()
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, wxString(wxT("wxWidgets book controls sample")))
: wxFrame(NULL, wxID_ANY, wxString("wxWidgets book controls sample"))
{
#if wxUSE_HELP
SetExtraStyle(wxFRAME_EX_CONTEXTHELP);
@@ -317,83 +317,83 @@ MyFrame::MyFrame()
// menu of the sample
wxMenu *menuType = new wxMenu;
#if wxUSE_NOTEBOOK
menuType->AppendRadioItem(ID_BOOK_NOTEBOOK, wxT("&Notebook\tCtrl-1"));
menuType->AppendRadioItem(ID_BOOK_NOTEBOOK, "&Notebook\tCtrl-1");
#endif
#if wxUSE_LISTBOOK
menuType->AppendRadioItem(ID_BOOK_LISTBOOK, wxT("&Listbook\tCtrl-2"));
menuType->AppendRadioItem(ID_BOOK_LISTBOOK, "&Listbook\tCtrl-2");
#endif
#if wxUSE_CHOICEBOOK
menuType->AppendRadioItem(ID_BOOK_CHOICEBOOK, wxT("&Choicebook\tCtrl-3"));
menuType->AppendRadioItem(ID_BOOK_CHOICEBOOK, "&Choicebook\tCtrl-3");
#endif
#if wxUSE_TREEBOOK
menuType->AppendRadioItem(ID_BOOK_TREEBOOK, wxT("&Treebook\tCtrl-4"));
menuType->AppendRadioItem(ID_BOOK_TREEBOOK, "&Treebook\tCtrl-4");
#endif
#if wxUSE_TOOLBOOK
menuType->AppendRadioItem(ID_BOOK_TOOLBOOK, wxT("T&oolbook\tCtrl-5"));
menuType->AppendRadioItem(ID_BOOK_TOOLBOOK, "T&oolbook\tCtrl-5");
#endif
#if wxUSE_AUI
menuType->AppendRadioItem(ID_BOOK_AUINOTEBOOK, wxT("&AuiNotebook\tCtrl-6"));
menuType->AppendRadioItem(ID_BOOK_AUINOTEBOOK, "&AuiNotebook\tCtrl-6");
#endif
menuType->AppendRadioItem(ID_BOOK_SIMPLEBOOK, "&Simple book\tCtrl-7");
menuType->Check(ID_BOOK_NOTEBOOK + m_type, true);
wxMenu *menuOrient = new wxMenu;
menuOrient->AppendRadioItem(ID_ORIENT_DEFAULT, wxT("&Default\tAlt-0"));
menuOrient->AppendRadioItem(ID_ORIENT_TOP, wxT("&Top\tAlt-1"));
menuOrient->AppendRadioItem(ID_ORIENT_BOTTOM, wxT("&Bottom\tAlt-2"));
menuOrient->AppendRadioItem(ID_ORIENT_LEFT, wxT("&Left\tAlt-3"));
menuOrient->AppendRadioItem(ID_ORIENT_RIGHT, wxT("&Right\tAlt-4"));
menuOrient->AppendRadioItem(ID_ORIENT_DEFAULT, "&Default\tAlt-0");
menuOrient->AppendRadioItem(ID_ORIENT_TOP, "&Top\tAlt-1");
menuOrient->AppendRadioItem(ID_ORIENT_BOTTOM, "&Bottom\tAlt-2");
menuOrient->AppendRadioItem(ID_ORIENT_LEFT, "&Left\tAlt-3");
menuOrient->AppendRadioItem(ID_ORIENT_RIGHT, "&Right\tAlt-4");
wxMenu *menuStyle = new wxMenu;
#if wxUSE_NOTEBOOK
menuStyle->AppendCheckItem(ID_FIXEDWIDTH, wxT("&Fixed Width (wxNotebook)"));
menuStyle->AppendCheckItem(ID_MULTI, wxT("&Multiple lines (wxNotebook)"));
menuStyle->AppendCheckItem(ID_NOPAGETHEME, wxT("&No Page Theme (wxNotebook)"));
menuStyle->AppendCheckItem(ID_FIXEDWIDTH, "&Fixed Width (wxNotebook)");
menuStyle->AppendCheckItem(ID_MULTI, "&Multiple lines (wxNotebook)");
menuStyle->AppendCheckItem(ID_NOPAGETHEME, "&No Page Theme (wxNotebook)");
#endif
#if wxUSE_TOOLBOOK
menuStyle->AppendCheckItem(ID_BUTTONBAR, wxT("&Button Bar (wxToolbook)"));
menuStyle->AppendCheckItem(ID_HORZ_LAYOUT, wxT("&Horizontal layout (wxToolbook)"));
menuStyle->AppendCheckItem(ID_BUTTONBAR, "&Button Bar (wxToolbook)");
menuStyle->AppendCheckItem(ID_HORZ_LAYOUT, "&Horizontal layout (wxToolbook)");
#endif
wxMenu *menuPageOperations = new wxMenu;
menuPageOperations->Append(ID_ADD_PAGE, wxT("&Add page\tAlt-A"));
menuPageOperations->Append(ID_ADD_PAGE_NO_SELECT, wxT("&Add page (don't select)\tAlt-B"));
menuPageOperations->Append(ID_INSERT_PAGE, wxT("&Insert page\tAlt-I"));
menuPageOperations->Append(ID_DELETE_CUR_PAGE, wxT("&Delete current page\tAlt-D"));
menuPageOperations->Append(ID_DELETE_LAST_PAGE, wxT("D&elete last page\tAlt-L"));
menuPageOperations->Append(ID_NEXT_PAGE, wxT("&Next page\tAlt-N"));
menuPageOperations->Append(ID_ADD_PAGE, "&Add page\tAlt-A");
menuPageOperations->Append(ID_ADD_PAGE_NO_SELECT, "&Add page (don't select)\tAlt-B");
menuPageOperations->Append(ID_INSERT_PAGE, "&Insert page\tAlt-I");
menuPageOperations->Append(ID_DELETE_CUR_PAGE, "&Delete current page\tAlt-D");
menuPageOperations->Append(ID_DELETE_LAST_PAGE, "D&elete last page\tAlt-L");
menuPageOperations->Append(ID_NEXT_PAGE, "&Next page\tAlt-N");
#if wxUSE_TREEBOOK
menuPageOperations->AppendSeparator();
menuPageOperations->Append(ID_ADD_PAGE_BEFORE, wxT("Insert page &before\tAlt-B"));
menuPageOperations->Append(ID_ADD_SUB_PAGE, wxT("Add s&ub page\tAlt-U"));
menuPageOperations->Append(ID_ADD_PAGE_BEFORE, "Insert page &before\tAlt-B");
menuPageOperations->Append(ID_ADD_SUB_PAGE, "Add s&ub page\tAlt-U");
#endif
menuPageOperations->AppendSeparator();
menuPageOperations->Append(ID_CHANGE_SELECTION, wxT("&Change selection to 0\tCtrl-0"));
menuPageOperations->Append(ID_SET_SELECTION, wxT("&Set selection to 0\tShift-Ctrl-0"));
menuPageOperations->Append(ID_CHANGE_SELECTION, "&Change selection to 0\tCtrl-0");
menuPageOperations->Append(ID_SET_SELECTION, "&Set selection to 0\tShift-Ctrl-0");
menuPageOperations->AppendSeparator();
menuPageOperations->Append(ID_GET_PAGE_SIZE, "Sho&w page size");
menuPageOperations->Append(ID_SET_PAGE_SIZE, "Set &page size");
wxMenu *menuOperations = new wxMenu;
#if wxUSE_HELP
menuOperations->Append(ID_CONTEXT_HELP, wxT("&Context help\tCtrl-F1"));
menuOperations->Append(ID_CONTEXT_HELP, "&Context help\tCtrl-F1");
#endif // wxUSE_HELP
menuOperations->Append(ID_HITTEST, wxT("&Hit test\tCtrl-H"));
menuOperations->Append(ID_HITTEST, "&Hit test\tCtrl-H");
wxMenu *menuFile = new wxMenu;
menuFile->Append(wxID_ANY, wxT("&Type"), menuType, wxT("Type of control"));
menuFile->Append(wxID_ANY, wxT("&Orientation"), menuOrient, wxT("Orientation of control"));
menuFile->AppendCheckItem(ID_SHOW_IMAGES, wxT("&Show images\tAlt-S"));
menuFile->Append(wxID_ANY, wxT("&Style"), menuStyle, wxT("Style of control"));
menuFile->Append(wxID_ANY, "&Type", menuType, "Type of control");
menuFile->Append(wxID_ANY, "&Orientation", menuOrient, "Orientation of control");
menuFile->AppendCheckItem(ID_SHOW_IMAGES, "&Show images\tAlt-S");
menuFile->Append(wxID_ANY, "&Style", menuStyle, "Style of control");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT, wxT("E&xit"), wxT("Quits the application"));
menuFile->Append(wxID_EXIT, "E&xit", "Quits the application");
menuFile->Check(ID_SHOW_IMAGES, m_chkShowImages);
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, wxT("&File"));
menuBar->Append(menuPageOperations, wxT("&Pages"));
menuBar->Append(menuOperations, wxT("&Operations"));
menuBar->Append(menuFile, "&File");
menuBar->Append(menuPageOperations, "&Pages");
menuBar->Append(menuOperations, "&Operations");
SetMenuBar(menuBar);
// books creation
@@ -503,7 +503,7 @@ MyFrame::~MyFrame()
CASE_SIMPLEBOOK(before sb after) \
\
default: \
wxFAIL_MSG( wxT("unknown book control type") ); \
wxFAIL_MSG( "unknown book control type" ); \
}
void MyFrame::RecreateBook()
@@ -627,12 +627,12 @@ void MyFrame::RecreateBook()
}
void MyFrame::AddFlagStrIfFlagPresent(wxString & flagStr, long flags, long flag,
const wxChar * flagName) const
const wxString& flagName) const
{
if( (flags & flag) == flag )
{
if( !flagStr.empty() )
flagStr += wxT(" | ");
flagStr += " | ";
flagStr += flagName;
}
}
@@ -645,8 +645,8 @@ wxPanel *MyFrame::CreateNewPage() const
panel->SetHelpText( wxT( "Panel with \"First\" and \"Second\" buttons" ) );
#endif
(void) new wxButton(panel, wxID_ANY, wxT("First button"), wxPoint(10, 30));
(void) new wxButton(panel, wxID_ANY, wxT("Second button"), wxPoint(150, 30));
(void) new wxButton(panel, wxID_ANY, "First button", wxPoint(10, 30));
(void) new wxButton(panel, wxID_ANY, "Second button", wxPoint(150, 30));
return panel;
}
@@ -676,13 +676,13 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event))
wxString flagsStr;
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, wxT("wxBK_HITTEST_NOWHERE") );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, wxT("wxBK_HITTEST_ONICON") );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, wxT("wxBK_HITTEST_ONLABEL") );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONITEM, wxT("wxBK_HITTEST_ONITEM") );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, wxT("wxBK_HITTEST_ONPAGE") );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, "wxBK_HITTEST_NOWHERE" );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, "wxBK_HITTEST_ONICON" );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, "wxBK_HITTEST_ONLABEL" );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONITEM, "wxBK_HITTEST_ONITEM" );
AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, "wxBK_HITTEST_ONPAGE" );
wxLogMessage(wxT("HitTest at (%d,%d): %d: %s"),
wxLogMessage("HitTest at (%d,%d): %d: %s",
pt.x,
pt.y,
pagePos,
@@ -754,7 +754,7 @@ void MyFrame::OnAddPage(wxCommandEvent& WXUNUSED(event))
currBook->AddPage(CreateNewPage(),
wxString::Format
(
ADDED_PAGE_NAME wxT("%u"),
ADDED_PAGE_NAME "%u",
++s_pageAdded
),
true,
@@ -772,7 +772,7 @@ void MyFrame::OnAddPageNoSelect(wxCommandEvent& WXUNUSED(event))
currBook->AddPage(CreateNewPage(),
wxString::Format
(
ADDED_PAGE_NAME wxT("%u"),
ADDED_PAGE_NAME "%u",
++s_pageAdded
),
false,
@@ -789,7 +789,7 @@ void MyFrame::OnAddSubPage(wxCommandEvent& WXUNUSED(event))
const int selPos = currBook->GetSelection();
if ( selPos == wxNOT_FOUND )
{
wxLogError(wxT("Select the parent page first!"));
wxLogError("Select the parent page first!");
return;
}
@@ -800,7 +800,7 @@ void MyFrame::OnAddSubPage(wxCommandEvent& WXUNUSED(event))
CreateNewPage(),
wxString::Format
(
ADDED_SUB_PAGE_NAME wxT("%u"),
ADDED_SUB_PAGE_NAME "%u",
++s_subPageAdded
),
true,
@@ -817,7 +817,7 @@ void MyFrame::OnAddPageBefore(wxCommandEvent& WXUNUSED(event))
const int selPos = currBook->GetSelection();
if ( selPos == wxNOT_FOUND )
{
wxLogError(wxT("Select the parent page first!"));
wxLogError("Select the parent page first!");
return;
}
@@ -826,7 +826,7 @@ void MyFrame::OnAddPageBefore(wxCommandEvent& WXUNUSED(event))
CreateNewPage(),
wxString::Format
(
ADDED_PAGE_NAME_BEFORE wxT("%u"),
ADDED_PAGE_NAME_BEFORE "%u",
++s_subPageAdded
),
true,
@@ -846,7 +846,7 @@ void MyFrame::OnInsertPage(wxCommandEvent& WXUNUSED(event))
wxPanel *panel = CreateUserCreatedPage( currBook );
currBook->InsertPage( 0, panel,
wxString::Format(INSERTED_PAGE_NAME wxT("%u"), ++s_pageIns), false,
wxString::Format(INSERTED_PAGE_NAME "%u", ++s_pageIns), false,
GetIconIndex(currBook) );
currBook->SetSelection(0);
@@ -955,12 +955,12 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
wxString selection;
if ( nSel == wxNOT_FOUND )
selection << wxT("not found");
selection << "not found";
else
selection << nSel;
wxString title;
title.Printf(wxT("Notebook and friends (%d pages, selection: %s)"), nPages, selection.c_str());
title.Printf("Notebook and friends (%d pages, selection: %s)", nPages, selection.c_str());
SetTitle(title);
}
@@ -972,49 +972,49 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event)
{
wxEventType typeChanged,
typeChanging;
const wxChar *name;
const wxString name;
} events[] =
{
#if wxUSE_NOTEBOOK
{
wxEVT_NOTEBOOK_PAGE_CHANGED,
wxEVT_NOTEBOOK_PAGE_CHANGING,
wxT("wxNotebook")
"wxNotebook"
},
#endif // wxUSE_NOTEBOOK
#if wxUSE_LISTBOOK
{
wxEVT_LISTBOOK_PAGE_CHANGED,
wxEVT_LISTBOOK_PAGE_CHANGING,
wxT("wxListbook")
"wxListbook"
},
#endif // wxUSE_LISTBOOK
#if wxUSE_CHOICEBOOK
{
wxEVT_CHOICEBOOK_PAGE_CHANGED,
wxEVT_CHOICEBOOK_PAGE_CHANGING,
wxT("wxChoicebook")
"wxChoicebook"
},
#endif // wxUSE_CHOICEBOOK
#if wxUSE_TREEBOOK
{
wxEVT_TREEBOOK_PAGE_CHANGED,
wxEVT_TREEBOOK_PAGE_CHANGING,
wxT("wxTreebook")
"wxTreebook"
},
#endif // wxUSE_TREEBOOK
#if wxUSE_TOOLBOOK
{
wxEVT_TOOLBOOK_PAGE_CHANGED,
wxEVT_TOOLBOOK_PAGE_CHANGING,
wxT("wxToolbook")
"wxToolbook"
},
#endif // wxUSE_TOOLBOOK
#if wxUSE_AUI
{
wxEVT_AUINOTEBOOK_PAGE_CHANGED,
wxEVT_AUINOTEBOOK_PAGE_CHANGING,
wxT("wxAuiNotebook")
"wxAuiNotebook"
},
#endif // wxUSE_AUI
};
@@ -1035,7 +1035,7 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event)
const EventInfo& ei = events[n];
if ( eventType == ei.typeChanged )
{
nameEvent = wxT("Changed");
nameEvent = "Changed";
}
else if ( eventType == ei.typeChanging )
{
@@ -1046,19 +1046,19 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event)
{
if ( wxMessageBox
(
wxT("Are you sure you want to leave this page?\n")
wxT("(This demonstrates veto-ing)"),
wxT("Notebook sample"),
"Are you sure you want to leave this page?\n"
"(This demonstrates veto-ing)",
"Notebook sample",
wxICON_QUESTION | wxYES_NO,
this
) != wxYES )
{
event.Veto();
veto = wxT(" (vetoed)");
veto = " (vetoed)";
}
}
nameEvent = wxT("Changing");
nameEvent = "Changing";
}
else // skip end of the loop
{
@@ -1071,7 +1071,7 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event)
static int s_num = 0;
wxLogMessage(wxT("Event #%d: %s: %s (%d) new sel %d, old %d, current %d%s"),
wxLogMessage("Event #%d: %s: %s (%d) new sel %d, old %d, current %d%s",
++s_num,
nameControl.c_str(),
nameEvent.c_str(),