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:
Blake-Eryx
2018-09-23 01:15:08 +02:00
committed by Vadim Zeitlin
parent e768046774
commit f58ea62596
93 changed files with 4362 additions and 4358 deletions

View File

@@ -66,20 +66,20 @@ static void CheckGLError()
// so check that we get a different error than the last time
if ( err == errLast )
{
wxLogError(wxT("OpenGL error state couldn't be reset."));
wxLogError("OpenGL error state couldn't be reset.");
return;
}
errLast = err;
wxLogError(wxT("OpenGL error %d"), err);
wxLogError("OpenGL error %d", err);
}
}
// function to draw the texture for cube faces
static wxImage DrawDice(int size, unsigned num)
{
wxASSERT_MSG( num >= 1 && num <= 6, wxT("invalid dice index") );
wxASSERT_MSG( num >= 1 && num <= 6, "invalid dice index" );
const int dot = size/16; // radius of a single dot
const int gap = 5*size/32; // gap between dots
@@ -459,7 +459,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
wxEND_EVENT_TABLE()
MyFrame::MyFrame( bool stereoWindow )
: wxFrame(NULL, wxID_ANY, wxT("wxWidgets OpenGL Cube Sample"))
: wxFrame(NULL, wxID_ANY, "wxWidgets OpenGL Cube Sample")
{
int stereoAttribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_STEREO, 0 };
@@ -474,7 +474,7 @@ MyFrame::MyFrame( bool stereoWindow )
menu->AppendSeparator();
menu->Append(wxID_CLOSE);
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menu, wxT("&Cube"));
menuBar->Append(menu, "&Cube");
SetMenuBar(menuBar);

View File

@@ -56,7 +56,7 @@ bool MyApp::OnInit()
return false;
// Create the main frame window
new MyFrame(NULL, wxT("wxWidgets OpenGL Isosurf Sample"));
new MyFrame(NULL, "wxWidgets OpenGL Isosurf Sample");
return true;
}
@@ -102,9 +102,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
// Make a menubar
wxMenu *fileMenu = new wxMenu;
fileMenu->Append(wxID_EXIT, wxT("E&xit"));
fileMenu->Append(wxID_EXIT, "E&xit");
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(fileMenu, "&File");
SetMenuBar(menuBar);
@@ -225,7 +225,7 @@ void TestGLCanvas::LoadSurface(const wxString& filename)
delete stream;
wxLogMessage(wxT("Loaded %d vertices, %d triangles from '%s'"),
wxLogMessage("Loaded %d vertices, %d triangles from '%s'",
m_numverts, m_numverts-2, filename.c_str());
// NOTE: for some reason under wxGTK the following is required to avoid that

View File

@@ -388,7 +388,7 @@ bool DXFRenderer::ParseHeader(wxInputStream& stream)
while (stream.CanRead())
{
GetLines(text, line1, line2);
if (line1 == wxT("0") && line2 == wxT("ENDSEC"))
if (line1 == "0" && line2 == "ENDSEC")
return true;
}
return false;
@@ -404,7 +404,7 @@ bool DXFRenderer::ParseTables(wxInputStream& stream)
while (stream.CanRead())
{
GetLines(text, line1, line2);
if (line1 == wxT("0") && inlayer)
if (line1 == "0" && inlayer)
{
// flush layer
if (!layer.name.IsEmpty() && layer.colour != -1)
@@ -417,15 +417,15 @@ bool DXFRenderer::ParseTables(wxInputStream& stream)
layer = DXFLayer();
inlayer = false;
}
if (line1 == wxT("0") && line2 == wxT("ENDSEC"))
if (line1 == "0" && line2 == "ENDSEC")
return true;
else if (line1 == wxT("0") && line2 == wxT("LAYER"))
else if (line1 == "0" && line2 == "LAYER")
inlayer = true;
else if (inlayer)
{
if (line1 == wxT("2")) // layer name
if (line1 == "2") // layer name
layer.name = line2;
else if (line1 == wxT("62")) // ACI colour
else if (line1 == "62") // ACI colour
{
long l;
line2.ToLong(&l);
@@ -464,7 +464,7 @@ bool DXFRenderer::ParseEntities(wxInputStream& stream)
while (stream.CanRead())
{
GetLines(text, line1, line2);
if (line1 == wxT("0") && state > 0)
if (line1 == "0" && state > 0)
{
// flush entity
if (state == 1) // 3DFACE
@@ -499,43 +499,43 @@ bool DXFRenderer::ParseEntities(wxInputStream& stream)
state = 0;
}
}
if (line1 == wxT("0") && line2 == wxT("ENDSEC"))
if (line1 == "0" && line2 == "ENDSEC")
return true;
else if (line1 == wxT("0") && line2 == wxT("3DFACE"))
else if (line1 == "0" && line2 == "3DFACE")
state = 1;
else if (line1 == wxT("0") && line2 == wxT("LINE"))
else if (line1 == "0" && line2 == "LINE")
state = 2;
else if (state > 0)
{
const double d=ToDouble(line2);
if (line1 == wxT("10"))
if (line1 == "10")
v[0].x = d;
else if (line1 == wxT("20"))
else if (line1 == "20")
v[0].y = d;
else if (line1 == wxT("30"))
else if (line1 == "30")
v[0].z = d;
else if (line1 == wxT("11"))
else if (line1 == "11")
v[1].x = d;
else if (line1 == wxT("21"))
else if (line1 == "21")
v[1].y = d;
else if (line1 == wxT("31"))
else if (line1 == "31")
v[1].z = d;
else if (line1 == wxT("12"))
else if (line1 == "12")
v[2].x = d;
else if (line1 == wxT("22"))
else if (line1 == "22")
v[2].y = d;
else if (line1 == wxT("32"))
else if (line1 == "32")
v[2].z = d;
else if (line1 == wxT("13"))
else if (line1 == "13")
v[3].x = d;
else if (line1 == wxT("23"))
else if (line1 == "23")
v[3].y = d;
else if (line1 == wxT("33"))
else if (line1 == "33")
v[3].z = d;
else if (line1 == wxT("8")) // layer
else if (line1 == "8") // layer
layer = line2;
else if (line1 == wxT("62")) // colour
else if (line1 == "62") // colour
{
long l;
line2.ToLong(&l);
@@ -557,24 +557,24 @@ bool DXFRenderer::Load(wxInputStream& stream)
while (stream.CanRead())
{
GetLines(text, line1, line2);
if (line1 == wxT("999")) // comment
if (line1 == "999") // comment
continue;
else if (line1 == wxT("0") && line2 == wxT("SECTION"))
else if (line1 == "0" && line2 == "SECTION")
{
GetLines(text, line1, line2);
if (line1 == wxT("2"))
if (line1 == "2")
{
if (line2 == wxT("HEADER"))
if (line2 == "HEADER")
{
if (!ParseHeader(stream))
return false;
}
else if (line2 == wxT("TABLES"))
else if (line2 == "TABLES")
{
if (!ParseTables(stream))
return false;
}
else if (line2 == wxT("ENTITIES"))
else if (line2 == "ENTITIES")
{
if (!ParseEntities(stream))
return false;

View File

@@ -43,15 +43,15 @@ bool MyApp::OnInit()
return false;
// Create the main frame window
MyFrame *frame = new MyFrame(NULL, wxT("wxWidgets Penguin Sample"),
MyFrame *frame = new MyFrame(NULL, "wxWidgets Penguin Sample",
wxDefaultPosition, wxDefaultSize);
#if wxUSE_ZLIB
if (wxFileExists(wxT("penguin.dxf.gz")))
frame->GetCanvas()->LoadDXF(wxT("penguin.dxf.gz"));
if (wxFileExists("penguin.dxf.gz"))
frame->GetCanvas()->LoadDXF("penguin.dxf.gz");
#else
if (wxFileExists(wxT("penguin.dxf")))
frame->GetCanvas()->LoadDXF(wxT("penguin.dxf"));
if (wxFileExists("penguin.dxf"))
frame->GetCanvas()->LoadDXF("penguin.dxf");
#endif
/* Show the frame */
@@ -81,16 +81,16 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
// Make the "File" menu
wxMenu *fileMenu = new wxMenu;
fileMenu->Append(wxID_OPEN, wxT("&Open..."));
fileMenu->Append(wxID_OPEN, "&Open...");
fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, wxT("E&xit\tALT-X"));
fileMenu->Append(wxID_EXIT, "E&xit\tALT-X");
// Make the "Help" menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_HELP, wxT("&About"));
helpMenu->Append(wxID_HELP, "&About");
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help"));
menuBar->Append(fileMenu, "&File");
menuBar->Append(helpMenu, "&Help");
SetMenuBar(menuBar);
Show(true);
@@ -102,11 +102,11 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
// File|Open... command
void MyFrame::OnMenuFileOpen( wxCommandEvent& WXUNUSED(event) )
{
wxString filename = wxFileSelector(wxT("Choose DXF Model"), wxT(""), wxT(""), wxT(""),
wxString filename = wxFileSelector("Choose DXF Model", "", "", "",
#if wxUSE_ZLIB
wxT("DXF Drawing (*.dxf;*.dxf.gz)|*.dxf;*.dxf.gz|All files (*.*)|*.*"),
"DXF Drawing (*.dxf;*.dxf.gz)|*.dxf;*.dxf.gz|All files (*.*)|*.*",
#else
wxT("DXF Drawing (*.dxf)|*.dxf)|All files (*.*)|*.*"),
"DXF Drawing (*.dxf)|*.dxf)|All files (*.*)|*.*",
#endif
wxFD_OPEN);
if (!filename.IsEmpty())
@@ -126,7 +126,7 @@ void MyFrame::OnMenuFileExit( wxCommandEvent& WXUNUSED(event) )
// Help|About command
void MyFrame::OnMenuHelpAbout( wxCommandEvent& WXUNUSED(event) )
{
wxMessageBox(wxT("OpenGL Penguin Sample (c) Robert Roebling, Sandro Sigala et al"));
wxMessageBox("OpenGL Penguin Sample (c) Robert Roebling, Sandro Sigala et al");
}
// ---------------------------------------------------------------------------
@@ -222,7 +222,7 @@ void TestGLCanvas::LoadDXF(const wxString& filename)
if (stream.IsOk())
#if wxUSE_ZLIB
{
if (filename.Right(3).Lower() == wxT(".gz"))
if (filename.Right(3).Lower() == ".gz")
{
wxZlibInputStream zstream(stream);
m_renderer.Load(zstream);

View File

@@ -79,7 +79,7 @@ public:
TestGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxT("TestGLCanvas"));
const wxString& name = "TestGLCanvas");
virtual ~TestGLCanvas();