Remove unnecessary c_str() calls from the samples

Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.

Closes https://github.com/wxWidgets/wxWidgets/pull/1009
This commit is contained in:
Blake Eryx 2018-11-01 19:32:02 -04:00 committed by Vadim Zeitlin
parent 63c602c3d2
commit 65827a0572
51 changed files with 260 additions and 260 deletions

View file

@ -455,7 +455,7 @@ void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event))
wxString name, role;
GetInfo(childAccessible, 0, name, role);
wxString str;
str.Printf("Found child %s/%s", name.c_str(), role.c_str());
str.Printf("Found child %s/%s", name, role);
Log(str);
childAccessible->Release();
}
@ -499,7 +499,7 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
GetInfo(obj, 0, name, role);
wxString str;
str.Printf("Name = %s; Role = %s", name.c_str(), role.c_str());
str.Printf("Name = %s; Role = %s", name, role);
str.Pad(indent, ' ', false);
Log(str);
}
@ -520,7 +520,7 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
GetInfo(obj, i, name, role);
wxString str;
str.Printf("%d) Name = %s; Role = %s", i, name.c_str(), role.c_str());
str.Printf("%d) Name = %s; Role = %s", i, name, role);
str.Pad(indent, ' ', false);
Log(str);

View file

@ -735,7 +735,7 @@ MyPanel::MyPanel(wxWindow *parent)
wxString date;
date.Printf("Selected date: %s",
wxDateTime::Today().FormatISODate().c_str());
wxDateTime::Today().FormatISODate());
m_date = new wxStaticText(this, wxID_ANY, date);
m_calendar = DoCreateCalendar(wxDefaultDateTime,
wxCAL_SHOW_HOLIDAYS);
@ -761,13 +761,13 @@ void MyPanel::OnCalendar(wxCalendarEvent& event)
m_calendar->Mark(event.GetDate().GetDay(), mark);
wxLogMessage("Selected (and %smarked) %s from calendar.",
mark ? "" : "un", s_dateLast.FormatISODate().c_str());
mark ? "" : "un", s_dateLast.FormatISODate());
}
void MyPanel::OnCalendarChange(wxCalendarEvent& event)
{
wxString s;
s.Printf("Selected date: %s", event.GetDate().FormatISODate().c_str());
s.Printf("Selected date: %s", event.GetDate().FormatISODate());
m_date->SetLabel(s);
wxLogStatus(s);
@ -783,7 +783,7 @@ void MyPanel::OnCalMonthChange(wxCalendarEvent& event)
void MyPanel::OnCalendarWeekDayClick(wxCalendarEvent& event)
{
wxLogMessage("Clicked on %s",
wxDateTime::GetWeekDayName(event.GetWeekDay()).c_str());
wxDateTime::GetWeekDayName(event.GetWeekDay()));
}
void MyPanel::OnCalendarWeekClick(wxCalendarEvent& event)

View file

@ -944,12 +944,12 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event )
}
else if ( event.GetEventType() == wxEVT_TEXT )
{
wxLogDebug("EVT_TEXT(id=%i,string=\"%s\")",event.GetId(),event.GetString().c_str());
wxLogDebug("EVT_TEXT(id=%i,string=\"%s\")",event.GetId(),event.GetString());
}
else if ( event.GetEventType() == wxEVT_TEXT_ENTER )
{
wxLogDebug("EVT_TEXT_ENTER(id=%i,string=\"%s\")",
event.GetId(), event.GetString().c_str());
event.GetId(), event.GetString());
}
}
@ -1123,7 +1123,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
"This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n"
"running under %s.",
wxVERSION_STRING,
wxGetOsDescription().c_str()
wxGetOsDescription()
),
"About wxComboCtrl sample",
wxOK | wxICON_INFORMATION,

View file

@ -210,7 +210,7 @@ MyFrame::MyFrame()
wxString s;
if ( pConfig->Read("TestValue", &s) )
{
wxLogStatus(this, "TestValue from config is '%s'", s.c_str());
wxLogStatus(this, "TestValue from config is '%s'", s);
}
else
{

View file

@ -80,7 +80,7 @@ protected:
s << '\t' << reply[n] << '\n';
}
wxLogMessage("%s", s.c_str());
wxLogMessage("%s", s);
return true;
}
@ -467,7 +467,7 @@ void MyApp::GenerateReport(wxDebugReport::Context ctx)
else
{
wxLogMessage("Report generated in \"%s\".",
report->GetCompressedFileName().c_str());
report->GetCompressedFileName());
report->Reset();
}
}

View file

@ -1049,7 +1049,7 @@ void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
this);
if ( !pwd.empty() )
{
wxMessageBox(wxString::Format("Your password is '%s'", pwd.c_str()),
wxMessageBox(wxString::Format("Your password is '%s'", pwd),
"Got password", wxOK | wxICON_INFORMATION, this);
}
}
@ -1133,7 +1133,7 @@ void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) )
{
msg += wxString::Format("\t%u: %u (%s)\n",
(unsigned)n, (unsigned)selections[n],
choices[selections[n]].c_str());
choices[selections[n]]);
}
}
wxLogMessage(msg);
@ -1568,9 +1568,9 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
"Path: %s\n"
"Name: %s\n"
"Custom window: %s",
dialog.GetPath().c_str(),
dialog.GetDirectory().c_str(),
dialog.GetFilename().c_str(),
dialog.GetPath(),
dialog.GetDirectory(),
dialog.GetFilename(),
extra ? static_cast<MyExtraPanel*>(extra)->GetInfo()
: wxString("None"));
wxMessageDialog dialog2(this, info, "Selected file");
@ -1637,7 +1637,7 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
for ( size_t n = 0; n < count; n++ )
{
s.Printf("File %d: %s (%s)\n",
(int)n, paths[n].c_str(), filenames[n].c_str());
(int)n, paths[n], filenames[n]);
msg += s;
}
@ -1663,7 +1663,7 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
if (dialog.ShowModal() == wxID_OK)
{
wxLogMessage("%s, filter %d",
dialog.GetPath().c_str(), dialog.GetFilterIndex());
dialog.GetPath(), dialog.GetFilterIndex());
}
}
#endif // wxUSE_FILEDLG
@ -1689,9 +1689,9 @@ void MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) )
info.Printf("Full file name: %s\n"
"Path: %s\n"
"Name: %s",
dialog.GetPath().c_str(),
dialog.GetDirectory().c_str(),
dialog.GetFilename().c_str());
dialog.GetPath(),
dialog.GetDirectory(),
dialog.GetFilename());
wxMessageDialog dialog2(this, info, "Selected file");
dialog2.ShowModal();
}
@ -1716,7 +1716,7 @@ void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) )
for ( size_t n = 0; n < count; n++ )
{
s.Printf("File %d: %s (%s)\n",
(int)n, paths[n].c_str(), filenames[n].c_str());
(int)n, paths[n], filenames[n]);
msg += s;
}
@ -1742,7 +1742,7 @@ void MyFrame::FileSaveGeneric(wxCommandEvent& WXUNUSED(event) )
if (dialog.ShowModal() == wxID_OK)
{
wxLogMessage("%s, filter %d",
dialog.GetPath().c_str(), dialog.GetFilterIndex());
dialog.GetPath(), dialog.GetFilterIndex());
}
}
#endif // USE_FILEDLG_GENERIC
@ -1758,7 +1758,7 @@ void MyFrame::DoDirChoose(int style)
if (dialog.ShowModal() == wxID_OK)
{
wxLogMessage("Selected path: %s", dialog.GetPath().c_str());
wxLogMessage("Selected path: %s", dialog.GetPath());
}
}
@ -3018,17 +3018,17 @@ void MyFrame::OnFindDialog(wxFindDialogEvent& event)
{
wxLogMessage("Find %s'%s' (flags: %s)",
type == wxEVT_FIND_NEXT ? "next " : "",
event.GetFindString().c_str(),
DecodeFindDialogEventFlags(event.GetFlags()).c_str());
event.GetFindString(),
DecodeFindDialogEventFlags(event.GetFlags()));
}
else if ( type == wxEVT_FIND_REPLACE ||
type == wxEVT_FIND_REPLACE_ALL )
{
wxLogMessage("Replace %s'%s' with '%s' (flags: %s)",
type == wxEVT_FIND_REPLACE_ALL ? "all " : "",
event.GetFindString().c_str(),
event.GetReplaceString().c_str(),
DecodeFindDialogEventFlags(event.GetFlags()).c_str());
event.GetFindString(),
event.GetReplaceString(),
DecodeFindDialogEventFlags(event.GetFlags()));
}
else if ( type == wxEVT_FIND_CLOSE )
{

View file

@ -1523,7 +1523,7 @@ void DnDFrame::OnCopy(wxCommandEvent& WXUNUSED(event))
}
else
{
wxLogMessage("Text '%s' put on the clipboard", m_strText.c_str());
wxLogMessage("Text '%s' put on the clipboard", m_strText);
}
wxTheClipboard->Close();
@ -1554,7 +1554,7 @@ void DnDFrame::OnPaste(wxCommandEvent& WXUNUSED(event))
else
{
wxLogMessage("Text '%s' pasted from the clipboard",
text.GetText().c_str());
text.GetText());
}
wxTheClipboard->Close();

View file

@ -2018,7 +2018,7 @@ void MyCanvas::UseGraphicRenderer(wxGraphicsRenderer* renderer)
int major, minor, micro;
renderer->GetVersion(&major, &minor, &micro);
wxString str = wxString::Format("Graphics renderer: %s %i.%i.%i",
renderer->GetName().c_str(), major, minor, micro);
renderer->GetName(), major, minor, micro);
m_owner->SetStatusText(str, 1);
}
else

View file

@ -854,13 +854,13 @@ void MyFrame::DoAsyncExec(const wxString& cmd)
m_pidLast = wxExecute(cmd, wxEXEC_ASYNC | GetExecFlags(), process);
if ( !m_pidLast )
{
wxLogError("Execution of '%s' failed.", cmd.c_str());
wxLogError("Execution of '%s' failed.", cmd);
delete process;
}
else
{
wxLogStatus("Process %ld (%s) launched.", m_pidLast, cmd.c_str());
wxLogStatus("Process %ld (%s) launched.", m_pidLast, cmd);
m_cmdLast = cmd;
@ -877,12 +877,12 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event))
if ( !QueryExec(cmd, env) )
return;
wxLogStatus( "'%s' is running please wait...", cmd.c_str() );
wxLogStatus( "'%s' is running please wait...", cmd );
int code = wxExecute(cmd, wxEXEC_SYNC | GetExecFlags(), NULL, &env);
wxLogStatus("Process '%s' terminated with exit code %d.",
cmd.c_str(), code);
cmd, code);
m_cmdLast = cmd;
}
@ -910,7 +910,7 @@ void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event))
int code = wxShell(cmd);
wxLogStatus("Shell command '%s' terminated with exit code %d.",
cmd.c_str(), code);
cmd, code);
m_cmdLast = cmd;
}
@ -969,7 +969,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
MyPipedProcess *process = new MyPipedProcess(this, cmd);
if ( !wxExecute(cmd, wxEXEC_ASYNC, process) )
{
wxLogError("Execution of '%s' failed.", cmd.c_str());
wxLogError("Execution of '%s' failed.", cmd);
delete process;
}
@ -1004,13 +1004,13 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event))
long pid = wxExecute(cmd, wxEXEC_ASYNC, process);
if ( pid )
{
wxLogStatus("Process %ld (%s) launched.", pid, cmd.c_str());
wxLogStatus("Process %ld (%s) launched.", pid, cmd);
AddPipedProcess(process);
}
else
{
wxLogError("Execution of '%s' failed.", cmd.c_str());
wxLogError("Execution of '%s' failed.", cmd);
delete process;
}
@ -1083,7 +1083,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event))
if ( !ft )
{
wxLogError("Impossible to determine the file type for extension '%s'",
ext.c_str());
ext);
return;
}
@ -1101,7 +1101,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event))
if ( !ok )
{
wxLogError("Impossible to find out how to open files of extension '%s'",
ext.c_str());
ext);
return;
}
@ -1173,7 +1173,7 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event))
if ( !wxLaunchDefaultBrowser(s_url) )
{
wxLogError("Failed to open URL \"%s\"", s_url.c_str());
wxLogError("Failed to open URL \"%s\"", s_url);
}
}
@ -1217,14 +1217,14 @@ void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event))
if ( !conn )
{
wxLogError("Failed to connect to the DDE server '%s'.",
m_server.c_str());
m_server);
}
else
{
if ( !conn->Execute(m_cmdDde) )
{
wxLogError("Failed to execute command '%s' via DDE.",
m_cmdDde.c_str());
m_cmdDde);
}
else
{
@ -1243,14 +1243,14 @@ void MyFrame::OnDDERequest(wxCommandEvent& WXUNUSED(event))
if ( !conn )
{
wxLogError("Failed to connect to the DDE server '%s'.",
m_server.c_str());
m_server);
}
else
{
if ( !conn->Request(m_cmdDde) )
{
wxLogError("Failed to send request '%s' via DDE.",
m_cmdDde.c_str());
m_cmdDde);
}
else
{
@ -1336,7 +1336,7 @@ void MyFrame::ShowOutput(const wxString& cmd,
return;
m_lbox->Append(wxString::Format("--- %s of '%s' ---",
title.c_str(), cmd.c_str()));
title, cmd));
for ( size_t n = 0; n < count; n++ )
{
@ -1344,7 +1344,7 @@ void MyFrame::ShowOutput(const wxString& cmd,
}
m_lbox->Append(wxString::Format("--- End of %s ---",
title.Lower().c_str()));
title.Lower()));
}
// ----------------------------------------------------------------------------
@ -1354,7 +1354,7 @@ void MyFrame::ShowOutput(const wxString& cmd,
void MyProcess::OnTerminate(int pid, int status)
{
wxLogStatus(m_parent, "Process %u ('%s') terminated with exit code %d.",
pid, m_cmd.c_str(), status);
pid, m_cmd, status);
m_parent->OnAsyncTermination(this);
}

View file

@ -582,7 +582,7 @@ protected:
{
wxString text;
text.Printf("Encoding %u: %s (available in facename '%s')\n",
(unsigned int) ++m_n, encoding.c_str(), facename.c_str());
(unsigned int) ++m_n, encoding, facename);
m_text += text;
return true;
}
@ -599,7 +599,7 @@ void MyFrame::OnEnumerateEncodings(wxCommandEvent& WXUNUSED(event))
fontEnumerator.EnumerateEncodings();
wxLogMessage("Enumerating all available encodings:\n%s",
fontEnumerator.GetText().c_str());
fontEnumerator.GetText());
}
// -------------------------------------------------------------
@ -714,7 +714,7 @@ void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event))
if ( !font.IsOk() )
{
wxLogError("Font info string \"%s\" is invalid.",
fontInfo.c_str());
fontInfo);
return;
}
@ -1103,7 +1103,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
if ( !charset )
{
wxLogError("The file '%s' doesn't contain charset information.",
filename.c_str());
filename);
return;
}
@ -1112,7 +1112,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
wxFontEncoding fontenc = wxFontMapper::Get()->CharsetToEncoding(charset);
if ( fontenc == wxFONTENCODING_SYSTEM )
{
wxLogError("Charset '%s' is unsupported.", charset.c_str());
wxLogError("Charset '%s' is unsupported.", charset);
return;
}
@ -1135,13 +1135,13 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
else
{
wxLogWarning("Cannot convert from '%s' to '%s'.",
wxFontMapper::GetEncodingDescription(fontenc).c_str(),
wxFontMapper::GetEncodingDescription(encAlt).c_str());
wxFontMapper::GetEncodingDescription(fontenc),
wxFontMapper::GetEncodingDescription(encAlt));
}
}
else
wxLogWarning("No fonts for encoding '%s' on this system.",
wxFontMapper::GetEncodingDescription(fontenc).c_str());
wxFontMapper::GetEncodingDescription(fontenc));
}
// and now create the correct font
@ -1155,7 +1155,7 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event))
else
{
wxLogWarning("No fonts for encoding '%s' on this system.",
wxFontMapper::GetEncodingDescription(fontenc).c_str());
wxFontMapper::GetEncodingDescription(fontenc));
}
}
#endif // wxUSE_FILEDLG

View file

@ -1275,7 +1275,7 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
logBuf << " (shift down)";
if ( ev.ControlDown() )
logBuf << " (control down)";
wxLogMessage( "%s", logBuf.c_str() );
wxLogMessage( "%s", logBuf );
// you must call event skip if you want default grid processing
//
@ -1349,7 +1349,7 @@ void GridFrame::OnSelectCell( wxGridEvent& ev )
if ( ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ) != ev.GetCol() )
logBuf << " *** Column moved, current position: " << ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() );
wxLogMessage( "%s", logBuf.c_str() );
wxLogMessage( "%s", logBuf );
// you must call Skip() if you want the default processing
// to occur in wxGrid
@ -1371,7 +1371,7 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
<< ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F')
<< ", AltDown: "<< (ev.AltDown() ? 'T':'F')
<< ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )";
wxLogMessage( "%s", logBuf.c_str() );
wxLogMessage( "%s", logBuf );
ev.Skip();
}
@ -1742,7 +1742,7 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value )
if ( n == WXSIZEOF(severities) )
{
wxLogWarning("Invalid severity value '%s'.",
value.c_str());
value);
gd.severity = Sev_Normal;
}
}

View file

@ -348,7 +348,7 @@ void MyFrame::CreateBox()
"Item</font> <b>%lu</b>"
"</h%d>",
level,
clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
clr.GetAsString(wxC2S_HTML_SYNTAX),
(unsigned long)n, level);
arr.Add(label);
}
@ -489,7 +489,7 @@ void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
{
wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref().c_str());
wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref());
if (GetMyBox())
{
@ -541,7 +541,7 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event)
if ( !s.empty() )
{
wxLogMessage("Selected items: %s", s.c_str());
wxLogMessage("Selected items: %s", s);
}
}
@ -621,7 +621,7 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const
"Item</font> <b>%lu</b>"
"</h%d>",
level,
clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
clr.GetAsString(wxC2S_HTML_SYNTAX),
(unsigned long)n, level);
if ( n == 1 )
{

View file

@ -347,7 +347,7 @@ void MyFrame::OnDrawCustomBg(wxCommandEvent& event)
void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
{
wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref().c_str());
wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref());
// skipping this event the default behaviour (load the clicked URL)
// will happen...
@ -398,7 +398,7 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
const size_t maxTextLength = 100;
wxLogStatus(wxString::Format("Clipboard: '%s%s'",
wxString(text, maxTextLength).c_str(),
wxString(text, maxTextLength),
(text.length() > maxTextLength) ? "..."
: ""));
wxTheClipboard->Close();

View file

@ -752,7 +752,7 @@ wxString MyFrame::LoadUserImage(wxImage& image)
{
if ( !image.LoadFile(filename) )
{
wxLogError("Couldn't load image from '%s'.", filename.c_str());
wxLogError("Couldn't load image from '%s'.", filename);
return wxEmptyString;
}
@ -962,7 +962,7 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
wxStopWatch sw;
if ( !image.LoadFile(filename) )
{
wxLogError("Couldn't load image from '%s'.", filename.c_str());
wxLogError("Couldn't load image from '%s'.", filename);
return;
}

View file

@ -361,7 +361,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
wxString canname = m_locale.GetCanonicalName();
localeInfo.Printf(_("Language: %s\nSystem locale name: %s\nCanonical locale name: %s\n"),
locale.c_str(), sysname.c_str(), canname.c_str() );
locale, sysname, canname );
wxMessageDialog dlg(
this,
@ -445,17 +445,17 @@ void MyFrame::OnTestLocaleAvail(wxCommandEvent& WXUNUSED(event))
const wxLanguageInfo * const info = wxLocale::FindLanguageInfo(s_locale);
if ( !info )
{
wxLogError(_("Locale \"%s\" is unknown."), s_locale.c_str());
wxLogError(_("Locale \"%s\" is unknown."), s_locale);
return;
}
if ( wxLocale::IsAvailable(info->Language) )
{
wxLogMessage(_("Locale \"%s\" is available."), s_locale.c_str());
wxLogMessage(_("Locale \"%s\" is available."), s_locale);
}
else
{
wxLogWarning(_("Locale \"%s\" is not available."), s_locale.c_str());
wxLogWarning(_("Locale \"%s\" is not available."), s_locale);
}
}

View file

@ -252,7 +252,7 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event))
bool retval = m_client->Connect(hostname, servername, topic);
wxLogMessage("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s",
hostname.c_str(), servername.c_str(), topic.c_str(),
hostname, servername, topic,
retval ? "connected" : "failed to connect");
if (!retval)

View file

@ -24,13 +24,13 @@ protected:
{
wxString s;
if (topic.IsEmpty() && item.IsEmpty())
s.Printf("%s(", command.c_str());
s.Printf("%s(", command);
else if (topic.IsEmpty())
s.Printf("%s(item=\"%s\",", command.c_str(), item.c_str());
s.Printf("%s(item=\"%s\",", command, item);
else if (item.IsEmpty())
s.Printf("%s(topic=\"%s\",", command.c_str(), topic.c_str());
s.Printf("%s(topic=\"%s\",", command, topic);
else
s.Printf("%s(topic=\"%s\",item=\"%s\",", command.c_str(), topic.c_str(), item.c_str());
s.Printf("%s(topic=\"%s\",item=\"%s\",", command, topic, item);
switch (format)
{

View file

@ -88,7 +88,7 @@ bool MyApp::OnInit()
#if wxUSE_STATUSBAR
frame->CreateStatusBar();
frame->SetStatusText(wxString::Format("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]", stick.GetProductName().c_str(), stick.GetProductId(), stick.GetManufacturerId(), wxJoystick::GetNumberJoysticks()));
frame->SetStatusText(wxString::Format("Device [%s] (PID:[%i] MID:[%i]) Ready... # of joysticks:[%i]", stick.GetProductName(), stick.GetProductId(), stick.GetManufacturerId(), wxJoystick::GetNumberJoysticks()));
#endif // wxUSE_STATUSBAR
frame->CenterOnScreen();

View file

@ -724,7 +724,7 @@ void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event))
while ( item != -1 )
{
wxLogMessage("\t%ld (%s)",
item, m_listCtrl->GetItemText(item).c_str());
item, m_listCtrl->GetItemText(item));
if ( ++shownCount > 10 )
{
@ -1119,7 +1119,7 @@ void MyListCtrl::OnBeginRDrag(wxListEvent& event)
void MyListCtrl::OnBeginLabelEdit(wxListEvent& event)
{
wxLogMessage( "OnBeginLabelEdit: %s", event.m_item.m_text.c_str());
wxLogMessage( "OnBeginLabelEdit: %s", event.m_item.m_text);
wxTextCtrl * const text = GetEditControl();
if ( !text )
@ -1139,7 +1139,7 @@ void MyListCtrl::OnEndLabelEdit(wxListEvent& event)
event.IsEditCancelled() ?
wxString("[cancelled]") :
event.m_item.m_text
).c_str()
)
);
}
@ -1167,7 +1167,7 @@ void MyListCtrl::OnSelected(wxListEvent& event)
if ( GetItem(info) )
{
wxLogMessage("Value of the 2nd field of the selected item: %s",
info.m_text.c_str());
info.m_text);
}
else
{
@ -1397,7 +1397,7 @@ void MyListCtrl::OnRightClick(wxMouseEvent& event)
}
wxLogMessage("Right double click %s item %ld, subitem %ld",
where.c_str(), item, subitem);
where, item, subitem);
}
void MyListCtrl::LogEvent(const wxListEvent& event, const wxString& eventName)

View file

@ -1438,8 +1438,8 @@ void wxMediaPlayerTimer::Notify()
"State:%s Loops:%i D/T:[%i]/[%i] V:%i%%",
videoSize.x,
videoSize.y,
sPosition.c_str(),
sDuration.c_str(),
sPosition,
sDuration,
currentMediaCtrl->GetPlaybackRate(),
wxGetMediaStateText(currentpage->m_mediactrl->GetState()),
currentpage->m_nLoops,

View file

@ -850,7 +850,7 @@ void MyFrame::OnGetLabelMenu(wxCommandEvent& WXUNUSED(event))
wxCHECK_RET( count, "no last menu?" );
wxLogMessage("The label of the last menu item is '%s'",
mbar->GetMenuLabel(count - 1).c_str());
mbar->GetMenuLabel(count - 1));
}
#if wxUSE_TEXTDLG
@ -896,11 +896,11 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event))
if (index == wxNOT_FOUND)
{
wxLogWarning("No menu with label '%s'", label.c_str());
wxLogWarning("No menu with label '%s'", label);
}
else
{
wxLogMessage("Menu %d has label '%s'", index, label.c_str());
wxLogMessage("Menu %d has label '%s'", index, label);
}
}
}
@ -1016,7 +1016,7 @@ void MyFrame::OnGetLabelMenuItem(wxCommandEvent& WXUNUSED(event))
{
wxString label = item->GetItemLabel();
wxLogMessage("The label of the last menu item is '%s'",
label.c_str());
label);
}
}
@ -1146,12 +1146,12 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event))
}
if (index == wxNOT_FOUND)
{
wxLogWarning("No menu item with label '%s'", label.c_str());
wxLogWarning("No menu item with label '%s'", label);
}
else
{
wxLogMessage("Menu item %d in menu %lu has label '%s'",
index, (unsigned long)menuindex, label.c_str());
index, (unsigned long)menuindex, label);
}
}
}
@ -1252,7 +1252,7 @@ void MyFrame::LogMenuOpenCloseOrHighlight(const wxMenuEvent& event, const wxStri
msg << ".";
wxLogStatus(this, msg.c_str());
wxLogStatus(this, msg);
}
#endif

View file

@ -686,7 +686,7 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event))
pt.x,
pt.y,
pagePos,
flagsStr.c_str());
flagsStr);
}
void MyFrame::OnType(wxCommandEvent& event)
@ -960,7 +960,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
selection << nSel;
wxString title;
title.Printf("Notebook and friends (%d pages, selection: %s)", nPages, selection.c_str());
title.Printf("Notebook and friends (%d pages, selection: %s)", nPages, selection);
SetTitle(title);
}
@ -1073,13 +1073,13 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event)
wxLogMessage("Event #%d: %s: %s (%d) new sel %d, old %d, current %d%s",
++s_num,
nameControl.c_str(),
nameEvent.c_str(),
nameControl,
nameEvent,
eventType,
event.GetSelection(),
event.GetOldSelection(),
book->GetSelection(),
veto.c_str());
veto);
#if USE_LOG
m_text->SetInsertionPointEnd();

View file

@ -198,7 +198,7 @@ void TestGLCanvas::LoadSurface(const wxString& filename)
new wxZlibInputStream(new wxFFileInputStream(filename));
if (!stream || !stream->IsOk())
{
wxLogError("Cannot load '%s' type of files!", filename.c_str());
wxLogError("Cannot load '%s' type of files!", filename);
delete stream;
return;
}
@ -226,7 +226,7 @@ void TestGLCanvas::LoadSurface(const wxString& filename)
delete stream;
wxLogMessage("Loaded %d vertices, %d triangles from '%s'",
m_numverts, m_numverts-2, filename.c_str());
m_numverts, m_numverts-2, filename);
// NOTE: for some reason under wxGTK the following is required to avoid that
// the surface gets rendered in a small rectangle in the top-left corner of the frame

View file

@ -179,8 +179,8 @@ private:
SetStatusText(wxString::Format(
"System is on %s power, battery state is %s",
powerStr.c_str(),
batteryStr.c_str()));
powerStr,
batteryStr));
}
void OnStartTaskClicked( wxCommandEvent& WXUNUSED(event) )

View file

@ -188,7 +188,7 @@ public:
if ( val.find(m_invalidWord) == wxString::npos )
return true;
::wxMessageBox(wxString::Format("%s is not allowed word",m_invalidWord.c_str()),
::wxMessageBox(wxString::Format("%s is not allowed word",m_invalidWord),
"Validation Failure");
return false;
@ -650,7 +650,7 @@ void FormMain::OnPropertyGridChanging( wxPropertyGridEvent& event )
{
int res =
wxMessageBox(wxString::Format("'%s' is about to change (to variant of type '%s')\n\nAllow or deny?",
p->GetName().c_str(),event.GetValue().GetType().c_str()),
p->GetName(),event.GetValue().GetType()),
"Testing wxEVT_PG_CHANGING", wxYES_NO, m_pPropGridManager);
if ( res == wxNO )
@ -787,7 +787,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) )
void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event )
{
wxLogMessage("wxPG_EVT_LABEL_EDIT_BEGIN(%s)",
event.GetProperty()->GetLabel().c_str());
event.GetProperty()->GetLabel());
}
// -----------------------------------------------------------------------
@ -795,7 +795,7 @@ void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event )
void FormMain::OnPropertyGridLabelEditEnding( wxPropertyGridEvent& event )
{
wxLogMessage("wxPG_EVT_LABEL_EDIT_ENDING(%s)",
event.GetProperty()->GetLabel().c_str());
event.GetProperty()->GetLabel());
}
// -----------------------------------------------------------------------
@ -1784,7 +1784,7 @@ void wxMyPropertyGridPage::OnPropertySelect( wxPropertyGridEvent& event )
wxPGProperty* p = event.GetProperty();
wxUnusedVar(p);
wxLogDebug("wxMyPropertyGridPage::OnPropertySelect('%s' is %s",
p->GetName().c_str(),
p->GetName(),
IsPropertySelected(p)? "selected": "unselected");
}
@ -1792,16 +1792,16 @@ void wxMyPropertyGridPage::OnPropertyChange( wxPropertyGridEvent& event )
{
wxPGProperty* p = event.GetProperty();
wxLogVerbose("wxMyPropertyGridPage::OnPropertyChange('%s', to value '%s')",
p->GetName().c_str(),
p->GetDisplayedString().c_str());
p->GetName(),
p->GetDisplayedString());
}
void wxMyPropertyGridPage::OnPropertyChanging( wxPropertyGridEvent& event )
{
wxPGProperty* p = event.GetProperty();
wxLogVerbose("wxMyPropertyGridPage::OnPropertyChanging('%s', to value '%s')",
p->GetName().c_str(),
event.GetValue().GetString().c_str());
p->GetName(),
event.GetValue().GetString());
}
void wxMyPropertyGridPage::OnPageChange( wxPropertyGridEvent& WXUNUSED(event) )
@ -2186,7 +2186,7 @@ void GenerateUniquePropertyLabel( wxPropertyGridManager* pg, wxString& baselabel
for (;;)
{
count++;
newlabel.Printf("%s%i",baselabel.c_str(),count);
newlabel.Printf("%s%i",baselabel,count);
if ( !pg->GetPropertyByLabel( newlabel ) ) break;
}
}
@ -2359,8 +2359,8 @@ int IterateMessage( wxPGProperty* prop )
{
wxString s;
s.Printf( "\"%s\" class = %s, valuetype = %s", prop->GetLabel().c_str(),
prop->GetClassInfo()->GetClassName(), prop->GetValueType().c_str() );
s.Printf( "\"%s\" class = %s, valuetype = %s", prop->GetLabel(),
prop->GetClassInfo()->GetClassName(), prop->GetValueType() );
return wxMessageBox( s, "Iterating... (press CANCEL to end)", wxOK|wxCANCEL );
}
@ -2595,7 +2595,7 @@ void FormMain::OnRemovePage( wxCommandEvent& WXUNUSED(event) )
void FormMain::OnSaveState( wxCommandEvent& WXUNUSED(event) )
{
m_savedState = m_pPropGridManager->SaveEditableState();
wxLogDebug("Saved editable state string: \"%s\"", m_savedState.c_str());
wxLogDebug("Saved editable state string: \"%s\"", m_savedState);
}
// -----------------------------------------------------------------------

View file

@ -65,7 +65,7 @@ void MyFrame::OnPropertyGridChange(wxPropertyGridEvent &event)
if ( p )
{
wxLogVerbose("OnPropertyGridChange(%s, value=%s)",
p->GetName().c_str(), p->GetValueAsString().c_str());
p->GetName(), p->GetValueAsString());
}
else
{
@ -77,7 +77,7 @@ void MyFrame::OnPropertyGridChanging(wxPropertyGridEvent &event)
{
wxPGProperty* p = event.GetProperty();
wxLogVerbose("OnPropertyGridChanging(%s)", p->GetName().c_str());
wxLogVerbose("OnPropertyGridChanging(%s)", p->GetName());
}
void MyFrame::OnAction(wxCommandEvent &)

View file

@ -147,14 +147,14 @@ void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) )
wxVariant& a = v[n];
t.Printf(" attribute %i: name=\"%s\" (type=\"%s\" value=\"%s\")\n",(int)n,
a.GetName().c_str(),a.GetType().c_str(),a.GetString().c_str());
a.GetName(),a.GetType(),a.GetString());
text += t;
}
}
else
{
t.Printf("%i: name=\"%s\" type=\"%s\" value=\"%s\"\n",(int)i,
v.GetName().c_str(),v.GetType().c_str(),strValue.c_str());
v.GetName(),v.GetType(),strValue);
text += t;
}
}
@ -207,7 +207,7 @@ public:
int warningsOccurred = wxPGGlobalVars->m_warnings - m_preWarnings;
if ( warningsOccurred )
{
wxString s = wxString::Format("%i warnings occurred during test '%s'", warningsOccurred, m_name.c_str());
wxString s = wxString::Format("%i warnings occurred during test '%s'", warningsOccurred, m_name);
m_errorMessages->push_back(s);
Msg(s);
}
@ -258,7 +258,7 @@ protected:
wxString s1 = wxString::Format("Test failure in tests.cpp, line %i.",__LINE__-1); \
errorMessages.push_back(s1); \
wxLogDebug(s1); \
wxString s2 = wxString::Format("Message: %s",MSG.c_str()); \
wxString s2 = wxString::Format("Message: %s",MSG); \
errorMessages.push_back(s2); \
wxLogDebug(s2); \
failures++; \
@ -270,7 +270,7 @@ protected:
unsigned int h2_ = PROPS->GetActualVirtualHeight(); \
if ( h1_ != h2_ ) \
{ \
wxString s_ = wxString::Format("VirtualHeight = %i, should be %i (%s)", h1_, h2_, EXTRATEXT.c_str()); \
wxString s_ = wxString::Format("VirtualHeight = %i, should be %i (%s)", h1_, h2_, EXTRATEXT); \
RT_FAILURE_MSG(s_); \
_failed_ = true; \
} \
@ -382,9 +382,9 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
{
wxPGProperty* p = it.GetProperty();
if ( p->IsCategory() )
RT_FAILURE_MSG(wxString::Format("'%s' is a category (non-private child property expected)",p->GetLabel().c_str()))
RT_FAILURE_MSG(wxString::Format("'%s' is a category (non-private child property expected)",p->GetLabel()))
else if ( p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) )
RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property expected)",p->GetLabel().c_str()))
RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property expected)",p->GetLabel()))
count++;
}
@ -397,7 +397,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
{
wxPGProperty* p = it.GetProperty();
if ( !p->IsCategory() )
RT_FAILURE_MSG(wxString::Format("'%s' is not a category (only category was expected)",p->GetLabel().c_str()))
RT_FAILURE_MSG(wxString::Format("'%s' is not a category (only category was expected)",p->GetLabel()))
count++;
}
@ -410,7 +410,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
{
wxPGProperty* p = it.GetProperty();
if ( p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) )
RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property or category expected)",p->GetLabel().c_str()))
RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property or category expected)",p->GetLabel()))
count++;
}
@ -423,9 +423,9 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
{
wxPGProperty* p = it.GetProperty();
if ( (p->GetParent() != p->GetParentState()->DoGetRoot() && !p->GetParent()->IsExpanded()) )
RT_FAILURE_MSG(wxString::Format("'%s' had collapsed parent (only visible properties expected)",p->GetLabel().c_str()))
RT_FAILURE_MSG(wxString::Format("'%s' had collapsed parent (only visible properties expected)",p->GetLabel()))
else if ( p->HasFlag(wxPG_PROP_HIDDEN) )
RT_FAILURE_MSG(wxString::Format("'%s' was hidden (only visible properties expected)",p->GetLabel().c_str()))
RT_FAILURE_MSG(wxString::Format("'%s' was hidden (only visible properties expected)",p->GetLabel()))
count++;
}
@ -476,7 +476,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
for ( it2 = array.rbegin(); it2 != array.rend(); ++it2 )
{
wxPGProperty* p = (wxPGProperty*)*it2;
RT_MSG(wxString::Format("Deleting '%s' ('%s')",p->GetLabel().c_str(),p->GetName().c_str()));
RT_MSG(wxString::Format("Deleting '%s' ('%s')",p->GetLabel(),p->GetName()));
pgman->DeleteProperty(p);
}
@ -581,7 +581,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxVariant& v = values[j];
t.Printf("%i: name=\"%s\" type=\"%s\"\n",(int)j,
v.GetName().c_str(),v.GetType().c_str());
v.GetName(),v.GetType());
text += t;
}
@ -756,22 +756,22 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( pgman->GetPropertyValueAsString("Car.Model") != "Lamborghini Diablo XYZ" )
{
RT_FAILURE_MSG(wxString::Format("Did not match: Car.Model=%s", pgman->GetPropertyValueAsString("Car.Model").c_str()));
RT_FAILURE_MSG(wxString::Format("Did not match: Car.Model=%s", pgman->GetPropertyValueAsString("Car.Model")));
}
if ( pgman->GetPropertyValueAsInt("Car.Speeds.Max. Speed (mph)") != 100 )
{
RT_FAILURE_MSG(wxString::Format("Did not match: Car.Speeds.Max. Speed (mph)=%s", pgman->GetPropertyValueAsString("Car.Speeds.Max. Speed (mph)").c_str()));
RT_FAILURE_MSG(wxString::Format("Did not match: Car.Speeds.Max. Speed (mph)=%s", pgman->GetPropertyValueAsString("Car.Speeds.Max. Speed (mph)")));
}
if ( pgman->GetPropertyValueAsInt("Car.Price ($)") != 3000002 )
{
RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Price ($)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Price ($)")).c_str()));
RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Price ($)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Price ($)"))));
}
if ( !pgman->GetPropertyValueAsBool("Car.Convertible") )
{
RT_FAILURE_MSG(wxString::Format("Did not match: Car.Convertible=%s", pgman->GetPropertyValueAsString("Car.Convertible").c_str()));
RT_FAILURE_MSG(wxString::Format("Did not match: Car.Convertible=%s", pgman->GetPropertyValueAsString("Car.Convertible")));
}
// SetPropertyValueString for special cases such as wxColour
@ -977,10 +977,10 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxString s;
if ( wxPropertyGrid::DoubleToString(s, 123.123, 2, true) !=
wxString::Format("123%s12", sep.c_str()) )
wxString::Format("123%s12", sep) )
RT_FAILURE();
if ( wxPropertyGrid::DoubleToString(s, -123.123, 4, false) !=
wxString::Format("-123%s1230", sep.c_str()) )
wxString::Format("-123%s1230", sep) )
RT_FAILURE();
if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) !=
wxString::Format("0%s0", sep) )
@ -1039,7 +1039,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
page->Collapse( p );
t.Printf("Collapsing: %s\n",page->GetPropertyLabel(p).c_str());
t.Printf("Collapsing: %s\n",page->GetPropertyLabel(p));
ed->AppendText(t);
}
}
@ -1080,7 +1080,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
page->Expand( p );
t.Printf("Expand: %s\n",page->GetPropertyLabel(p).c_str());
t.Printf("Expand: %s\n",page->GetPropertyLabel(p));
ed->AppendText(t);
}
}
@ -1305,7 +1305,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p = arr1[i];
page->HideProperty(p, true);
wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel().c_str());
wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel());
RT_VALIDATE_VIRTUAL_HEIGHT(page, s)
if ( _failed_ )
break;
@ -1321,7 +1321,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p = arr2[i];
page->HideProperty(p, false);
wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel().c_str());
wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel());
RT_VALIDATE_VIRTUAL_HEIGHT(page, s)
if ( _failed_ )
break;
@ -1339,7 +1339,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p = arr1[i];
page->HideProperty(p, true);
wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel().c_str());
wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel());
RT_VALIDATE_VIRTUAL_HEIGHT(page, s)
if ( _failed_ )
break;
@ -1355,7 +1355,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p = arr2[i];
page->HideProperty(p, false);
wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel().c_str());
wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel());
RT_VALIDATE_VIRTUAL_HEIGHT(page, s)
if ( _failed_ )
break;
@ -1374,7 +1374,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p = arr1[i];
page->HideProperty(p, true);
wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel().c_str());
wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel());
RT_VALIDATE_VIRTUAL_HEIGHT(page, s)
if ( _failed_ )
break;
@ -1390,7 +1390,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
wxPGProperty* p = arr2[i];
page->HideProperty(p, false);
wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel().c_str());
wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel());
RT_VALIDATE_VIRTUAL_HEIGHT(page, s)
if ( _failed_ )
break;
@ -1478,37 +1478,37 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
!p->HasFlag(wxPG_PROP_COLLAPSED) )
{
RT_FAILURE_MSG(wxString::Format("Error setting flag from string 'COLLAPSED' for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( flags.Find("COLLAPSED") == wxNOT_FOUND &&
p->HasFlag(wxPG_PROP_COLLAPSED) )
{
RT_FAILURE_MSG(wxString::Format("Error resetting flag from string 'COLLAPSED'for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( flags.Find("DISABLED") != wxNOT_FOUND &&
!p->HasFlag(wxPG_PROP_DISABLED) )
{
RT_FAILURE_MSG(wxString::Format("Error setting flag from string 'DISABLED' for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( flags.Find("DISABLED") == wxNOT_FOUND &&
p->HasFlag(wxPG_PROP_DISABLED) )
{
RT_FAILURE_MSG(wxString::Format("Error resetting flag from string 'DISABLED' for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( flags.Find("HIDDEN") != wxNOT_FOUND &&
!p->HasFlag(wxPG_PROP_HIDDEN) )
{
RT_FAILURE_MSG(wxString::Format("Error setting flag from string 'HIDDEN' for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( flags.Find("HIDDEN") == wxNOT_FOUND &&
p->HasFlag(wxPG_PROP_HIDDEN) )
{
RT_FAILURE_MSG(wxString::Format("Error resetting flag from string 'HIDDEN' for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
// Get individual flags
@ -1526,7 +1526,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_COLLAPSED flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
flags = p->GetFlagsAsString(wxPG_PROP_DISABLED);
@ -1541,7 +1541,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_DISABLED flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
flags = p->GetFlagsAsString(wxPG_PROP_HIDDEN);
@ -1556,7 +1556,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_HIDDEN flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
flags = p->GetFlagsAsString(wxPG_PROP_NOEDITOR);
@ -1571,7 +1571,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_NOEDITOR flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
// Get all flags
@ -1587,7 +1587,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_COLLAPSED flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( p->HasFlag(wxPG_PROP_DISABLED) )
@ -1601,7 +1601,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_DISBALED flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( p->HasFlag(wxPG_PROP_HIDDEN) )
@ -1615,7 +1615,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_HIDDEN flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
if ( p->HasFlag(wxPG_PROP_NOEDITOR) )
@ -1629,7 +1629,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
if ( !ok )
{
RT_FAILURE_MSG(wxString::Format("Invalid string for wxPG_PROP_NOEDITOR flag for property '%s'",
p->GetName().c_str()));
p->GetName()));
}
// Restore original flags

View file

@ -845,7 +845,7 @@ void RegTreeCtrl::OnEndEdit(wxTreeEvent& event)
if ( !ok )
{
wxLogError("Failed to rename '%s' to '%s'.",
m_nameOld.c_str(), name.c_str());
m_nameOld, name);
}
#if 0 // MSW tree ctrl doesn't like this at all, it hangs
else
@ -920,10 +920,10 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
if ( wxMessageBox(wxString::Format
(
"Do you really want to %s the %s %s to %s?",
verb.c_str(),
what.c_str(),
nameSrc.c_str(),
nameDst.c_str()
verb,
what,
nameSrc,
nameDst
),
"RegTest Confirm",
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
@ -938,7 +938,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
ok = keyDst.Create(false);
if ( !ok )
{
wxLogError("Key '%s' already exists", keyDst.GetName().c_str());
wxLogError("Key '%s' already exists", keyDst.GetName());
}
else
{
@ -969,7 +969,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
if ( !ok )
{
wxLogError("Failed to %s registry %s.",
verb.c_str(), what.c_str());
verb, what);
}
else
{
@ -1255,7 +1255,7 @@ void RegTreeCtrl::GoTo(const wxString& location)
if ( !id.IsOk() )
{
wxLogError("No such key '%s'.", location.c_str());
wxLogError("No such key '%s'.", location);
return;
}
@ -1291,7 +1291,7 @@ void RegTreeCtrl::DeleteSelected()
if ( wxMessageBox(wxString::Format
(
"Do you really want to delete this %s?",
what.c_str()
what
),
"Confirmation",
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES )
@ -1390,7 +1390,7 @@ void RegTreeCtrl::ShowProperties()
else
{
wxLogMessage("Key '%s' has %u subkeys and %u values.",
key.GetName().c_str(), nSubKeys, nValues);
key.GetName(), nSubKeys, nValues);
}
}
else // it's a value
@ -1403,7 +1403,7 @@ void RegTreeCtrl::ShowProperties()
wxLogMessage("Value '%s' under the key '%s' is of type "
"%d (%s).",
value,
parent->m_strName.c_str(),
parent->m_strName,
key.GetValueType(value),
key.IsNumericValue(value) ? "numeric" : "string");

View file

@ -571,7 +571,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event))
wxRendererNative *renderer = wxRendererNative::Load(name);
if ( !renderer )
{
wxLogError("Failed to load renderer \"%s\".", name.c_str());
wxLogError("Failed to load renderer \"%s\".", name);
}
else // loaded ok
{
@ -580,7 +580,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event))
m_panel->Refresh();
wxLogStatus(this, "Successfully loaded the renderer \"%s\".",
name.c_str());
name);
}
}

View file

@ -98,7 +98,7 @@ public:
virtual bool EditProperties(wxRichTextField* WXUNUSED(obj), wxWindow* WXUNUSED(parent), wxRichTextBuffer* WXUNUSED(buffer)) wxOVERRIDE
{
wxString label = GetLabel();
wxMessageBox(wxString::Format("Editing %s", label.c_str()));
wxMessageBox(wxString::Format("Editing %s", label));
return true;
}

View file

@ -173,7 +173,7 @@ WX_DEFINE_LIST(EList);
wxString
CreateIdent(const wxIPV4address& addr)
{
return wxString::Format("%s:%d",addr.IPAddress().c_str(),addr.Service());
return wxString::Format("%s:%d",addr.IPAddress(),addr.Service());
}
void
@ -216,11 +216,11 @@ Client::OnCmdLineParsed(wxCmdLineParser& pParser)
{
wxFFile file(fname);
if (!file.IsOpened()) {
wxLogError("Cannot open file %s",fname.c_str());
wxLogError("Cannot open file %s",fname);
return false;
};
if (!file.ReadAll(&m_message)) {
wxLogError("Cannot read content of file %s",fname.c_str());
wxLogError("Cannot read content of file %s",fname);
return false;
};
m_sendType = SEND_MESSAGE;
@ -496,7 +496,7 @@ Client::dumpStatistics() {
m_statFailed
));
wxLogMessage("Current status:\n%s\n",msg.c_str());
wxLogMessage("Current status:\n%s\n",msg);
}
void
@ -550,7 +550,7 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) {
{
if (m_clientSocket->LastError() != wxSOCKET_WOULDBLOCK)
{
wxLogError("%s: read error",CreateIdent(m_localaddr).c_str());
wxLogError("%s: read error",CreateIdent(m_localaddr));
SendEvent(true);
}
}
@ -560,18 +560,18 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) {
if (m_readed == m_insize)
{
if (!memcmp(m_inbuf,m_outbuf,m_insize)) {
wxLogError("%s: data mismatch",CreateIdent(m_localaddr).c_str());
wxLogError("%s: data mismatch",CreateIdent(m_localaddr));
SendEvent(true);
}
m_currentType = WorkerEvent::DISCONNECTING;
wxLogDebug("%s: DISCONNECTING",CreateIdent(m_localaddr).c_str());
wxLogDebug("%s: DISCONNECTING",CreateIdent(m_localaddr));
SendEvent(false);
//wxLogDebug("EventWorker %p closing",this);
m_clientSocket->Close();
m_currentType = WorkerEvent::DONE;
wxLogDebug("%s: DONE",CreateIdent(m_localaddr).c_str());
wxLogDebug("%s: DONE",CreateIdent(m_localaddr));
SendEvent(false);
}
} while (!m_clientSocket->Error());
@ -584,13 +584,13 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) {
if (m_written == 0)
{
m_currentType = WorkerEvent::SENDING;
wxLogDebug("%s: SENDING",CreateIdent(m_localaddr).c_str());
wxLogDebug("%s: SENDING",CreateIdent(m_localaddr));
}
m_clientSocket->Write(m_outbuf + m_written, m_outsize - m_written);
if (m_clientSocket->Error())
{
if (m_clientSocket->LastError() != wxSOCKET_WOULDBLOCK) {
wxLogError("%s: Write error",CreateIdent(m_localaddr).c_str());
wxLogError("%s: Write error",CreateIdent(m_localaddr));
SendEvent(true);
}
}
@ -603,7 +603,7 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) {
{
//wxLogDebug("EventWorker %p SENDING->RECEIVING",this);
m_currentType = WorkerEvent::RECEIVING;
wxLogDebug("%s: RECEIVING",CreateIdent(m_localaddr).c_str());
wxLogDebug("%s: RECEIVING",CreateIdent(m_localaddr));
SendEvent(false);
}
} while(!m_clientSocket->Error());
@ -611,19 +611,19 @@ EventWorker::OnSocketEvent(wxSocketEvent& pEvent) {
case wxSOCKET_CONNECTION:
{
//wxLogMessage("EventWorker: got connection");
wxLogMessage("%s: starting writing message (2 bytes for signature and %d bytes of data to write)",CreateIdent(m_localaddr).c_str(),m_outsize-2);
wxLogMessage("%s: starting writing message (2 bytes for signature and %d bytes of data to write)",CreateIdent(m_localaddr),m_outsize-2);
if (!m_clientSocket->GetLocal(m_localaddr))
{
wxLogError(_("Cannot get peer data for socket %p"),m_clientSocket);
}
m_currentType = WorkerEvent::SENDING;
wxLogDebug("%s: CONNECTING",CreateIdent(m_localaddr).c_str());
wxLogDebug("%s: CONNECTING",CreateIdent(m_localaddr));
SendEvent(false);
}
break;
case wxSOCKET_LOST:
{
wxLogError(_("%s: connection lost"),CreateIdent(m_localaddr).c_str());
wxLogError(_("%s: connection lost"),CreateIdent(m_localaddr));
SendEvent(true);
}
break;
@ -672,7 +672,7 @@ wxThread::ExitCode ThreadWorker::Entry()
bool failed = false;
WorkerEvent::evt_type etype = WorkerEvent::CONNECTING;
if (!m_clientSocket->Connect(ca)) {
wxLogError("Cannot connect to %s:%d",ca.IPAddress().c_str(), ca.Service());
wxLogError("Cannot connect to %s:%d",ca.IPAddress(), ca.Service());
failed = true;
} else {
//wxLogMessage("ThreadWorker: Connected. Sending %d bytes of data",m_outsize);

View file

@ -385,7 +385,7 @@ void Server::OnSocketEvent(wxSocketEvent& pEvent)
{
wxLogError("Server: cannot get peer info");
} else {
wxLogMessage("Got connection from %s:%d",addr.IPAddress().c_str(), addr.Service());
wxLogMessage("Got connection from %s:%d",addr.IPAddress(), addr.Service());
}
bool createThread;

View file

@ -254,7 +254,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) )
wxString msg;
if ( focus )
{
msg.Printf("Focus is at %s", s_windowFocus->GetName().c_str());
msg.Printf("Focus is at %s", s_windowFocus->GetName());
}
else
{

View file

@ -726,7 +726,7 @@ void MyTextCtrl::LogKeyEvent(const wxString& name, wxKeyEvent& event) const
wxLogMessage( "%s event: %s (flags = %c%c%c%c)",
name,
key.c_str(),
key,
GetChar( event.ControlDown(), 'C' ),
GetChar( event.AltDown(), 'A' ),
GetChar( event.ShiftDown(), 'S' ),
@ -781,7 +781,7 @@ static wxString GetMouseEventDesc(const wxMouseEvent& ev)
wxASSERT(!(dbl && up));
return wxString::Format("%s mouse button %s",
button.c_str(),
button,
dbl ? "double clicked"
: up ? "released" : "clicked");
}
@ -973,8 +973,8 @@ void MyTextCtrl::OnTextURL(wxTextUrlEvent& event)
end = event.GetURLEnd();
wxLogMessage("Mouse event over URL '%s': %s",
GetValue().Mid(start, end - start).c_str(),
GetMouseEventDesc(ev).c_str());
GetValue().Mid(start, end - start),
GetMouseEventDesc(ev));
}
void MyTextCtrl::OnChar(wxKeyEvent& event)
@ -1018,12 +1018,12 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
wxLogMessage("Selection: from %ld to %ld.", from, to);
wxLogMessage("Selection = '%s' (len = %u)",
sel.c_str(),
sel,
(unsigned int) sel.length());
const wxString text = GetLineText(line);
wxLogMessage("Current line: \"%s\"; length = %lu",
text.c_str(), text.length());
text, text.length());
}
break;

View file

@ -853,7 +853,7 @@ void MyFrame::OnToolRightClick(wxCommandEvent& event)
void MyFrame::OnCombo(wxCommandEvent& event)
{
wxLogStatus("Combobox string '%s' selected", event.GetString().c_str());
wxLogStatus("Combobox string '%s' selected", event.GetString());
}
void MyFrame::DoEnablePrint()

View file

@ -588,7 +588,7 @@ void MyFrame::OnDumpSelected(wxCommandEvent& WXUNUSED(event))
for ( size_t n = 0; n < count; n++ )
{
wxLogMessage("\t%s", m_treeCtrl->GetItemText(array.Item(n)).c_str());
wxLogMessage("\t%s", m_treeCtrl->GetItemText(array.Item(n)));
}
}
@ -1306,7 +1306,7 @@ void MyTreeCtrl::LogEvent(const wxString& name, const wxTreeEvent& event)
text << '"' << GetItemText(item).c_str() << '"';
else
text = "invalid item";
wxLogMessage("%s(%s)", name, text.c_str());
wxLogMessage("%s(%s)", name, text);
}
// avoid repetition
@ -1466,7 +1466,7 @@ void LogKeyEvent(const wxString& name, const wxKeyEvent& event)
wxLogMessage( "%s event: %s (flags = %c%c%c%c)",
name,
key.c_str(),
key,
event.ControlDown() ? 'C' : '-',
event.AltDown() ? 'A' : '-',
event.ShiftDown() ? 'S' : '-',
@ -1491,7 +1491,7 @@ void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
wxPoint screenpt = ClientToScreen(clientpt);
wxLogMessage("OnBeginDrag: started dragging %s at screen coords (%i,%i)",
GetItemText(m_draggedItem).c_str(),
GetItemText(m_draggedItem),
screenpt.x, screenpt.y);
event.Allow();
@ -1524,7 +1524,7 @@ void MyTreeCtrl::OnEndDrag(wxTreeEvent& event)
wxString text = GetItemText(itemSrc);
wxLogMessage("OnEndDrag: '%s' copied to '%s'.",
text.c_str(), GetItemText(itemDst).c_str());
text, GetItemText(itemDst));
// just do append here - we could also insert it just before/after the item
// on which it was dropped, but this requires slightly more work... we also
@ -1712,7 +1712,7 @@ void MyTreeItemData::ShowInfo(wxTreeCtrl *tree)
{
wxLogMessage("Item '%s': %sselected, %sexpanded, %sbold,\n"
"%u children (%u immediately under this item).",
m_desc.c_str(),
m_desc,
Bool2String(tree->IsSelected(GetId())),
Bool2String(tree->IsExpanded(GetId())),
Bool2String(tree->IsBold(GetId())),

View file

@ -158,7 +158,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
std_file_output << f << "\n";
wxString str( "Hello!" );
tmp.Printf( "String: %s\n", str.c_str() );
tmp.Printf( "String: %s\n", str );
textCtrl.WriteText( tmp );
text_output << str << "\n";
std_file_output << str.ToAscii() << "\n";
@ -188,7 +188,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
char std_buf[200];
std_file_input >> std_buf;
str = wxString::FromAscii(std_buf);
tmp.Printf( "String: %s\n", str.c_str() );
tmp.Printf( "String: %s\n", str );
textCtrl.WriteText( tmp );
textCtrl.WriteText( "\nReading from wxFileInputStream:\n" );
@ -216,7 +216,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( tmp );
text_input >> str;
tmp.Printf( "String: %s\n", str.c_str() );
tmp.Printf( "String: %s\n", str );
textCtrl.WriteText( tmp );
@ -244,7 +244,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
data_output.WriteDouble( d );
str = "Hello!";
tmp.Printf( "String: %s\n", str.c_str() );
tmp.Printf( "String: %s\n", str );
textCtrl.WriteText( tmp );
data_output.WriteString( str );
@ -268,7 +268,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( tmp );
str = data_input.ReadString();
tmp.Printf( "String: %s\n", str.c_str() );
tmp.Printf( "String: %s\n", str );
textCtrl.WriteText( tmp );
}

View file

@ -769,7 +769,7 @@ void WebFrame::OnFindText(wxCommandEvent& evt)
{
count++;
}
wxLogMessage("Searching for:%s current match:%li/%i", m_findText.c_str(), count, m_findCount);
wxLogMessage("Searching for:%s current match:%li/%i", m_findText, count, m_findCount);
}
/**

View file

@ -806,11 +806,11 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event)
if (event.GetEventType() == wxEVT_TEXT_ENTER)
{
wxLogMessage("BitmapCombobox enter pressed (now '%s')", s.c_str());
wxLogMessage("BitmapCombobox enter pressed (now '%s')", s);
}
else
{
wxLogMessage("BitmapCombobox text changed (now '%s')", s.c_str());
wxLogMessage("BitmapCombobox text changed (now '%s')", s);
}
}
@ -821,7 +821,7 @@ void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event)
wxLogMessage("BitmapCombobox item %ld selected", sel);
wxLogMessage("BitmapCombobox GetValue(): %s", m_combobox->GetValue().c_str() );
wxLogMessage("BitmapCombobox GetValue(): %s", m_combobox->GetValue() );
}
void BitmapComboBoxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))

View file

@ -218,7 +218,7 @@ void ColourPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void ColourPickerWidgetsPage::OnColourChange(wxColourPickerEvent& event)
{
wxLogMessage("The colour changed to '%s' !",
event.GetColour().GetAsString(wxC2S_CSS_SYNTAX).c_str());
event.GetColour().GetAsString(wxC2S_CSS_SYNTAX));
}
void ColourPickerWidgetsPage::OnCheckBox(wxCommandEvent &event)

View file

@ -662,11 +662,11 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
if (event.GetEventType() == wxEVT_TEXT_ENTER)
{
wxLogMessage("Combobox enter pressed (now '%s')", s.c_str());
wxLogMessage("Combobox enter pressed (now '%s')", s);
}
else
{
wxLogMessage("Combobox text changed (now '%s')", s.c_str());
wxLogMessage("Combobox text changed (now '%s')", s);
}
}
@ -685,7 +685,7 @@ void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)
wxLogMessage("Combobox item %ld selected", sel);
wxLogMessage("Combobox GetValue(): %s", m_combobox->GetValue().c_str() );
wxLogMessage("Combobox GetValue(): %s", m_combobox->GetValue() );
if ( event.GetString() != m_combobox->GetValue() )
{

View file

@ -247,7 +247,7 @@ void DirPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void DirPickerWidgetsPage::OnDirChange(wxFileDirPickerEvent& event)
{
wxLogMessage("The directory changed to '%s' ! The current working directory is '%s'",
event.GetPath().c_str(), wxGetCwd().c_str());
event.GetPath(), wxGetCwd());
}
void DirPickerWidgetsPage::OnCheckBox(wxCommandEvent &event)

View file

@ -311,7 +311,7 @@ void FilePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void FilePickerWidgetsPage::OnFileChange(wxFileDirPickerEvent& event)
{
wxLogMessage("The file changed to '%s' ! The current working directory is '%s'",
event.GetPath().c_str(), wxGetCwd().c_str());
event.GetPath(), wxGetCwd());
}
void FilePickerWidgetsPage::OnCheckBox(wxCommandEvent &event)

View file

@ -219,7 +219,7 @@ void FontPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event))
void FontPickerWidgetsPage::OnFontChange(wxFontPickerEvent& event)
{
wxLogMessage("The font changed to '%s' with size %d !",
event.GetFont().GetFaceName().c_str(), event.GetFont().GetPointSize());
event.GetFont().GetFaceName(), event.GetFont().GetPointSize());
}
void FontPickerWidgetsPage::OnCheckBox(wxCommandEvent &event)

View file

@ -123,7 +123,7 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed()
void ItemContainerWidgetsPage::StartTest(const wxString& label)
{
m_container->Clear();
wxLogMessage("Test - %s:", label.c_str());
wxLogMessage("Test - %s:", label);
}
void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
@ -144,7 +144,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items)
{
wxFAIL_MSG(wxString::Format(
"Wrong string \"%s\" at position %d (expected \"%s\")",
str.c_str(), i, items[i].c_str()));
str, i, items[i]));
ok = false;
break;
}
@ -227,7 +227,7 @@ bool ItemContainerWidgetsPage::VerifyClientData(wxUIntPtr i, const wxString& str
{
if ( i > m_items.GetCount() || m_items[i] != str )
{
wxLogMessage("Client data for '%s' does not match.", str.c_str());
wxLogMessage("Client data for '%s' does not match.", str);
return false;
}

View file

@ -765,11 +765,11 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event)
if (event.GetEventType() == wxEVT_TEXT_ENTER)
{
wxLogMessage("OwnerDrawnCombobox enter pressed (now '%s')", s.c_str());
wxLogMessage("OwnerDrawnCombobox enter pressed (now '%s')", s);
}
else
{
wxLogMessage("OwnerDrawnCombobox text changed (now '%s')", s.c_str());
wxLogMessage("OwnerDrawnCombobox text changed (now '%s')", s);
}
}
@ -780,7 +780,7 @@ void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event)
wxLogMessage("OwnerDrawnCombobox item %ld selected", sel);
wxLogMessage("OwnerDrawnCombobox GetValue(): %s", m_combobox->GetValue().c_str() );
wxLogMessage("OwnerDrawnCombobox GetValue(): %s", m_combobox->GetValue() );
}
void ODComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event)

View file

@ -363,7 +363,7 @@ void RadioWidgetsPage::CreateRadio()
for ( size_t n = 0; n < count; n++ )
{
items[n] = wxString::Format("%s %lu",
labelBtn.c_str(), (unsigned long)n + 1);
labelBtn, (unsigned long)n + 1);
}
int flags = m_chkSpecifyRows->GetValue() ? wxRA_SPECIFY_ROWS

View file

@ -587,7 +587,7 @@ void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event)
void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event)
{
wxLogMessage("Text changed in spin control, now \"%s\"",
event.GetString().c_str());
event.GetString());
}
void SpinBtnWidgetsPage::OnSpinTextEnter(wxCommandEvent& event)

View file

@ -139,7 +139,7 @@ void StatBmpWidgetsPage::RecreateWidget()
}
else
{
wxLogMessage("Reading image from file '%s' failed.", filepath.c_str());
wxLogMessage("Reading image from file '%s' failed.", filepath);
}
}

View file

@ -317,7 +317,7 @@ private:
break;
}
wxLogMessage("Mouse is %s (%ld, %ld)", where.c_str(), x, y);
wxLogMessage("Mouse is %s (%ld, %ld)", where, x, y);
}
};
@ -941,7 +941,7 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event))
{
long elapsed = sw.Time();
wxLogMessage("Loaded file '%s' in %lu.%us",
filename.c_str(), elapsed / 1000,
filename, elapsed / 1000,
(unsigned int) elapsed % 1000);
}
}
@ -1001,7 +1001,7 @@ void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event))
void TextWidgetsPage::OnTextEnter(wxCommandEvent& event)
{
wxLogMessage("Text entered: '%s'", event.GetString().c_str());
wxLogMessage("Text entered: '%s'", event.GetString());
event.Skip();
}

View file

@ -98,7 +98,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class
wxString objectName = wxString::Format( "LocalObject_%d", objectID );
m_source += ( wxString::Format( "\t%s *%s = new %s;\n",
classInfo->GetClassName(),
objectName.c_str(),
objectName,
classInfo->GetClassName()) );
m_data->SetObjectName( objectID, objectName );
}
@ -106,7 +106,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class
void wxObjectCodeReaderCallback::DestroyObject(int objectID, wxClassInfo *WXUNUSED(classInfo))
{
m_source += ( wxString::Format( "\tdelete %s;\n",
m_data->GetObjectName( objectID).c_str() ) );
m_data->GetObjectName( objectID) ) );
}
class WXDLLIMPEXP_BASE wxObjectConstructorWriter: public wxObjectWriterFunctor
@ -150,8 +150,8 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny &param )
const wxCustomTypeInfo* cti = wx_dynamic_cast(const wxCustomTypeInfo*, type);
if ( cti )
{
value.Printf( "%s(%s)", cti->GetTypeName().c_str(),
wxAnyGetAsString(param).c_str() );
value.Printf( "%s(%s)", cti->GetTypeName(),
wxAnyGetAsString(param) );
}
else
{
@ -160,7 +160,7 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny &param )
}
else if ( type->GetKind() == wxT_STRING )
{
value.Printf( "\"%s\"", wxAnyGetAsString(param).c_str() );
value.Printf( "\"%s\"", wxAnyGetAsString(param) );
}
else if ( type->GetKind() == wxT_OBJECT )
{
@ -178,7 +178,7 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny &param )
}
else
{
value.Printf( "%s", wxAnyGetAsString(param).c_str() );
value.Printf( "%s", wxAnyGetAsString(param) );
}
return value;
@ -195,20 +195,20 @@ void wxObjectCodeReaderCallback::CreateObject(int objectID,
{
int i;
m_source += ( wxString::Format( "\t%s->Create(",
m_data->GetObjectName(objectID).c_str() ) );
m_data->GetObjectName(objectID) ) );
for (i = 0; i < paramCount; i++)
{
if ( objectIDValues[i] != wxInvalidObjectID )
{
wxString str =
wxString::Format( "%s",
m_data->GetObjectName( objectIDValues[i] ).c_str() );
m_data->GetObjectName( objectIDValues[i] ) );
m_source += ( str );
}
else
{
m_source += (
wxString::Format( "%s", ValueAsCode(params[i]).c_str() ) );
wxString::Format( "%s", ValueAsCode(params[i]) ) );
}
if (i < paramCount - 1)
m_source += ( ", ");
@ -228,7 +228,7 @@ void wxObjectCodeReaderCallback::ConstructObject(int objectID,
wxString objectName = wxString::Format( "LocalObject_%d", objectID );
m_source += ( wxString::Format( "\t%s *%s = new %s(",
classInfo->GetClassName(),
objectName.c_str(),
objectName,
classInfo->GetClassName()) );
m_data->SetObjectName( objectID, objectName );
@ -237,11 +237,11 @@ void wxObjectCodeReaderCallback::ConstructObject(int objectID,
{
if ( objectIDValues[i] != wxInvalidObjectID )
m_source += ( wxString::Format( "%s",
m_data->GetObjectName( objectIDValues[i] ).c_str() ) );
m_data->GetObjectName( objectIDValues[i] ) ) );
else
{
m_source += (
wxString::Format( "%s", ValueAsCode(params[i]).c_str() ) );
wxString::Format( "%s", ValueAsCode(params[i]) ) );
}
if (i < paramCount - 1)
m_source += ( ", " );
@ -255,9 +255,9 @@ void wxObjectCodeReaderCallback::SetProperty(int objectID,
const wxAny &value)
{
m_source += ( wxString::Format( "\t%s->%s(%s);\n",
m_data->GetObjectName(objectID).c_str(),
propertyInfo->GetAccessor()->GetSetterName().c_str(),
ValueAsCode(value).c_str()) );
m_data->GetObjectName(objectID),
propertyInfo->GetAccessor()->GetSetterName(),
ValueAsCode(value)) );
}
void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID,
@ -267,14 +267,14 @@ void wxObjectCodeReaderCallback::SetPropertyAsObject(int objectID,
{
if ( propertyInfo->GetTypeInfo()->GetKind() == wxT_OBJECT )
m_source += ( wxString::Format( "\t%s->%s(*%s);\n",
m_data->GetObjectName(objectID).c_str(),
propertyInfo->GetAccessor()->GetSetterName().c_str(),
m_data->GetObjectName( valueObjectId).c_str() ) );
m_data->GetObjectName(objectID),
propertyInfo->GetAccessor()->GetSetterName(),
m_data->GetObjectName( valueObjectId) ) );
else
m_source += ( wxString::Format( "\t%s->%s(%s);\n",
m_data->GetObjectName(objectID).c_str(),
propertyInfo->GetAccessor()->GetSetterName().c_str(),
m_data->GetObjectName( valueObjectId).c_str() ) );
m_data->GetObjectName(objectID),
propertyInfo->GetAccessor()->GetSetterName(),
m_data->GetObjectName( valueObjectId) ) );
}
void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID,
@ -283,9 +283,9 @@ void wxObjectCodeReaderCallback::AddToPropertyCollection( int objectID,
const wxAny &value)
{
m_source += ( wxString::Format( "\t%s->%s(%s);\n",
m_data->GetObjectName(objectID).c_str(),
propertyInfo->GetAccessor()->GetAdderName().c_str(),
ValueAsCode(value).c_str()) );
m_data->GetObjectName(objectID),
propertyInfo->GetAccessor()->GetAdderName(),
ValueAsCode(value)) );
}
// sets the corresponding property (value is an object)
@ -319,8 +319,8 @@ void wxObjectCodeReaderCallback::SetConnect(int eventSourceObjectID,
wxString::Format(
"\t%s->Connect( %s->GetId(), %d, "
"(wxObjectEventFunction)(wxEventFunction) & %s::%s, NULL, %s );",
ehsource.c_str(), ehsource.c_str(), eventType, ehsinkClass.c_str(),
handlerName.c_str(), ehsink.c_str() );
ehsource, ehsource, eventType, ehsinkClass,
handlerName, ehsink );
m_source += ( code );
}