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
@@ -174,7 +174,7 @@ bool MyApp::OnInit()
|
||||
wxHelpProvider::Set(new wxSimpleHelpProvider());
|
||||
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame(wxT("AccessTest wxWidgets App"),
|
||||
MyFrame *frame = new MyFrame("AccessTest wxWidgets App",
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
|
||||
// and show it (the frames, unlike simple controls, are not shown when
|
||||
@@ -186,7 +186,7 @@ bool MyApp::OnInit()
|
||||
// application would exit immediately.
|
||||
return true;
|
||||
#else
|
||||
wxMessageBox( wxT("This sample has to be compiled with wxUSE_ACCESSIBILITY"), wxT("Building error"), wxOK);
|
||||
wxMessageBox( "This sample has to be compiled with wxUSE_ACCESSIBILITY", "Building error", wxOK);
|
||||
return false;
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
}
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
{
|
||||
if (childId == wxACC_SELF)
|
||||
{
|
||||
* name = wxT("Julian's Frame");
|
||||
* name = "Julian's Frame";
|
||||
return wxACC_OK;
|
||||
}
|
||||
else
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
{
|
||||
if (childId == wxACC_SELF)
|
||||
{
|
||||
* name = wxT("My scrolled window");
|
||||
* name = "My scrolled window";
|
||||
return wxACC_OK;
|
||||
}
|
||||
else
|
||||
@@ -307,9 +307,9 @@ public:
|
||||
// of this object.
|
||||
// Acceptable values:
|
||||
// - a null variant (IsNull() returns true)
|
||||
// - a list variant (GetType() == wxT("list"))
|
||||
// - a list variant (GetType() == "list")
|
||||
// - an integer representing the selected child element,
|
||||
// or 0 if this object is selected (GetType() == wxT("long"))
|
||||
// or 0 if this object is selected (GetType() == "long")
|
||||
// - a "void*" pointer to a wxAccessible child object
|
||||
virtual wxAccStatus GetSelections(wxVariant* selections) wxOVERRIDE;
|
||||
|
||||
@@ -336,16 +336,16 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
|
||||
// the "About" item should be in the help menu
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(AccessTest_About, wxT("&About"), wxT("Show about dialog"));
|
||||
helpMenu->Append(AccessTest_About, "&About", "Show about dialog");
|
||||
|
||||
menuFile->Append(AccessTest_Query, wxT("Query"), wxT("Query the window hierarchy"));
|
||||
menuFile->Append(AccessTest_Query, "Query", "Query the window hierarchy");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(AccessTest_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
|
||||
menuFile->Append(AccessTest_Quit, "E&xit\tAlt-X", "Quit this program");
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(menuFile, wxT("&File"));
|
||||
menuBar->Append(helpMenu, wxT("&Help"));
|
||||
menuBar->Append(menuFile, "&File");
|
||||
menuBar->Append(helpMenu, "&Help");
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
@@ -354,7 +354,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
#if 0 // 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
|
||||
|
||||
|
||||
@@ -362,17 +362,17 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
|
||||
splitter->SetAccessible(new SplitterWindowAccessible(splitter));
|
||||
|
||||
wxListBox* listBox = new wxListBox(splitter, wxID_ANY);
|
||||
listBox->Append(wxT("Cabbages"));
|
||||
listBox->Append(wxT("Kings"));
|
||||
listBox->Append(wxT("Sealing wax"));
|
||||
listBox->Append(wxT("Strings"));
|
||||
listBox->Append("Cabbages");
|
||||
listBox->Append("Kings");
|
||||
listBox->Append("Sealing wax");
|
||||
listBox->Append("Strings");
|
||||
listBox->CreateAccessible();
|
||||
listBox->SetHelpText(wxT("This is a sample wxWidgets listbox, with a number of items in it."));
|
||||
listBox->SetHelpText("This is a sample wxWidgets listbox, with a number of items in it.");
|
||||
|
||||
m_textCtrl = new wxTextCtrl(splitter, wxID_ANY, wxT(""), wxDefaultPosition,
|
||||
m_textCtrl = new wxTextCtrl(splitter, wxID_ANY, "", wxDefaultPosition,
|
||||
wxDefaultSize, wxTE_MULTILINE);
|
||||
m_textCtrl->CreateAccessible();
|
||||
m_textCtrl->SetHelpText(wxT("This is a sample wxWidgets multiline text control."));
|
||||
m_textCtrl->SetHelpText("This is a sample wxWidgets multiline text control.");
|
||||
|
||||
splitter->SplitHorizontally(listBox, m_textCtrl, 150);
|
||||
|
||||
@@ -394,10 +394,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( wxT("This is the About dialog of the AccessTest sample.\n")
|
||||
wxT("Welcome to %s"), wxVERSION_STRING);
|
||||
msg.Printf( "This is the About dialog of the AccessTest sample.\n"
|
||||
"Welcome to %s", wxVERSION_STRING);
|
||||
|
||||
wxMessageBox(msg, wxT("About AccessTest"), wxOK | wxICON_INFORMATION, this);
|
||||
wxMessageBox(msg, "About AccessTest", wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
|
||||
void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event))
|
||||
@@ -407,26 +407,26 @@ void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event))
|
||||
if (S_OK != AccessibleObjectFromWindow((HWND) GetHWND(), (DWORD)OBJID_CLIENT,
|
||||
IID_IAccessible, (void**) & accessibleFrame))
|
||||
{
|
||||
Log(wxT("Could not get object."));
|
||||
Log("Could not get object.");
|
||||
return;
|
||||
}
|
||||
if (accessibleFrame)
|
||||
{
|
||||
//Log(wxT("Got an IAccessible for the frame."));
|
||||
//Log("Got an IAccessible for the frame.");
|
||||
LogObject(0, accessibleFrame);
|
||||
Log(wxT("Checking children using AccessibleChildren()..."));
|
||||
Log("Checking children using AccessibleChildren()...");
|
||||
|
||||
// Now check the AccessibleChildren function works OK
|
||||
long childCount = 0;
|
||||
if (S_OK != accessibleFrame->get_accChildCount(& childCount))
|
||||
{
|
||||
Log(wxT("Could not get number of children."));
|
||||
Log("Could not get number of children.");
|
||||
accessibleFrame->Release();
|
||||
return;
|
||||
}
|
||||
else if (childCount == 0)
|
||||
{
|
||||
Log(wxT("No children."));
|
||||
Log("No children.");
|
||||
accessibleFrame->Release();
|
||||
return;
|
||||
}
|
||||
@@ -455,7 +455,7 @@ void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event))
|
||||
wxString name, role;
|
||||
GetInfo(childAccessible, 0, name, role);
|
||||
wxString str;
|
||||
str.Printf(wxT("Found child %s/%s"), name.c_str(), role.c_str());
|
||||
str.Printf("Found child %s/%s", name.c_str(), role.c_str());
|
||||
Log(str);
|
||||
childAccessible->Release();
|
||||
}
|
||||
@@ -468,7 +468,7 @@ void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
else
|
||||
{
|
||||
Log(wxT("AccessibleChildren failed."));
|
||||
Log("AccessibleChildren failed.");
|
||||
}
|
||||
delete[] var;
|
||||
|
||||
@@ -483,10 +483,10 @@ void MyFrame::Log(const wxString& text)
|
||||
if (m_textCtrl)
|
||||
{
|
||||
wxString text2(text);
|
||||
text2.Replace(wxT("\n"), wxT(" "));
|
||||
text2.Replace(wxT("\r"), wxT(" "));
|
||||
text2.Replace("\n", " ");
|
||||
text2.Replace("\r", " ");
|
||||
m_textCtrl->SetInsertionPointEnd();
|
||||
m_textCtrl->WriteText(text2 + wxT("\n"));
|
||||
m_textCtrl->WriteText(text2 + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,8 +499,8 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
|
||||
GetInfo(obj, 0, name, role);
|
||||
|
||||
wxString str;
|
||||
str.Printf(wxT("Name = %s; Role = %s"), name.c_str(), role.c_str());
|
||||
str.Pad(indent, wxT(' '), false);
|
||||
str.Printf("Name = %s; Role = %s", name.c_str(), role.c_str());
|
||||
str.Pad(indent, ' ', false);
|
||||
Log(str);
|
||||
}
|
||||
|
||||
@@ -508,10 +508,10 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
|
||||
if (S_OK == obj->get_accChildCount(& childCount))
|
||||
{
|
||||
wxString str;
|
||||
str.Printf(wxT("There are %d children."), (int) childCount);
|
||||
str.Pad(indent, wxT(' '), false);
|
||||
str.Printf("There are %d children.", (int) childCount);
|
||||
str.Pad(indent, ' ', false);
|
||||
Log(str);
|
||||
Log(wxT(""));
|
||||
Log("");
|
||||
}
|
||||
|
||||
int i;
|
||||
@@ -520,8 +520,8 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
|
||||
GetInfo(obj, i, name, role);
|
||||
|
||||
wxString str;
|
||||
str.Printf(wxT("%d) Name = %s; Role = %s"), i, name.c_str(), role.c_str());
|
||||
str.Pad(indent, wxT(' '), false);
|
||||
str.Printf("%d) Name = %s; Role = %s", i, name.c_str(), role.c_str());
|
||||
str.Pad(indent, ' ', false);
|
||||
Log(str);
|
||||
|
||||
VARIANT var;
|
||||
@@ -533,8 +533,8 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
|
||||
|
||||
if (S_OK == obj->get_accChild(var, & pDisp) && pDisp)
|
||||
{
|
||||
str.Printf(wxT("This is a real object."));
|
||||
str.Pad(indent+4, wxT(' '), false);
|
||||
str.Printf("This is a real object.");
|
||||
str.Pad(indent+4, ' ', false);
|
||||
Log(str);
|
||||
|
||||
if (pDisp->QueryInterface(IID_IAccessible, (LPVOID*) & childObject) == S_OK)
|
||||
@@ -546,11 +546,11 @@ void MyFrame::LogObject(int indent, IAccessible* obj)
|
||||
}
|
||||
else
|
||||
{
|
||||
str.Printf(wxT("This is an element."));
|
||||
str.Pad(indent+4, wxT(' '), false);
|
||||
str.Printf("This is an element.");
|
||||
str.Pad(indent+4, ' ', false);
|
||||
Log(str);
|
||||
}
|
||||
// Log(wxT(""));
|
||||
// Log("");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -573,7 +573,7 @@ void MyFrame::GetInfo(IAccessible* accessible, int id, wxString& name, wxString&
|
||||
}
|
||||
else
|
||||
{
|
||||
name = wxT("NO NAME");
|
||||
name = "NO NAME";
|
||||
}
|
||||
|
||||
VARIANT varRole;
|
||||
@@ -590,7 +590,7 @@ void MyFrame::GetInfo(IAccessible* accessible, int id, wxString& name, wxString&
|
||||
}
|
||||
else
|
||||
{
|
||||
role = wxT("NO ROLE");
|
||||
role = "NO ROLE";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,7 +603,7 @@ wxAccStatus SplitterWindowAccessible::GetName(int childId, wxString* name)
|
||||
{
|
||||
if (childId == wxACC_SELF)
|
||||
{
|
||||
* name = wxT("Splitter window");
|
||||
* name = "Splitter window";
|
||||
return wxACC_OK;
|
||||
}
|
||||
wxSplitterWindow* splitter = wxDynamicCast(GetWindow(), wxSplitterWindow);
|
||||
@@ -616,7 +616,7 @@ wxAccStatus SplitterWindowAccessible::GetName(int childId, wxString* name)
|
||||
return wxACC_NOT_IMPLEMENTED;
|
||||
else if (childId == 2)
|
||||
{
|
||||
*name = wxT("Sash");
|
||||
*name = "Sash";
|
||||
return wxACC_OK;
|
||||
}
|
||||
}
|
||||
@@ -1101,9 +1101,9 @@ wxAccStatus SplitterWindowAccessible::GetFocus(int* WXUNUSED(childId), wxAccessi
|
||||
// of this object.
|
||||
// Acceptable values:
|
||||
// - a null variant (IsNull() returns true)
|
||||
// - a list variant (GetType() == wxT("list"))
|
||||
// - a list variant (GetType() == "list")
|
||||
// - an integer representing the selected child element,
|
||||
// or 0 if this object is selected (GetType() == wxT("long"))
|
||||
// or 0 if this object is selected (GetType() == "long")
|
||||
// - a "void*" pointer to a wxAccessible child object
|
||||
wxAccStatus SplitterWindowAccessible::GetSelections(wxVariant* WXUNUSED(selections))
|
||||
{
|
||||
|
Reference in New Issue
Block a user