Remove more wxT() macros from samples

Also use wxString instead of wxChar* strings.

Closes https://github.com/wxWidgets/wxWidgets/pull/950
This commit is contained in:
Blake Eryx
2018-09-28 21:45:15 -04:00
committed by Vadim Zeitlin
parent 480047ee9a
commit b70ed2d8c8
67 changed files with 1926 additions and 1932 deletions

View File

@@ -204,20 +204,20 @@ void BookWidgetsPage::CreateContent()
wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
// left pane
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style"));
wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style");
// must be in sync with Orient enum
wxArrayString orientations;
orientations.Add(wxT("&top"));
orientations.Add(wxT("&bottom"));
orientations.Add(wxT("&left"));
orientations.Add(wxT("&right"));
orientations.Add("&top");
orientations.Add("&bottom");
orientations.Add("&left");
orientations.Add("&right");
wxASSERT_MSG( orientations.GetCount() == Orient_Max,
wxT("forgot to update something") );
"forgot to update something" );
m_chkImages = new wxCheckBox(this, wxID_ANY, wxT("Show &images"));
m_radioOrient = new wxRadioBox(this, wxID_ANY, wxT("&Tab orientation"),
m_chkImages = new wxCheckBox(this, wxID_ANY, "Show &images");
m_radioOrient = new wxRadioBox(this, wxID_ANY, "&Tab orientation",
wxDefaultPosition, wxDefaultSize,
orientations, 1, wxRA_SPECIFY_COLS);
@@ -227,48 +227,48 @@ void BookWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
sizerLeft->Add(m_radioOrient, 0, wxALL, 5);
wxButton *btn = new wxButton(this, BookPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, BookPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Contents"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Contents");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxTextCtrl *text;
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Number of pages: "),
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Number of pages: ",
BookPage_NumPagesText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection: "),
sizerRow = CreateSizerWithTextAndLabel("Current selection: ",
BookPage_CurSelectText,
&text);
text->SetEditable(false);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage,
wxT("&Select page"),
"&Select page",
BookPage_SelectText,
&m_textSelect);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BookPage_AddPage, wxT("&Add page"));
btn = new wxButton(this, BookPage_AddPage, "&Add page");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage,
wxT("&Insert page at"),
"&Insert page at",
BookPage_InsertText,
&m_textInsert);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage,
wxT("&Remove page"),
"&Remove page",
BookPage_RemoveText,
&m_textRemove);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
btn = new wxButton(this, BookPage_DeleteAll, wxT("&Delete All"));
btn = new wxButton(this, BookPage_DeleteAll, "&Delete All");
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
// right pane
@@ -342,7 +342,7 @@ void BookWidgetsPage::RecreateBook()
switch ( m_radioOrient->GetSelection() )
{
default:
wxFAIL_MSG( wxT("unknown orientation") );
wxFAIL_MSG( "unknown orientation" );
// fall through
case Orient_Top:
@@ -429,7 +429,7 @@ int BookWidgetsPage::GetIconIndex() const
wxWindow *BookWidgetsPage::CreateNewPage()
{
return new wxTextCtrl(m_book, wxID_ANY, wxT("I'm a book page"));
return new wxTextCtrl(m_book, wxID_ANY, "I'm a book page");
}
// ----------------------------------------------------------------------------
@@ -451,30 +451,30 @@ void BookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event))
void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textSelect);
wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
wxCHECK_RET( IsValidValue(pos), "button should be disabled" );
m_book->SetSelection(pos);
}
void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event))
{
m_book->AddPage(CreateNewPage(), wxT("Added page"), false,
m_book->AddPage(CreateNewPage(), "Added page", false,
GetIconIndex());
}
void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textInsert);
wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
wxCHECK_RET( IsValidValue(pos), "button should be disabled" );
m_book->InsertPage(pos, CreateNewPage(), wxT("Inserted page"), false,
m_book->InsertPage(pos, CreateNewPage(), "Inserted page", false,
GetIconIndex());
}
void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event))
{
int pos = GetTextValue(m_textRemove);
wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") );
wxCHECK_RET( IsValidValue(pos), "button should be disabled" );
m_book->DeletePage(pos);
}
@@ -504,13 +504,13 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event)
void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event)
{
if(m_book)
event.SetText( wxString::Format(wxT("%u"), unsigned(m_book->GetPageCount())) );
event.SetText( wxString::Format("%u", unsigned(m_book->GetPageCount())) );
}
void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event)
{
if(m_book)
event.SetText( wxString::Format(wxT("%d"), m_book->GetSelection()) );
event.SetText( wxString::Format("%d", m_book->GetSelection()) );
}
void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
@@ -573,13 +573,13 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, wxT("Notebook"),
IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, "Notebook",
FAMILY_CTRLS | BOOK_CTRLS
);
void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event)
{
wxLogMessage(wxT("Notebook page changing from %d to %d (currently %d)."),
wxLogMessage("Notebook page changing from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -589,7 +589,7 @@ void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event)
void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event)
{
wxLogMessage(wxT("Notebook page changed from %d to %d (currently %d)."),
wxLogMessage("Notebook page changed from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -646,13 +646,13 @@ wxBEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage)
EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged)
wxEND_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, wxT("Listbook"),
IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, "Listbook",
GENERIC_CTRLS | BOOK_CTRLS
);
void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event)
{
wxLogMessage(wxT("Listbook page changing from %d to %d (currently %d)."),
wxLogMessage("Listbook page changing from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -662,7 +662,7 @@ void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event)
void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event)
{
wxLogMessage(wxT("Listbook page changed from %d to %d (currently %d)."),
wxLogMessage("Listbook page changed from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -719,13 +719,13 @@ wxBEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage)
EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged)
wxEND_EVENT_TABLE()
IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, wxT("Choicebook"),
IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, "Choicebook",
GENERIC_CTRLS | BOOK_CTRLS
);
void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event)
{
wxLogMessage(wxT("Choicebook page changing from %d to %d (currently %d)."),
wxLogMessage("Choicebook page changing from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());
@@ -735,7 +735,7 @@ void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event)
void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event)
{
wxLogMessage(wxT("Choicebook page changed from %d to %d (currently %d)."),
wxLogMessage("Choicebook page changed from %d to %d (currently %d).",
event.GetOldSelection(),
event.GetSelection(),
m_book->GetSelection());