Remove (most) occurrences of wxT() macro from the samples
Also replace wxChar* with wxString. Closes https://github.com/wxWidgets/wxWidgets/pull/945
This commit is contained in:
committed by
Vadim Zeitlin
parent
e768046774
commit
f58ea62596
@@ -154,7 +154,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
|
||||
html -> SetBorders(0);
|
||||
html -> LoadPage(wxT("data/about.htm"));
|
||||
html -> LoadPage("data/about.htm");
|
||||
html -> SetInitialSize(wxSize(html -> GetInternalRepresentation() -> GetWidth(),
|
||||
html -> GetInternalRepresentation() -> GetHeight()));
|
||||
|
||||
|
@@ -119,8 +119,8 @@ bool MyApp::OnInit()
|
||||
#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
|
||||
wxFileSystem::AddHandler(new wxZipFSHandler);
|
||||
#endif
|
||||
SetVendorName(wxT("wxWidgets"));
|
||||
SetAppName(wxT("wxHTMLHelp"));
|
||||
SetVendorName("wxWidgets");
|
||||
SetAppName("wxHTMLHelp");
|
||||
|
||||
// Create the main application window
|
||||
MyFrame *frame = new MyFrame(_("HTML Help Sample"),
|
||||
@@ -162,17 +162,17 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
|
||||
help.UseConfig(wxConfig::Get());
|
||||
bool ret;
|
||||
help.SetTempDir(wxT("."));
|
||||
help.SetTempDir(".");
|
||||
|
||||
wxPathList pathlist;
|
||||
pathlist.Add(wxT("./helpfiles"));
|
||||
pathlist.Add(wxT("../helpfiles"));
|
||||
pathlist.Add(wxT("../../html/help/helpfiles"));
|
||||
pathlist.Add("./helpfiles");
|
||||
pathlist.Add("../helpfiles");
|
||||
pathlist.Add("../../html/help/helpfiles");
|
||||
|
||||
ret = help.AddBook(wxFileName(pathlist.FindValidPath(wxT("testing.hhp")), wxPATH_UNIX));
|
||||
ret = help.AddBook(wxFileName(pathlist.FindValidPath("testing.hhp"), wxPATH_UNIX));
|
||||
if (! ret)
|
||||
wxMessageBox(wxT("Failed adding book helpfiles/testing.hhp"));
|
||||
ret = help.AddBook(wxFileName(pathlist.FindValidPath(wxT("another.hhp")), wxPATH_UNIX));
|
||||
wxMessageBox("Failed adding book helpfiles/testing.hhp");
|
||||
ret = help.AddBook(wxFileName(pathlist.FindValidPath("another.hhp"), wxPATH_UNIX));
|
||||
if (! ret)
|
||||
wxMessageBox(_("Failed adding book helpfiles/another.hhp"));
|
||||
}
|
||||
@@ -188,7 +188,7 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
help.Display(wxT("Test HELPFILE"));
|
||||
help.Display("Test HELPFILE");
|
||||
}
|
||||
|
||||
void MyFrame::OnClose(wxCloseEvent& event)
|
||||
|
@@ -66,15 +66,15 @@ bool MyApp::OnInit()
|
||||
wxInitAllImageHandlers();
|
||||
wxFileSystem::AddHandler(new wxZipFSHandler);
|
||||
|
||||
SetVendorName(wxT("wxWidgets"));
|
||||
SetAppName(wxT("wxHTMLHelp"));
|
||||
SetVendorName("wxWidgets");
|
||||
SetAppName("wxHTMLHelp");
|
||||
wxConfig::Get(); // create an instance
|
||||
|
||||
help = new wxHtmlHelpController;
|
||||
|
||||
if (argc < 2) {
|
||||
wxLogError(wxT("Usage : helpview <helpfile> [<more helpfiles>]"));
|
||||
wxLogError(wxT(" helpfile may be .hhp, .zip or .htb"));
|
||||
wxLogError("Usage : helpview <helpfile> [<more helpfiles>]");
|
||||
wxLogError(" helpfile may be .hhp, .zip or .htb");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -132,7 +132,7 @@ bool MyApp::OnInit()
|
||||
return false;
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(wxT("wxWebKit Sample"));
|
||||
MyFrame *frame = new MyFrame("wxWebKit Sample");
|
||||
|
||||
// and show it (the frames, unlike simple controls, are not shown when
|
||||
// created initially)
|
||||
@@ -183,7 +183,7 @@ MyFrame::MyFrame(const wxString& title)
|
||||
wxButton* btnReload = new wxButton(myToolbar, ID_RELOAD, _("Reload"));
|
||||
myToolbar->AddControl(btnReload);
|
||||
myToolbar->AddSeparator();
|
||||
urlText = new wxTextCtrl(myToolbar, ID_URLLIST, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(220, -1), wxTE_PROCESS_ENTER);
|
||||
urlText = new wxTextCtrl(myToolbar, ID_URLLIST, "http://www.wxwidgets.org", wxDefaultPosition, wxSize(220, -1), wxTE_PROCESS_ENTER);
|
||||
myToolbar->AddControl(urlText);
|
||||
myToolbar->AddSeparator();
|
||||
myToolbar->Realize();
|
||||
@@ -195,7 +195,7 @@ MyFrame::MyFrame(const wxString& title)
|
||||
wxBoxSizer* boxSizer = new wxBoxSizer(wxVERTICAL);
|
||||
panel->SetSizer(boxSizer);
|
||||
|
||||
mySafari = new wxWebKitCtrl(panel, ID_WEBKIT, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200));
|
||||
mySafari = new wxWebKitCtrl(panel, ID_WEBKIT, "http://www.wxwidgets.org", wxDefaultPosition, wxSize(200, 200));
|
||||
|
||||
boxSizer->Add(mySafari, 1, wxEXPAND);
|
||||
|
||||
@@ -203,7 +203,7 @@ MyFrame::MyFrame(const wxString& title)
|
||||
SetSizer(frameSizer);
|
||||
frameSizer->Add(panel, 1, wxEXPAND);
|
||||
#else
|
||||
mySafari = new wxWebKitCtrl(this, ID_WEBKIT, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200));
|
||||
mySafari = new wxWebKitCtrl(this, ID_WEBKIT, "http://www.wxwidgets.org", wxDefaultPosition, wxSize(200, 200));
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
@@ -274,7 +274,7 @@ void MyFrame::OnSetSource(wxCommandEvent& WXUNUSED(myEvent))
|
||||
{
|
||||
if (mySafari)
|
||||
{
|
||||
wxString myText = wxT("<HTML><HEAD></HEAD><BODY><P>Hello world!</P></BODY></HTML>");
|
||||
wxString myText = "<HTML><HEAD></HEAD><BODY><P>Hello world!</P></BODY></HTML>";
|
||||
mySafari->SetPageSource(myText);
|
||||
}
|
||||
}
|
||||
|
@@ -205,15 +205,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
#if wxUSE_STATUSBAR
|
||||
m_Html -> SetRelatedStatusBar(0);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
m_Name = wxT("test.htm");
|
||||
m_Name = "test.htm";
|
||||
m_Html -> LoadPage(m_Name);
|
||||
|
||||
m_Prn = new wxHtmlEasyPrinting(_("Easy Printing Demo"), this);
|
||||
m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL);
|
||||
m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
|
||||
|
||||
// To specify where the AFM files are kept on Unix,
|
||||
// you may wish to do something like this
|
||||
// m_Prn->GetPrintData()->SetFontMetricPath(wxT("/home/julians/afm"));
|
||||
// m_Prn->GetPrintData()->SetFontMetricPath("/home/julians/afm");
|
||||
}
|
||||
|
||||
// frame destructor
|
||||
@@ -258,13 +258,13 @@ void MyFrame::OnPreview(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFileDialog dialog(this, _("Open HTML page"), wxT(""), wxT(""), wxT("*.htm"), 0);
|
||||
wxFileDialog dialog(this, _("Open HTML page"), "", "", "*.htm", 0);
|
||||
|
||||
if (dialog.ShowModal() == wxID_OK)
|
||||
{
|
||||
m_Name = dialog.GetPath();
|
||||
m_Html -> LoadPage(m_Name);
|
||||
m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL);
|
||||
m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,10 +113,10 @@ public:
|
||||
virtual wxString Process(const wxString& s) const wxOVERRIDE
|
||||
{
|
||||
wxString r(s);
|
||||
r.Replace(wxT("<b>"), wxEmptyString);
|
||||
r.Replace(wxT("<B>"), wxEmptyString);
|
||||
r.Replace(wxT("</b>"), wxEmptyString);
|
||||
r.Replace(wxT("</B>"), wxEmptyString);
|
||||
r.Replace("<b>", wxEmptyString);
|
||||
r.Replace("<B>", wxEmptyString);
|
||||
r.Replace("</b>", wxEmptyString);
|
||||
r.Replace("</B>", wxEmptyString);
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ bool MyApp::OnInit()
|
||||
return false;
|
||||
|
||||
#if wxUSE_SYSTEM_OPTIONS
|
||||
wxSystemOptions::SetOption(wxT("no-maskblt"), 1);
|
||||
wxSystemOptions::SetOption("no-maskblt", 1);
|
||||
#endif
|
||||
|
||||
wxInitAllImageHandlers();
|
||||
@@ -183,8 +183,8 @@ bool MyApp::OnInit()
|
||||
wxFileSystem::AddHandler(new wxInternetFSHandler);
|
||||
#endif
|
||||
|
||||
SetVendorName(wxT("wxWidgets"));
|
||||
SetAppName(wxT("wxHtmlTest"));
|
||||
SetVendorName("wxWidgets");
|
||||
SetAppName("wxHtmlTest");
|
||||
// the following call to wxConfig::Get will use it to create an object...
|
||||
|
||||
// Create the main application window
|
||||
@@ -203,7 +203,7 @@ bool MyApp::OnInit()
|
||||
// frame constructor
|
||||
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size,
|
||||
wxDEFAULT_FRAME_STYLE, wxT("html_test_app"))
|
||||
wxDEFAULT_FRAME_STYLE, "html_test_app")
|
||||
{
|
||||
// create a menu bar
|
||||
wxMenu *menuFile = new wxMenu;
|
||||
@@ -254,10 +254,10 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
m_Html->SetRelatedStatusBar(1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
m_Html->ReadCustomization(wxConfig::Get());
|
||||
m_Html->LoadFile(wxFileName(wxT("test.htm")));
|
||||
m_Html->LoadFile(wxFileName("test.htm"));
|
||||
m_Html->AddProcessor(m_Processor);
|
||||
|
||||
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""),
|
||||
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, "",
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE);
|
||||
|
||||
@@ -285,7 +285,7 @@ void MyFrame::OnPageOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
#if wxUSE_FILEDLG
|
||||
wxString p = wxFileSelector(_("Open HTML document"), wxEmptyString,
|
||||
wxEmptyString, wxEmptyString, wxT("HTML files|*.htm;*.html"));
|
||||
wxEmptyString, wxEmptyString, "HTML files|*.htm;*.html");
|
||||
|
||||
if (!p.empty())
|
||||
{
|
||||
@@ -314,7 +314,7 @@ void MyFrame::OnDefaultWebBrowser(wxCommandEvent& WXUNUSED(event))
|
||||
wxString page = m_Html->GetOpenedPage();
|
||||
if (!page.empty())
|
||||
{
|
||||
wxLaunchDefaultBrowser(wxT("http://www.google.com"));
|
||||
wxLaunchDefaultBrowser("http://www.google.com");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ void MyFrame::OnDrawCustomBg(wxCommandEvent& event)
|
||||
|
||||
void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
|
||||
{
|
||||
wxLogMessage(wxT("The url '%s' has been clicked!"), event.GetLinkInfo().GetHref().c_str());
|
||||
wxLogMessage("The url '%s' has been clicked!", event.GetLinkInfo().GetHref().c_str());
|
||||
|
||||
// skipping this event the default behaviour (load the clicked URL)
|
||||
// will happen...
|
||||
@@ -356,13 +356,13 @@ void MyFrame::OnHtmlLinkClicked(wxHtmlLinkEvent &event)
|
||||
|
||||
void MyFrame::OnHtmlCellHover(wxHtmlCellEvent &event)
|
||||
{
|
||||
wxLogMessage(wxT("Mouse moved over cell %p at %d;%d"),
|
||||
wxLogMessage("Mouse moved over cell %p at %d;%d",
|
||||
event.GetCell(), event.GetPoint().x, event.GetPoint().y);
|
||||
}
|
||||
|
||||
void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event)
|
||||
{
|
||||
wxLogMessage(wxT("Click over cell %p at %d;%d"),
|
||||
wxLogMessage("Click over cell %p at %d;%d",
|
||||
event.GetCell(), event.GetPoint().x, event.GetPoint().y);
|
||||
|
||||
// if we don't skip the event, OnHtmlLinkClicked won't be called!
|
||||
@@ -373,7 +373,7 @@ wxHtmlOpeningStatus MyHtmlWindow::OnOpeningURL(wxHtmlURLType WXUNUSED(type),
|
||||
const wxString& url,
|
||||
wxString *WXUNUSED(redirect)) const
|
||||
{
|
||||
GetRelatedFrame()->SetStatusText(url + wxT(" lately opened"),1);
|
||||
GetRelatedFrame()->SetStatusText(url + " lately opened",1);
|
||||
return wxHTML_OPEN;
|
||||
}
|
||||
|
||||
@@ -397,17 +397,17 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event))
|
||||
const wxString text = data.GetText();
|
||||
const size_t maxTextLength = 100;
|
||||
|
||||
wxLogStatus(wxString::Format(wxT("Clipboard: '%s%s'"),
|
||||
wxLogStatus(wxString::Format("Clipboard: '%s%s'",
|
||||
wxString(text, maxTextLength).c_str(),
|
||||
(text.length() > maxTextLength) ? wxT("...")
|
||||
: wxT("")));
|
||||
(text.length() > maxTextLength) ? "..."
|
||||
: ""));
|
||||
wxTheClipboard->Close();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
wxLogStatus(wxT("Clipboard: nothing"));
|
||||
wxLogStatus("Clipboard: nothing");
|
||||
}
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
bool MyVFS::CanOpen(const wxString& location)
|
||||
{
|
||||
return (GetProtocol(location) == wxT("myVFS"));
|
||||
return (GetProtocol(location) == "myVFS");
|
||||
}
|
||||
|
||||
wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
||||
@@ -73,7 +73,7 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
||||
// this won't happen because wxHTML keeps only one "page" file opened at the
|
||||
// time.
|
||||
str = new wxMemoryInputStream(buf, strlen(buf));
|
||||
f = new wxFSFile(str, location, wxT("text/html"), wxEmptyString, wxDateTime::Today());
|
||||
f = new wxFSFile(str, location, "text/html", wxEmptyString, wxDateTime::Today());
|
||||
|
||||
return f;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
#if wxUSE_STATUSBAR
|
||||
html -> SetRelatedStatusBar(1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
html -> LoadPage(wxT("start.htm"));
|
||||
html -> LoadPage("start.htm");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -40,16 +40,16 @@ TAG_HANDLER_PROC(tag)
|
||||
int ax, ay;
|
||||
int fl = 0;
|
||||
|
||||
tag.ScanParam(wxT("X"), wxT("%i"), &ax);
|
||||
tag.ScanParam(wxT("Y"), wxT("%i"), &ay);
|
||||
tag.ScanParam("X", "%i", &ax);
|
||||
tag.ScanParam("Y", "%i", &ay);
|
||||
|
||||
if (tag.HasParam(wxT("FLOAT"))) fl = ax;
|
||||
if (tag.HasParam("FLOAT")) fl = ax;
|
||||
|
||||
wnd = new wxTextCtrl
|
||||
(
|
||||
m_WParser->GetWindowInterface()->GetHTMLWindow(),
|
||||
wxID_ANY,
|
||||
tag.GetParam(wxT("NAME")),
|
||||
tag.GetParam("NAME"),
|
||||
wxPoint(0,0),
|
||||
wxSize(ax, ay),
|
||||
wxTE_MULTILINE
|
||||
@@ -209,7 +209,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
#if wxUSE_STATUSBAR
|
||||
html -> SetRelatedStatusBar(1);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
html -> LoadPage(wxT("start.htm"));
|
||||
html -> LoadPage("start.htm");
|
||||
|
||||
}
|
||||
|
||||
|
@@ -169,7 +169,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
#if wxUSE_STATUSBAR
|
||||
html -> SetRelatedStatusBar(0);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
html -> LoadPage(wxT("start.htm"));
|
||||
html -> LoadPage("start.htm");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user