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
@@ -175,7 +175,7 @@ wxEND_EVENT_TABLE()
|
||||
#define FAMILY_CTRLS NATIVE_CTRLS
|
||||
#endif
|
||||
|
||||
IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, wxT("Gauge"), FAMILY_CTRLS );
|
||||
IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, "Gauge", FAMILY_CTRLS );
|
||||
|
||||
GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book,
|
||||
wxImageList *imaglist)
|
||||
@@ -199,25 +199,25 @@ void GaugeWidgetsPage::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_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Smooth"));
|
||||
m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Progress"));
|
||||
m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical");
|
||||
m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, "&Smooth");
|
||||
m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, "&Progress");
|
||||
|
||||
sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer
|
||||
|
||||
wxButton *btn = new wxButton(this, GaugePage_Reset, wxT("&Reset"));
|
||||
wxButton *btn = new wxButton(this, GaugePage_Reset, "&Reset");
|
||||
sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15);
|
||||
|
||||
// middle pane
|
||||
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change gauge value"));
|
||||
wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change gauge value");
|
||||
wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL);
|
||||
|
||||
wxTextCtrl *text;
|
||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"),
|
||||
wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value",
|
||||
GaugePage_CurValueText,
|
||||
&text);
|
||||
text->SetEditable(false);
|
||||
@@ -225,26 +225,26 @@ void GaugeWidgetsPage::CreateContent()
|
||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||
|
||||
sizerRow = CreateSizerWithTextAndButton(GaugePage_SetValue,
|
||||
wxT("Set &value"),
|
||||
"Set &value",
|
||||
GaugePage_ValueText,
|
||||
&m_textValue);
|
||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||
|
||||
sizerRow = CreateSizerWithTextAndButton(GaugePage_SetRange,
|
||||
wxT("Set &range"),
|
||||
"Set &range",
|
||||
GaugePage_RangeText,
|
||||
&m_textRange);
|
||||
m_textRange->SetValue( wxString::Format(wxT("%lu"), m_range) );
|
||||
m_textRange->SetValue( wxString::Format("%lu", m_range) );
|
||||
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
|
||||
|
||||
btn = new wxButton(this, GaugePage_Progress, wxT("Simulate &progress"));
|
||||
btn = new wxButton(this, GaugePage_Progress, "Simulate &progress");
|
||||
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
|
||||
|
||||
btn = new wxButton(this, GaugePage_IndeterminateProgress,
|
||||
wxT("Simulate &indeterminate job"));
|
||||
"Simulate &indeterminate job");
|
||||
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
|
||||
|
||||
btn = new wxButton(this, GaugePage_Clear, wxT("&Clear"));
|
||||
btn = new wxButton(this, GaugePage_Clear, "&Clear");
|
||||
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
|
||||
|
||||
// right pane
|
||||
@@ -322,13 +322,13 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked)
|
||||
{
|
||||
static const int INTERVAL = 300;
|
||||
|
||||
wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL);
|
||||
wxLogMessage("Launched progress timer (interval = %d ms)", INTERVAL);
|
||||
|
||||
m_timer = new wxTimer(this,
|
||||
clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer);
|
||||
m_timer->Start(INTERVAL);
|
||||
|
||||
clicked->SetLabel(wxT("&Stop timer"));
|
||||
clicked->SetLabel("&Stop timer");
|
||||
|
||||
if (clicked->GetId() == GaugePage_Progress)
|
||||
FindWindow(GaugePage_IndeterminateProgress)->Disable();
|
||||
@@ -338,23 +338,23 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked)
|
||||
|
||||
void GaugeWidgetsPage::StopTimer(wxButton *clicked)
|
||||
{
|
||||
wxCHECK_RET( m_timer, wxT("shouldn't be called") );
|
||||
wxCHECK_RET( m_timer, "shouldn't be called" );
|
||||
|
||||
m_timer->Stop();
|
||||
wxDELETE(m_timer);
|
||||
|
||||
if (clicked->GetId() == GaugePage_Progress)
|
||||
{
|
||||
clicked->SetLabel(wxT("Simulate &progress"));
|
||||
clicked->SetLabel("Simulate &progress");
|
||||
FindWindow(GaugePage_IndeterminateProgress)->Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
clicked->SetLabel(wxT("Simulate indeterminate job"));
|
||||
clicked->SetLabel("Simulate indeterminate job");
|
||||
FindWindow(GaugePage_Progress)->Enable();
|
||||
}
|
||||
|
||||
wxLogMessage(wxT("Progress finished."));
|
||||
wxLogMessage("Progress finished.");
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -379,7 +379,7 @@ void GaugeWidgetsPage::OnButtonProgress(wxCommandEvent& event)
|
||||
{
|
||||
StopTimer(b);
|
||||
|
||||
wxLogMessage(wxT("Stopped the timer."));
|
||||
wxLogMessage("Stopped the timer.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ void GaugeWidgetsPage::OnButtonIndeterminateProgress(wxCommandEvent& event)
|
||||
|
||||
m_gauge->SetValue(0);
|
||||
|
||||
wxLogMessage(wxT("Stopped the timer."));
|
||||
wxLogMessage("Stopped the timer.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ void GaugeWidgetsPage::OnProgressTimer(wxTimerEvent& WXUNUSED(event))
|
||||
else // reached the end
|
||||
{
|
||||
wxButton *btn = (wxButton *)FindWindow(GaugePage_Progress);
|
||||
wxCHECK_RET( btn, wxT("no progress button?") );
|
||||
wxCHECK_RET( btn, "no progress button?" );
|
||||
|
||||
StopTimer(btn);
|
||||
}
|
||||
@@ -470,7 +470,7 @@ void GaugeWidgetsPage::OnIndeterminateProgressTimer(wxTimerEvent& WXUNUSED(event
|
||||
|
||||
void GaugeWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.SetText( wxString::Format(wxT("%d"), m_gauge->GetValue()));
|
||||
event.SetText( wxString::Format("%d", m_gauge->GetValue()));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user