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

@@ -197,7 +197,7 @@ wxEND_EVENT_TABLE()
#define FAMILY_CTRLS NATIVE_CTRLS
#endif
IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, wxT("Button"), FAMILY_CTRLS );
IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, "Button", FAMILY_CTRLS );
ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
wxImageList *imaglist)
@@ -236,21 +236,21 @@ void ButtonWidgetsPage::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");
wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL);
m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only");
m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap");
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly"));
m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Require a&uth"));
m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly");
m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, "Require a&uth");
#if wxUSE_COMMANDLINKBUTTON
m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Use command &link button"));
m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, "Use command &link button");
#endif
#if wxUSE_MARKUP
m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup");
#endif // wxUSE_MARKUP
m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default"));
m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, "&Default");
m_chkUseBitmapClass = CreateCheckBoxAndAddToSizer(sizerLeft,
"Use wxBitmapButton");
@@ -286,22 +286,22 @@ void ButtonWidgetsPage::CreateContent()
// should be in sync with enums Button[HV]Align!
static const wxString halign[] =
{
wxT("left"),
wxT("centre"),
wxT("right"),
"left",
"centre",
"right",
};
static const wxString valign[] =
{
wxT("top"),
wxT("centre"),
wxT("bottom"),
"top",
"centre",
"bottom",
};
m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"),
m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(halign), halign);
m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"),
m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment",
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(valign), valign);
@@ -310,26 +310,26 @@ void ButtonWidgetsPage::CreateContent()
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
wxButton *btn = new wxButton(this, ButtonPage_Reset, wxT("&Reset"));
wxButton *btn = new wxButton(this, ButtonPage_Reset, "&Reset");
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
// middle pane
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations"));
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations");
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel,
wxT("Change label"),
"Change label",
wxID_ANY,
&m_textLabel);
m_textLabel->SetValue(wxT("&Press me!"));
m_textLabel->SetValue("&Press me!");
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
#if wxUSE_COMMANDLINKBUTTON
m_sizerNote = CreateSizerWithTextAndButton(ButtonPage_ChangeNote,
wxT("Change note"),
"Change note",
wxID_ANY,
&m_textNote);
m_textNote->SetValue(wxT("Writes down button clicks in the log."));
m_textNote->SetValue("Writes down button clicks in the log.");
sizerMiddle->Add(m_sizerNote, 0, wxALL | wxGROW, 5);
#endif
@@ -415,7 +415,7 @@ void ButtonWidgetsPage::CreateButton()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case ButtonHAlign_Centre:
@@ -433,7 +433,7 @@ void ButtonWidgetsPage::CreateButton()
break;
default:
wxFAIL_MSG(wxT("unexpected radiobox selection"));
wxFAIL_MSG("unexpected radiobox selection");
// fall through
case ButtonVAlign_Centre:
@@ -456,22 +456,22 @@ void ButtonWidgetsPage::CreateButton()
if ( m_chkUseBitmapClass->GetValue() )
{
bbtn = new wxBitmapButton(this, ButtonPage_Button,
CreateBitmap(wxT("normal")),
CreateBitmap("normal"),
wxDefaultPosition, wxDefaultSize, flags);
}
else
{
bbtn = new wxButton(this, ButtonPage_Button);
bbtn->SetBitmapLabel(CreateBitmap(wxT("normal")));
bbtn->SetBitmapLabel(CreateBitmap("normal"));
}
if ( m_chkUsePressed->GetValue() )
bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed")));
bbtn->SetBitmapPressed(CreateBitmap("pushed"));
if ( m_chkUseFocused->GetValue() )
bbtn->SetBitmapFocus(CreateBitmap(wxT("focused")));
bbtn->SetBitmapFocus(CreateBitmap("focused"));
if ( m_chkUseCurrent->GetValue() )
bbtn->SetBitmapCurrent(CreateBitmap(wxT("hover")));
bbtn->SetBitmapCurrent(CreateBitmap("hover"));
if ( m_chkUseDisabled->GetValue() )
bbtn->SetBitmapDisabled(CreateBitmap(wxT("disabled")));
bbtn->SetBitmapDisabled(CreateBitmap("disabled"));
m_button = bbtn;
#if wxUSE_COMMANDLINKBUTTON
m_cmdLnkButton = NULL;
@@ -611,7 +611,7 @@ void ButtonWidgetsPage::OnButtonChangeNote(wxCommandEvent& WXUNUSED(event))
void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Test button clicked."));
wxLogMessage("Test button clicked.");
}
// ----------------------------------------------------------------------------
@@ -626,8 +626,8 @@ wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label)
dc.SetBackground(*wxCYAN_BRUSH);
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
wxT("(") + label + wxT(" state)"),
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n"
"(" + label + " state)",
wxArtProvider::GetBitmap(wxART_INFORMATION),
wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20),
wxALIGN_CENTRE);