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
@@ -128,7 +128,7 @@ public:
|
||||
void OnLboxSelect(wxCommandEvent& event);
|
||||
void OnLboxDClick(wxCommandEvent& event)
|
||||
{
|
||||
wxLogMessage(wxT("Listbox item %d double clicked."), event.GetInt());
|
||||
wxLogMessage("Listbox item %d double clicked.", event.GetInt());
|
||||
}
|
||||
|
||||
void OnHtmlLinkClicked(wxHtmlLinkEvent& event);
|
||||
@@ -236,7 +236,7 @@ wxIMPLEMENT_APP(MyApp);
|
||||
|
||||
// frame constructor
|
||||
MyFrame::MyFrame()
|
||||
: wxFrame(NULL, wxID_ANY, wxT("HtmlLbox wxWidgets Sample"),
|
||||
: wxFrame(NULL, wxID_ANY, "HtmlLbox wxWidgets Sample",
|
||||
wxDefaultPosition, wxSize(500, 500))
|
||||
{
|
||||
// set the frame icon
|
||||
@@ -245,48 +245,48 @@ MyFrame::MyFrame()
|
||||
#if wxUSE_MENUS
|
||||
// create a menu bar
|
||||
wxMenu *menuFile = new wxMenu;
|
||||
menuFile->AppendRadioItem(HtmlLbox_CustomBox, wxT("Use custom box"),
|
||||
wxT("Use a wxHtmlListBox virtual class control"));
|
||||
menuFile->AppendRadioItem(HtmlLbox_SimpleBox, wxT("Use simple box"),
|
||||
wxT("Use a wxSimpleHtmlListBox control"));
|
||||
menuFile->AppendRadioItem(HtmlLbox_CustomBox, "Use custom box",
|
||||
"Use a wxHtmlListBox virtual class control");
|
||||
menuFile->AppendRadioItem(HtmlLbox_SimpleBox, "Use simple box",
|
||||
"Use a wxSimpleHtmlListBox control");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(HtmlLbox_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
|
||||
menuFile->Append(HtmlLbox_Quit, "E&xit\tAlt-X", "Quit this program");
|
||||
|
||||
// create our specific menu
|
||||
wxMenu *menuHLbox = new wxMenu;
|
||||
menuHLbox->Append(HtmlLbox_SetMargins,
|
||||
wxT("Set &margins...\tCtrl-G"),
|
||||
wxT("Change the margins around the items"));
|
||||
"Set &margins...\tCtrl-G",
|
||||
"Change the margins around the items");
|
||||
menuHLbox->AppendCheckItem(HtmlLbox_DrawSeparator,
|
||||
wxT("&Draw separators\tCtrl-D"),
|
||||
wxT("Toggle drawing separators between cells"));
|
||||
"&Draw separators\tCtrl-D",
|
||||
"Toggle drawing separators between cells");
|
||||
menuHLbox->AppendSeparator();
|
||||
menuHLbox->AppendCheckItem(HtmlLbox_ToggleMulti,
|
||||
wxT("&Multiple selection\tCtrl-M"),
|
||||
wxT("Toggle multiple selection on/off"));
|
||||
"&Multiple selection\tCtrl-M",
|
||||
"Toggle multiple selection on/off");
|
||||
menuHLbox->AppendSeparator();
|
||||
menuHLbox->Append(HtmlLbox_SelectAll, wxT("Select &all items\tCtrl-A"));
|
||||
menuHLbox->Append(HtmlLbox_UpdateItem, wxT("Update &first item\tCtrl-U"));
|
||||
menuHLbox->Append(HtmlLbox_GetItemRect, wxT("Show &rectangle of item #10\tCtrl-R"));
|
||||
menuHLbox->Append(HtmlLbox_SelectAll, "Select &all items\tCtrl-A");
|
||||
menuHLbox->Append(HtmlLbox_UpdateItem, "Update &first item\tCtrl-U");
|
||||
menuHLbox->Append(HtmlLbox_GetItemRect, "Show &rectangle of item #10\tCtrl-R");
|
||||
menuHLbox->AppendSeparator();
|
||||
menuHLbox->Append(HtmlLbox_SetBgCol, wxT("Set &background...\tCtrl-B"));
|
||||
menuHLbox->Append(HtmlLbox_SetBgCol, "Set &background...\tCtrl-B");
|
||||
menuHLbox->Append(HtmlLbox_SetSelBgCol,
|
||||
wxT("Set &selection background...\tCtrl-S"));
|
||||
"Set &selection background...\tCtrl-S");
|
||||
menuHLbox->AppendCheckItem(HtmlLbox_SetSelFgCol,
|
||||
wxT("Keep &foreground in selection\tCtrl-F"));
|
||||
"Keep &foreground in selection\tCtrl-F");
|
||||
|
||||
menuHLbox->AppendSeparator();
|
||||
menuHLbox->Append(HtmlLbox_Clear, wxT("&Clear\tCtrl-L"));
|
||||
menuHLbox->Append(HtmlLbox_Clear, "&Clear\tCtrl-L");
|
||||
|
||||
// the "About" item should be in the help menu
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(HtmlLbox_About, wxT("&About\tF1"), wxT("Show about dialog"));
|
||||
helpMenu->Append(HtmlLbox_About, "&About\tF1", "Show about dialog");
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(menuFile, wxT("&File"));
|
||||
menuBar->Append(menuHLbox, wxT("&Listbox"));
|
||||
menuBar->Append(helpMenu, wxT("&Help"));
|
||||
menuBar->Append(menuFile, "&File");
|
||||
menuBar->Append(menuHLbox, "&Listbox");
|
||||
menuBar->Append(helpMenu, "&Help");
|
||||
|
||||
menuBar->Check(HtmlLbox_DrawSeparator, true);
|
||||
|
||||
@@ -297,12 +297,12 @@ MyFrame::MyFrame()
|
||||
#if wxUSE_STATUSBAR
|
||||
// create a status bar just for fun (by default with 1 pane only)
|
||||
CreateStatusBar(2);
|
||||
SetStatusText(wxT("Welcome to wxWidgets!"));
|
||||
SetStatusText("Welcome to wxWidgets!");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
// create the child controls
|
||||
CreateBox();
|
||||
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""),
|
||||
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, "",
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE);
|
||||
delete wxLog::SetActiveTarget(new wxLogTextCtrl(text));
|
||||
@@ -344,9 +344,9 @@ void MyFrame::CreateBox()
|
||||
(unsigned char)(abs((int)n - 128) % 256));
|
||||
int level = n % 6 + 1;
|
||||
|
||||
wxString label = wxString::Format(wxT("<h%d><font color=%s>")
|
||||
wxT("Item</font> <b>%lu</b>")
|
||||
wxT("</h%d>"),
|
||||
wxString label = wxString::Format("<h%d><font color=%s>"
|
||||
"Item</font> <b>%lu</b>"
|
||||
"</h%d>",
|
||||
level,
|
||||
clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
|
||||
(unsigned long)n, level);
|
||||
@@ -383,10 +383,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxMessageBox(wxT("This sample shows wxHtmlListBox class.\n")
|
||||
wxT("\n")
|
||||
wxT("(c) 2003 Vadim Zeitlin"),
|
||||
wxT("About HtmlLbox"),
|
||||
wxMessageBox("This sample shows wxHtmlListBox class.\n"
|
||||
"\n"
|
||||
"(c) 2003 Vadim Zeitlin",
|
||||
"About HtmlLbox",
|
||||
wxOK | wxICON_INFORMATION,
|
||||
this);
|
||||
}
|
||||
@@ -395,9 +395,9 @@ void MyFrame::OnSetMargins(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
long margin = wxGetNumberFromUser
|
||||
(
|
||||
wxT("Enter the margins to use for the listbox items."),
|
||||
wxT("Margin: "),
|
||||
wxT("HtmlLbox: Set the margins"),
|
||||
"Enter the margins to use for the listbox items.",
|
||||
"Margin: ",
|
||||
"HtmlLbox: Set the margins",
|
||||
0, 0, 20,
|
||||
this
|
||||
);
|
||||
@@ -454,7 +454,7 @@ void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event))
|
||||
m_hlbox->Refresh();
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
SetStatusText(wxT("Background colour changed."));
|
||||
SetStatusText("Background colour changed.");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
}
|
||||
@@ -468,7 +468,7 @@ void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event))
|
||||
m_hlbox->Refresh();
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
SetStatusText(wxT("Selection background colour changed."));
|
||||
SetStatusText("Selection background colour changed.");
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
}
|
||||
@@ -489,7 +489,7 @@ void MyFrame::OnClear(wxCommandEvent& WXUNUSED(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());
|
||||
|
||||
if (GetMyBox())
|
||||
{
|
||||
@@ -500,13 +500,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!
|
||||
@@ -519,7 +519,7 @@ void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event)
|
||||
|
||||
void MyFrame::OnLboxSelect(wxCommandEvent& event)
|
||||
{
|
||||
wxLogMessage(wxT("Listbox selection is now %d."), event.GetInt());
|
||||
wxLogMessage("Listbox selection is now %d.", event.GetInt());
|
||||
|
||||
if ( m_hlbox->HasMultipleSelection() )
|
||||
{
|
||||
@@ -534,20 +534,20 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event)
|
||||
if ( first )
|
||||
first = false;
|
||||
else
|
||||
s << wxT(", ");
|
||||
s << ", ";
|
||||
|
||||
s << item;
|
||||
}
|
||||
|
||||
if ( !s.empty() )
|
||||
{
|
||||
wxLogMessage(wxT("Selected items: %s"), s.c_str());
|
||||
wxLogMessage("Selected items: %s", s.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
SetStatusText(wxString::Format(
|
||||
wxT("# items selected = %lu"),
|
||||
"# items selected = %lu",
|
||||
(unsigned long)m_hlbox->GetSelectedCount()
|
||||
));
|
||||
#endif // wxUSE_STATUSBAR
|
||||
@@ -571,9 +571,9 @@ MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi)
|
||||
SetMargins(5, 5);
|
||||
|
||||
#ifdef USE_HTML_FILE
|
||||
if ( !m_file.Open(wxT("results")) )
|
||||
if ( !m_file.Open("results") )
|
||||
{
|
||||
wxLogError(wxT("Failed to open results file"));
|
||||
wxLogError("Failed to open results file");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -601,7 +601,7 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const
|
||||
{
|
||||
if ( !n && m_firstItemUpdated )
|
||||
{
|
||||
return wxT("<h1><b>Just updated</b></h1>");
|
||||
return "<h1><b>Just updated</b></h1>";
|
||||
}
|
||||
|
||||
#ifdef USE_HTML_FILE
|
||||
@@ -617,18 +617,18 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const
|
||||
(unsigned char)(abs((int)n - 256) % 256),
|
||||
(unsigned char)(abs((int)n - 128) % 256));
|
||||
|
||||
wxString label = wxString::Format(wxT("<h%d><font color=%s>")
|
||||
wxT("Item</font> <b>%lu</b>")
|
||||
wxT("</h%d>"),
|
||||
wxString label = wxString::Format("<h%d><font color=%s>"
|
||||
"Item</font> <b>%lu</b>"
|
||||
"</h%d>",
|
||||
level,
|
||||
clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
|
||||
(unsigned long)n, level);
|
||||
if ( n == 1 )
|
||||
{
|
||||
if ( !m_linkClicked )
|
||||
label += wxT("<a href='1'>Click here...</a>");
|
||||
label += "<a href='1'>Click here...</a>";
|
||||
else
|
||||
label += wxT("<font color='#9999ff'>Clicked here...</font>");
|
||||
label += "<font color='#9999ff'>Clicked here...</font>";
|
||||
}
|
||||
|
||||
return label;
|
||||
|
Reference in New Issue
Block a user