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:
committed by
Vadim Zeitlin
parent
480047ee9a
commit
b70ed2d8c8
@@ -211,7 +211,7 @@ wxEND_EVENT_TABLE()
|
||||
#define FAMILY_CTRLS NATIVE_CTRLS
|
||||
#endif
|
||||
|
||||
IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, wxT("Spin"),
|
||||
IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, "Spin",
|
||||
FAMILY_CTRLS | EDITABLE_CTRLS
|
||||
);
|
||||
|
||||
@@ -245,25 +245,25 @@ void SpinBtnWidgetsPage::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_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical"));
|
||||
m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Arrow Keys"));
|
||||
m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Wrap"));
|
||||
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical");
|
||||
m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, "&Arrow Keys");
|
||||
m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, "&Wrap");
|
||||
m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeft,
|
||||
wxT("Process &Enter"));
|
||||
"Process &Enter");
|
||||
|
||||
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
|
||||
|
||||
static const wxString halign[] =
|
||||
{
|
||||
wxT("left"),
|
||||
wxT("centre"),
|
||||
wxT("right"),
|
||||
"left",
|
||||
"centre",
|
||||
"right",
|
||||
};
|
||||
|
||||
m_radioAlign = new wxRadioBox(this, wxID_ANY, wxT("&Text alignment"),
|
||||
m_radioAlign = new wxRadioBox(this, wxID_ANY, "&Text alignment",
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
WXSIZEOF(halign), halign, 1);
|
||||
|
||||
@@ -271,17 +271,17 @@ void SpinBtnWidgetsPage::CreateContent()
|
||||
|
||||
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
|
||||
|
||||
wxButton *btn = new wxButton(this, SpinBtnPage_Reset, wxT("&Reset"));
|
||||
wxButton *btn = new wxButton(this, SpinBtnPage_Reset, "&Reset");
|
||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||
|
||||
// middle pane
|
||||
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY,
|
||||
wxT("&Change spinbtn value"));
|
||||
"&Change spinbtn value");
|
||||
|
||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||
|
||||
wxTextCtrl *text;
|
||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
|
||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value",
|
||||
SpinBtnPage_CurValueText,
|
||||
&text);
|
||||
text->SetEditable(false);
|
||||
@@ -289,21 +289,21 @@ void SpinBtnWidgetsPage::CreateContent()
|
||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||
|
||||
sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetValue,
|
||||
wxT("Set &value"),
|
||||
"Set &value",
|
||||
SpinBtnPage_ValueText,
|
||||
&m_textValue);
|
||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||
|
||||
sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetMinAndMax,
|
||||
wxT("&Min and max"),
|
||||
"&Min and max",
|
||||
SpinBtnPage_MinText,
|
||||
&m_textMin);
|
||||
|
||||
m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString);
|
||||
sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5);
|
||||
|
||||
m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) );
|
||||
m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) );
|
||||
m_textMin->SetValue( wxString::Format("%d", m_min) );
|
||||
m_textMax->SetValue( wxString::Format("%d", m_max) );
|
||||
|
||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||
|
||||
@@ -367,7 +367,7 @@ void SpinBtnWidgetsPage::CreateSpin()
|
||||
switch ( m_radioAlign->GetSelection() )
|
||||
{
|
||||
default:
|
||||
wxFAIL_MSG(wxT("unexpected radiobox selection"));
|
||||
wxFAIL_MSG("unexpected radiobox selection");
|
||||
// fall through
|
||||
|
||||
case Align_Left:
|
||||
@@ -403,28 +403,28 @@ void SpinBtnWidgetsPage::CreateSpin()
|
||||
m_spinbtn->SetRange(m_min, m_max);
|
||||
|
||||
m_spinctrl = new wxSpinCtrl(this, SpinBtnPage_SpinCtrl,
|
||||
wxString::Format(wxT("%d"), val),
|
||||
wxString::Format("%d", val),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
flags | textFlags,
|
||||
m_min, m_max, val);
|
||||
|
||||
m_spinctrldbl = new wxSpinCtrlDouble(this, SpinBtnPage_SpinCtrlDouble,
|
||||
wxString::Format(wxT("%d"), val),
|
||||
wxString::Format("%d", val),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
flags | textFlags,
|
||||
m_min, m_max, val, 0.1);
|
||||
|
||||
// Add spacers, labels and spin controls to the sizer.
|
||||
m_sizerSpin->Add(0, 0, 1);
|
||||
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinButton")),
|
||||
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinButton"),
|
||||
0, wxALIGN_CENTRE | wxALL, 5);
|
||||
m_sizerSpin->Add(m_spinbtn, 0, wxALIGN_CENTRE | wxALL, 5);
|
||||
m_sizerSpin->Add(0, 0, 1);
|
||||
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrl")),
|
||||
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrl"),
|
||||
0, wxALIGN_CENTRE | wxALL, 5);
|
||||
m_sizerSpin->Add(m_spinctrl, 0, wxALIGN_CENTRE | wxALL, 5);
|
||||
m_sizerSpin->Add(0, 0, 1);
|
||||
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrlDouble")),
|
||||
m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrlDouble"),
|
||||
0, wxALIGN_CENTRE | wxALL, 5);
|
||||
m_sizerSpin->Add(m_spinctrldbl, 0, wxALIGN_CENTRE | wxALL, 5);
|
||||
m_sizerSpin->Add(0, 0, 1);
|
||||
@@ -451,7 +451,7 @@ void SpinBtnWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event))
|
||||
!m_textMax->GetValue().ToLong(&maxNew) ||
|
||||
minNew > maxNew )
|
||||
{
|
||||
wxLogWarning(wxT("Invalid min/max values for the spinbtn."));
|
||||
wxLogWarning("Invalid min/max values for the spinbtn.");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -498,7 +498,7 @@ void SpinBtnWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event))
|
||||
long val;
|
||||
if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) )
|
||||
{
|
||||
wxLogWarning(wxT("Invalid spinbtn value."));
|
||||
wxLogWarning("Invalid spinbtn value.");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -542,7 +542,7 @@ void SpinBtnWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void SpinBtnWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.SetText( wxString::Format(wxT("%d"), m_spinbtn->GetValue()));
|
||||
event.SetText( wxString::Format("%d", m_spinbtn->GetValue()));
|
||||
}
|
||||
|
||||
void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event)
|
||||
@@ -550,20 +550,20 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event)
|
||||
int value = event.GetInt();
|
||||
|
||||
wxASSERT_MSG( value == m_spinbtn->GetValue(),
|
||||
wxT("spinbtn value should be the same") );
|
||||
"spinbtn value should be the same" );
|
||||
|
||||
wxLogMessage(wxT("Spin button value changed, now %d"), value);
|
||||
wxLogMessage("Spin button value changed, now %d", value);
|
||||
}
|
||||
|
||||
void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event)
|
||||
{
|
||||
wxLogMessage( wxT("Spin button value incremented, will be %d (was %d)"),
|
||||
wxLogMessage( "Spin button value incremented, will be %d (was %d)",
|
||||
event.GetInt(), m_spinbtn->GetValue() );
|
||||
}
|
||||
|
||||
void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event)
|
||||
{
|
||||
wxLogMessage( wxT("Spin button value decremented, will be %d (was %d)"),
|
||||
wxLogMessage( "Spin button value decremented, will be %d (was %d)",
|
||||
event.GetInt(), m_spinbtn->GetValue() );
|
||||
}
|
||||
|
||||
@@ -572,21 +572,21 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxSpinEvent& event)
|
||||
int value = event.GetInt();
|
||||
|
||||
wxASSERT_MSG( value == m_spinctrl->GetValue(),
|
||||
wxT("spinctrl value should be the same") );
|
||||
"spinctrl value should be the same" );
|
||||
|
||||
wxLogMessage(wxT("Spin control value changed, now %d"), value);
|
||||
wxLogMessage("Spin control value changed, now %d", value);
|
||||
}
|
||||
|
||||
void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event)
|
||||
{
|
||||
double value = event.GetValue();
|
||||
|
||||
wxLogMessage(wxT("Spin control value changed, now %g"), value);
|
||||
wxLogMessage("Spin control value changed, now %g", value);
|
||||
}
|
||||
|
||||
void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event)
|
||||
{
|
||||
wxLogMessage(wxT("Text changed in spin control, now \"%s\""),
|
||||
wxLogMessage("Text changed in spin control, now \"%s\"",
|
||||
event.GetString().c_str());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user