Globally replace _T() with wxT().

Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-23 20:30:22 +00:00
parent 32cdc45397
commit 9a83f86094
798 changed files with 10370 additions and 10349 deletions

View File

@@ -117,10 +117,10 @@ bool wxEmulatorApp::OnInit()
// If the development version, go up a directory.
#ifdef __WXMSW__
if ((m_appDir.Right(5).CmpNoCase(_T("DEBUG")) == 0) ||
(m_appDir.Right(11).CmpNoCase(_T("DEBUGSTABLE")) == 0) ||
(m_appDir.Right(7).CmpNoCase(_T("RELEASE")) == 0) ||
(m_appDir.Right(13).CmpNoCase(_T("RELEASESTABLE")) == 0)
if ((m_appDir.Right(5).CmpNoCase(wxT("DEBUG")) == 0) ||
(m_appDir.Right(11).CmpNoCase(wxT("DEBUGSTABLE")) == 0) ||
(m_appDir.Right(7).CmpNoCase(wxT("RELEASE")) == 0) ||
(m_appDir.Right(13).CmpNoCase(wxT("RELEASESTABLE")) == 0)
)
m_appDir = wxPathOnly(m_appDir);
#endif
@@ -176,7 +176,7 @@ bool wxEmulatorApp::OnInit()
}
// create the main application window
wxEmulatorFrame *frame = new wxEmulatorFrame(_T("wxEmulator"),
wxEmulatorFrame *frame = new wxEmulatorFrame(wxT("wxEmulator"),
wxPoint(50, 50), wxSize(450, 340));
#if wxUSE_STATUSBAR
@@ -274,14 +274,14 @@ wxEmulatorFrame::wxEmulatorFrame(const wxString& title,
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(Emulator_About, _T("&About...\tF1"), _T("Show about dialog"));
helpMenu->Append(Emulator_About, wxT("&About...\tF1"), wxT("Show about dialog"));
menuFile->Append(Emulator_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
menuFile->Append(Emulator_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, _T("&File"));
menuBar->Append(helpMenu, _T("&Help"));
menuBar->Append(menuFile, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
@@ -305,9 +305,9 @@ void wxEmulatorFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void wxEmulatorFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString msg;
msg.Printf( _T("wxEmulator is an environment for testing embedded X11 apps.\n"));
msg.Printf( wxT("wxEmulator is an environment for testing embedded X11 apps.\n"));
wxMessageBox(msg, _T("About wxEmulator"), wxOK | wxICON_INFORMATION, this);
wxMessageBox(msg, wxT("About wxEmulator"), wxOK | wxICON_INFORMATION, this);
}
void wxEmulatorFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
@@ -523,17 +523,17 @@ wxBitmapType wxDetermineImageType(const wxString& filename)
wxFileName::SplitPath(filename, & path, & name, & ext);
ext.MakeLower();
if (ext == _T("jpg") || ext == _T("jpeg"))
if (ext == wxT("jpg") || ext == wxT("jpeg"))
return wxBITMAP_TYPE_JPEG;
if (ext == _T("gif"))
if (ext == wxT("gif"))
return wxBITMAP_TYPE_GIF;
if (ext == _T("bmp"))
if (ext == wxT("bmp"))
return wxBITMAP_TYPE_BMP;
if (ext == _T("png"))
if (ext == wxT("png"))
return wxBITMAP_TYPE_PNG;
if (ext == _T("pcx"))
if (ext == wxT("pcx"))
return wxBITMAP_TYPE_PCX;
if (ext == _T("tif") || ext == _T("tiff"))
if (ext == wxT("tif") || ext == wxT("tiff"))
return wxBITMAP_TYPE_TIF;
return wxBITMAP_TYPE_INVALID;

View File

@@ -265,7 +265,7 @@ bool hvApp::OpenBook(wxHtmlHelpController* controller)
if ( !s.empty() )
{
wxString ext = s.Right(4).Lower();
if (ext == _T(".zip") || ext == _T(".htb") || ext == _T(".hhp"))
if (ext == wxT(".zip") || ext == wxT(".htb") || ext == wxT(".hhp"))
{
wxBusyCursor bcur;
wxFileName fileName(s);
@@ -312,7 +312,7 @@ if ( id == artId ) return wxBitmap(xpmRc##_xpm);
#else
#define CREATE_STD_ICON(iconId, xpmRc) \
{ \
wxIcon icon(_T(iconId)); \
wxIcon icon(wxT(iconId)); \
wxBitmap bmp; \
bmp.CopyFromIcon(icon); \
return bmp; \

View File

@@ -252,7 +252,7 @@ bool wxRemoteHtmlHelpController::Quit()
switch ( sig )
{
default:
wxFAIL_MSG( _T("unexpected return value") );
wxFAIL_MSG( wxT("unexpected return value") );
// fall through
case -1:
@@ -283,11 +283,11 @@ bool wxRemoteHtmlHelpController::Quit()
{
if ( wxProcess::Exists(m_pid) )
{
wxLogStatus(_T("Process %ld is running."), m_pid);
wxLogStatus(wxT("Process %ld is running."), m_pid);
}
else
{
wxLogStatus(_T("No process with pid = %ld."), m_pid);
wxLogStatus(wxT("No process with pid = %ld."), m_pid);
}
}
else // not SIGNONE
@@ -295,23 +295,23 @@ bool wxRemoteHtmlHelpController::Quit()
wxKillError rc = wxProcess::Kill(m_pid, (wxSignal)sig);
if ( rc == wxKILL_OK )
{
wxLogStatus(_T("Process %ld killed with signal %d."), m_pid, sig);
wxLogStatus(wxT("Process %ld killed with signal %d."), m_pid, sig);
}
else
{
static const wxChar *errorText[] =
{
_T(""), // no error
_T("signal not supported"),
_T("permission denied"),
_T("no such process"),
_T("unspecified error"),
wxT(""), // no error
wxT("signal not supported"),
wxT("permission denied"),
wxT("no such process"),
wxT("unspecified error"),
};
// sig = 3, 6, 9 or 12 all kill server with no apparent problem
// but give error message on MSW - timout?
//
//wxLogError(_T("Failed to kill process %ld with signal %d: %s"),
//wxLogError(wxT("Failed to kill process %ld with signal %d: %s"),
// m_pid, sig, errorText[rc]);
}
}

View File

@@ -33,7 +33,7 @@ bool MyApp::OnInit()
for (int i = 1; i < argc; i++)
{
wxHtmlHelpData data;
wxPrintf(_T("Processing %s...\n"), argv[i]);
wxPrintf(wxT("Processing %s...\n"), argv[i]);
data.SetTempDir(wxPathOnly(argv[i]));
data.AddBook(argv[i]);
}

View File

@@ -44,7 +44,7 @@ AutoCaptureMechanism::AutoCaptureMechanism(wxNotebook *notebook,
}
/* static */
wxString AutoCaptureMechanism::default_dir = _T("screenshots");
wxString AutoCaptureMechanism::default_dir = wxT("screenshots");
/* static */
wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath()
@@ -72,7 +72,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, int x, int y,
// Somehow wxScreenDC.Blit() doesn't work under Mac for now. Here is a trick.
#ifdef __WXMAC__
// wxExecute(_T("screencapture -x ") + tempfile, wxEXEC_SYNC);
// wxExecute(wxT("screencapture -x ") + tempfile, wxEXEC_SYNC);
char captureCommand[80] =""; // a reasonable max size is 80
sprintf(captureCommand, "sleep %d;%s", delay, "screencapture -x /tmp/wx_screen_capture.png");
@@ -83,7 +83,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, int x, int y,
wxBitmap fullscreen;
do
{
fullscreen = wxBitmap(_T("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
fullscreen = wxBitmap(wxT("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG);
}
while(!fullscreen.IsOk());
@@ -199,7 +199,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, Control& ctrl)
{
// no manual specification for the control name
// or name adjustment is disabled globally
if (ctrl.name == _T("") || m_flag & AJ_DisableNameAdjust)
if (ctrl.name == wxT("") || m_flag & AJ_DisableNameAdjust)
{
// Get its name from wxRTTI
ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName();
@@ -234,7 +234,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, Control& ctrl)
// cut off "wx" and change the name into lowercase.
// e.g. wxButton will have a name of "button" at the end
ctrl.name.StartsWith(_T("wx"), &(ctrl.name));
ctrl.name.StartsWith(wxT("wx"), &(ctrl.name));
ctrl.name.MakeLower();
// take the screenshot
@@ -307,16 +307,16 @@ wxRect AutoCaptureMechanism::GetRect(wxWindow* ctrl, int flag)
wxStaticText* l[4];
for (int i = 0; i < 4; ++i)
l[i] = new wxStaticText(parent, wxID_ANY, _T(" "));
l[i] = new wxStaticText(parent, wxID_ANY, wxT(" "));
m_grid->Add(l[0]);
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[1]);
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(ctrl, 1, wxEXPAND);
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[2]);
m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" ")));
m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" ")));
m_grid->Add(l[3]);
sizer->Add(m_grid);

View File

@@ -242,7 +242,7 @@ public:
Please read the document of enum AdjustFlags, and notice that this flag could be enabled/
disabled by global flag GlobalAdjustFlags.
*/
void RegisterControl(wxWindow * ctrl, wxString name = _T(""), int flag = AJ_Normal)
void RegisterControl(wxWindow * ctrl, wxString name = wxT(""), int flag = AJ_Normal)
{
m_controlList.push_back(Control(ctrl, name, flag));
}
@@ -256,7 +256,7 @@ public:
*/
void RegisterControl(wxWindow * ctrl, int flag)
{
RegisterControl(ctrl, _T(""), flag);
RegisterControl(ctrl, wxT(""), flag);
}
/**
@@ -267,7 +267,7 @@ public:
*/
void RegisterPageTurn()
{
m_controlList.push_back(Control(0, _T(""), AJ_TurnPage));
m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage));
}
/**

View File

@@ -66,13 +66,13 @@ void GUIFrame::AddMenuBar()
fileMenu = new wxMenu();
wxMenuItem* m_menuSeeScr;
m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + _T('\t') + _T("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + wxT('\t') + wxT("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL );
fileMenu->Append( m_menuSeeScr );
fileMenu->AppendSeparator();
wxMenuItem* m_menuFileQuit;
m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + _T('\t') + _T("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quits the application."), wxITEM_NORMAL );
fileMenu->Append( m_menuFileQuit );
mbar->Append( fileMenu, _("&File") );
@@ -81,11 +81,11 @@ void GUIFrame::AddMenuBar()
captureMenu = new wxMenu();
wxMenuItem* m_menuCapFullScreen;
m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + _T('\t') + _T("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL );
captureMenu->Append( m_menuCapFullScreen );
wxMenuItem* m_menuCapAll;
m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + _T('\t') + _T("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL );
captureMenu->Append( m_menuCapAll );
mbar->Append( captureMenu, _("&Capture") );
@@ -93,7 +93,7 @@ void GUIFrame::AddMenuBar()
//Help Menu
helpMenu = new wxMenu();
wxMenuItem* m_menuHelpAbout;
m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + _T('\t') + _T("F1"), _("Shows info about this application."), wxITEM_NORMAL );
m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Shows info about this application."), wxITEM_NORMAL );
helpMenu->Append( m_menuHelpAbout );
mbar->Append( helpMenu, _("&Help") );
@@ -147,16 +147,16 @@ void GUIFrame::AddPanel_1()
m_radioBtn2->SetToolTip( _("wxRadioButton") );
fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
m_bpButton1->SetToolTip( _("wxBitmapButton") );
m_bpButton1->SetToolTip( _("wxBitmapButton") );
fgSizer1->Add( m_bpButton1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap1->SetToolTip( _("wxStaticBitmap") );
fgSizer1->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, _T("_Gauge") );
m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, wxT("_Gauge") );
m_gauge1->SetValue( 50 );
m_gauge1->SetToolTip( _("wxGauge") );
fgSizer1->Add( m_gauge1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
@@ -174,11 +174,11 @@ void GUIFrame::AddPanel_1()
m_toggleBtn2->SetToolTip( _("wxToggleButton") );
fgSizer1->Add( m_toggleBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), _T("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
m_hyperlink1->SetToolTip( _("wxHyperlinkCtrl") );
fgSizer1->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 );
m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, _T("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 );
m_spinCtrl1->SetToolTip( _("wxSpinCtrl") );
fgSizer1->Add( m_spinCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
@@ -247,19 +247,19 @@ void GUIFrame::AddPanel_2()
m_animationCtrl1 = new wxAnimationCtrl(m_panel2, wxID_ANY);
m_animationCtrl1->SetToolTip(_("wxAnimationCtrl"));
if (m_animationCtrl1->LoadFile(_T("bitmaps/throbber.gif")))
if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif")))
m_animationCtrl1->Play();
fgSizer2->Add( m_animationCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
//wxCollapsiblePane 1
m_collPane1 = new wxCollapsiblePane(m_panel2, -1, _T("Collapsed"));
m_collPane1 = new wxCollapsiblePane(m_panel2, -1, wxT("Collapsed"));
wxWindow *win = m_collPane1->GetPane();
m_collPane1->SetToolTip(_("wxCollapsiblePane"));
wxBoxSizer * collbSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText* m_collSText = new wxStaticText(win, -1, _T("You can place"));
wxButton* m_collBut = new wxButton(win, -1, _T("anything"));
wxTextCtrl* m_collText = new wxTextCtrl(win, -1, _T("inside a wxCollapsiblePane"));
wxStaticText* m_collSText = new wxStaticText(win, -1, wxT("You can place"));
wxButton* m_collBut = new wxButton(win, -1, wxT("anything"));
wxTextCtrl* m_collText = new wxTextCtrl(win, -1, wxT("inside a wxCollapsiblePane"));
collbSizer->Add( m_collSText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer->Add( m_collBut, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer->Add( m_collText, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
@@ -267,14 +267,14 @@ void GUIFrame::AddPanel_2()
fgSizer2->Add( m_collPane1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
//wxCollapsiblePane 2
m_collPane2 = new wxCollapsiblePane(m_panel2, -1, _T("Expanded"));
m_collPane2 = new wxCollapsiblePane(m_panel2, -1, wxT("Expanded"));
wxWindow *win2 = m_collPane2->GetPane();
m_collPane2->SetToolTip(_("wxCollapsiblePane"));
wxBoxSizer * collbSizer2 = new wxBoxSizer(wxVERTICAL);
wxStaticText* m_collSText2 = new wxStaticText(win2, -1, _T("You can place"));
wxButton* m_collBut2 = new wxButton(win2, -1, _T("anything"));
wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, _T("inside a wxCollapsiblePane"));
wxStaticText* m_collSText2 = new wxStaticText(win2, -1, wxT("You can place"));
wxButton* m_collBut2 = new wxButton(win2, -1, wxT("anything"));
wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, wxT("inside a wxCollapsiblePane"));
collbSizer2->Add( m_collSText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer2->Add( m_collBut2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
collbSizer2->Add( m_collText2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 );
@@ -309,7 +309,7 @@ void GUIFrame::AddPanel_3()
bSizer2->Add( m_textCtrl2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 20 );
m_richText1 = new wxRichTextCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0|wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS );
m_richText1->LoadFile(_T("richtext.xml"));
m_richText1->LoadFile(wxT("richtext.xml"));
m_richText1->SetToolTip( _("wxRichTextCtrl") );
m_richText1->SetMinSize( wxSize( 200,200 ) );
bSizer2->Add( m_richText1, 0, wxALL, 20 );
@@ -339,7 +339,7 @@ void GUIFrame::AddPanel_4()
m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") );
fgSizer5->Add( m_fontPicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 );
m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), _T("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, _T("_FilePickerCtrl") );
m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") );
#if defined(__WXMSW__)
const wxString a_file = "C:\\Windows\\explorer.exe";
#else
@@ -359,13 +359,13 @@ void GUIFrame::AddPanel_4()
m_datePicker1->SetToolTip( _("wxDatePickerCtrl") );
fgSizer5->Add( m_datePicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, _T("_GenericDirCtrl") );
m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, wxT("_GenericDirCtrl") );
m_genericDirCtrl1->ShowHidden( false );
m_genericDirCtrl1->SetToolTip( _("wxGenericDirCtrl") );
m_genericDirCtrl1->SetMinSize( wxSize( -1,150 ) );
fgSizer5->Add( m_genericDirCtrl1, 1, wxEXPAND|wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 );
m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, _T("_DirPickerCtrl") );
m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, wxT("_DirPickerCtrl") );
#if defined(__WXMSW__)
const wxString a_dir = "C:\\Windows";
#else
@@ -415,10 +415,10 @@ void GUIFrame::AddPanel_5()
fgSizer4->Add( 0, 120, 1, wxEXPAND, 5 );
m_bmpComboBox1 = new wxBitmapComboBox(m_panel5, wxID_ANY,_("Item1"));
m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item1"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item2"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item3"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->Append(_("Item4"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG));
m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox"));
fgSizer4->Add( m_bmpComboBox1, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 20 );
@@ -437,17 +437,17 @@ void GUIFrame::AddPanel_5()
m_comboCtrl1->SetPopupControl(popupList);
m_comboCtrl1->SetPopupMaxHeight(80);
m_comboCtrl1->SetText(_T("wxComboCtrl"));
m_comboCtrl1->SetText(wxT("wxComboCtrl"));
m_comboCtrl1->SetToolTip(_("wxComboCtrl"));
// Populate using wxListView methods
popupList->InsertItem(popupList->GetItemCount(),_T("wxComboCtrl"));
popupList->InsertItem(popupList->GetItemCount(),_T("with"));
popupList->InsertItem(popupList->GetItemCount(),_T("wxListView"));
popupList->InsertItem(popupList->GetItemCount(),_T("popup"));
popupList->InsertItem(popupList->GetItemCount(),_T("Item1"));
popupList->InsertItem(popupList->GetItemCount(),_T("Item2"));
popupList->InsertItem(popupList->GetItemCount(),_T("Item3"));
popupList->InsertItem(popupList->GetItemCount(),wxT("wxComboCtrl"));
popupList->InsertItem(popupList->GetItemCount(),wxT("with"));
popupList->InsertItem(popupList->GetItemCount(),wxT("wxListView"));
popupList->InsertItem(popupList->GetItemCount(),wxT("popup"));
popupList->InsertItem(popupList->GetItemCount(),wxT("Item1"));
popupList->InsertItem(popupList->GetItemCount(),wxT("Item2"));
popupList->InsertItem(popupList->GetItemCount(),wxT("Item3"));
popupList->Select(0, true);
fgSizer4->Add( m_comboCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 );
@@ -459,7 +459,7 @@ void GUIFrame::AddPanel_5()
m_comboCtrl2->SetPopupControl(popupTree);
m_comboCtrl2->SetPopupMaxHeight(80);
m_comboCtrl2->SetText(_T("wxComboCtrl"));
m_comboCtrl2->SetText(wxT("wxComboCtrl"));
m_comboCtrl2->SetToolTip(_("wxComboCtrl"));
//Add a root and some nodes using wxTreeCtrl methods

View File

@@ -68,7 +68,7 @@ void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
info.SetName(_("Automatic Screenshot Generator"));
info.SetVersion(_("1.0"));
info.SetDescription(_("This utility automatically creates screenshots of wxWidgets controls for use in wxWidgets documentation."));
info.SetCopyright(_T("(C) 2008 Utensil Candel"));
info.SetCopyright(wxT("(C) 2008 Utensil Candel"));
wxAboutBox(info);
}
@@ -85,10 +85,10 @@ void ScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event))
wxBitmap fullscreen(1, 1);
AutoCaptureMechanism::Capture(&fullscreen, 0, 0, screenWidth, screenHeight);
AutoCaptureMechanism::Save(&fullscreen, _T("fullscreen"));
AutoCaptureMechanism::Save(&fullscreen, wxT("fullscreen"));
wxMessageBox(_("A screenshot of the entire screen was saved as:\n\n ")
+ AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + _T("fullscreen.png"),
+ AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + wxT("fullscreen.png"),
_("Full screen capture"), wxICON_INFORMATION|wxOK, this);
}
@@ -107,7 +107,7 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
case wxYES:
{
wxArrayString files;
wxDir::GetAllFiles(dir, &files, _T("*.png"), wxDIR_FILES);
wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES);
// remove all PNG files from the screenshots folder
int n = files.GetCount();
@@ -135,11 +135,11 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
auto_cap.RegisterControl(m_radioBtn2, AJ_UnionEnd);
auto_cap.RegisterControl(m_bpButton1);
auto_cap.RegisterControl(m_bitmap1);
auto_cap.RegisterControl(m_gauge1, _T("wxGauge"));
auto_cap.RegisterControl(m_gauge1, wxT("wxGauge"));
auto_cap.RegisterControl(m_slider1);
auto_cap.RegisterControl(m_toggleBtn1, AJ_Union);
auto_cap.RegisterControl(m_toggleBtn2, AJ_UnionEnd);
auto_cap.RegisterControl(m_hyperlink1, _T("wxHyperlinkCtrl"));
auto_cap.RegisterControl(m_hyperlink1, wxT("wxHyperlinkCtrl"));
auto_cap.RegisterControl(m_spinCtrl1, AJ_RegionAdjust);
auto_cap.RegisterControl(m_spinBtn1);
auto_cap.RegisterControl(m_scrollBar1);
@@ -151,10 +151,10 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
auto_cap.RegisterControl(m_radioBox1);
auto_cap.RegisterControl(m_staticBox1);
auto_cap.RegisterControl(m_treeCtrl1);
auto_cap.RegisterControl(m_listCtrl1, _T("wxListCtrl"));
auto_cap.RegisterControl(m_listCtrl1, wxT("wxListCtrl"));
auto_cap.RegisterControl(m_animationCtrl1);
auto_cap.RegisterControl(m_collPane1, _T("wxCollapsiblePane"), AJ_Union);
auto_cap.RegisterControl(m_collPane1, wxT("wxCollapsiblePane"), AJ_Union);
auto_cap.RegisterControl(m_collPane2, AJ_UnionEnd);
auto_cap.RegisterPageTurn();
@@ -165,13 +165,13 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event))
auto_cap.RegisterPageTurn();
auto_cap.RegisterControl(m_colourPicker1, _T("wxColourPickerCtrl"));
auto_cap.RegisterControl(m_fontPicker1, _T("wxFontPickerCtrl"));
auto_cap.RegisterControl(m_filePicker1, _T("wxFilePickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_calendar1, _T("wxCalendarCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_datePicker1, _T("wxDatePickerCtrl"));
auto_cap.RegisterControl(m_genericDirCtrl1, _T("wxGenericDirCtrl"));
auto_cap.RegisterControl(m_dirPicker1, _T("wxDirPickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_colourPicker1, wxT("wxColourPickerCtrl"));
auto_cap.RegisterControl(m_fontPicker1, wxT("wxFontPickerCtrl"));
auto_cap.RegisterControl(m_filePicker1, wxT("wxFilePickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_calendar1, wxT("wxCalendarCtrl"), AJ_RegionAdjust);
auto_cap.RegisterControl(m_datePicker1, wxT("wxDatePickerCtrl"));
auto_cap.RegisterControl(m_genericDirCtrl1, wxT("wxGenericDirCtrl"));
auto_cap.RegisterControl(m_dirPicker1, wxT("wxDirPickerCtrl"), AJ_RegionAdjust);
auto_cap.RegisterPageTurn();

View File

@@ -65,9 +65,9 @@ private:
wxXmlNode* children;
while (node)
{
if (node->GetName() == _T("object")
&& node->GetAttribute(_T("class"),&classValue)
&& node->GetAttribute(_T("name"),&nameValue))
if (node->GetName() == wxT("object")
&& node->GetAttribute(wxT("class"),&classValue)
&& node->GetAttribute(wxT("name"),&nameValue))
{
m_wdata.Add(XRCWidgetData(nameValue,classValue));
}
@@ -84,24 +84,24 @@ public:
const wxXmlNode* node) :
m_className(className) , m_parentClassName(parentClassName)
{
if ( className == _T("wxMenu") )
if ( className == wxT("wxMenu") )
{
m_ancestorClassNames.insert(_T("wxMenu"));
m_ancestorClassNames.insert(_T("wxMenuBar"));
m_ancestorClassNames.insert(wxT("wxMenu"));
m_ancestorClassNames.insert(wxT("wxMenuBar"));
}
else if ( className == _T("wxMDIChildFrame") )
else if ( className == wxT("wxMDIChildFrame") )
{
m_ancestorClassNames.insert(_T("wxMDIParentFrame"));
m_ancestorClassNames.insert(wxT("wxMDIParentFrame"));
}
else if( className == _T("wxMenuBar") ||
className == _T("wxStatusBar") ||
className == _T("wxToolBar") )
else if( className == wxT("wxMenuBar") ||
className == wxT("wxStatusBar") ||
className == wxT("wxToolBar") )
{
m_ancestorClassNames.insert(_T("wxFrame"));
m_ancestorClassNames.insert(wxT("wxFrame"));
}
else
{
m_ancestorClassNames.insert(_T("wxWindow"));
m_ancestorClassNames.insert(wxT("wxWindow"));
}
BrowseXmlNode(node->GetChildren());
@@ -114,16 +114,16 @@ public:
bool CanBeUsedWithXRCCTRL(const wxString& name)
{
if (name == _T("tool") ||
name == _T("data") ||
name == _T("unknown") ||
name == _T("notebookpage") ||
name == _T("separator") ||
name == _T("sizeritem") ||
name == _T("wxMenu") ||
name == _T("wxMenuBar") ||
name == _T("wxMenuItem") ||
name.EndsWith(_T("Sizer")) )
if (name == wxT("tool") ||
name == wxT("data") ||
name == wxT("unknown") ||
name == wxT("notebookpage") ||
name == wxT("separator") ||
name == wxT("sizeritem") ||
name == wxT("wxMenu") ||
name == wxT("wxMenuBar") ||
name == wxT("wxMenuItem") ||
name.EndsWith(wxT("Sizer")) )
{
return false;
}
@@ -133,8 +133,8 @@ public:
void GenerateHeaderCode(wxFFile& file)
{
file.Write(_T("class ") + m_className + _T(" : public ") + m_parentClassName
+ _T(" {\nprotected:\n"));
file.Write(wxT("class ") + m_className + wxT(" : public ") + m_parentClassName
+ wxT(" {\nprotected:\n"));
size_t i;
for(i=0;i<m_wdata.GetCount();++i)
{
@@ -142,60 +142,60 @@ public:
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
if( w.GetName().Length() == 0 ) continue;
file.Write(
_T(" ") + w.GetClass() + _T("* ") + w.GetName()
+ _T(";\n"));
wxT(" ") + w.GetClass() + wxT("* ") + w.GetName()
+ wxT(";\n"));
}
file.Write(_T("\nprivate:\n void InitWidgetsFromXRC(wxWindow *parent){\n")
_T(" wxXmlResource::Get()->LoadObject(this,parent,_T(\"")
file.Write(wxT("\nprivate:\n void InitWidgetsFromXRC(wxWindow *parent){\n")
wxT(" wxXmlResource::Get()->LoadObject(this,parent,wxT(\"")
+ m_className
+ _T("\"), _T(\"")
+ wxT("\"), wxT(\"")
+ m_parentClassName
+ _T("\"));\n"));
+ wxT("\"));\n"));
for(i=0;i<m_wdata.GetCount();++i)
{
const XRCWidgetData& w = m_wdata.Item(i);
if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue;
if( w.GetName().Length() == 0 ) continue;
file.Write( _T(" ")
file.Write( wxT(" ")
+ w.GetName()
+ _T(" = XRCCTRL(*this,\"")
+ wxT(" = XRCCTRL(*this,\"")
+ w.GetName()
+ _T("\",")
+ wxT("\",")
+ w.GetClass()
+ _T(");\n"));
+ wxT(");\n"));
}
file.Write(_T(" }\n"));
file.Write(wxT(" }\n"));
file.Write( _T("public:\n"));
file.Write( wxT("public:\n"));
if ( m_ancestorClassNames.size() == 1 )
{
file.Write
(
m_className +
_T("(") +
wxT("(") +
*m_ancestorClassNames.begin() +
_T(" *parent=NULL){\n") +
_T(" InitWidgetsFromXRC((wxWindow *)parent);\n")
_T(" }\n")
_T("};\n")
wxT(" *parent=NULL){\n") +
wxT(" InitWidgetsFromXRC((wxWindow *)parent);\n")
wxT(" }\n")
wxT("};\n")
);
}
else
{
file.Write(m_className + _T("(){\n") +
_T(" InitWidgetsFromXRC(NULL);\n")
_T(" }\n")
_T("};\n"));
file.Write(m_className + wxT("(){\n") +
wxT(" InitWidgetsFromXRC(NULL);\n")
wxT(" }\n")
wxT("};\n"));
for ( StringSet::const_iterator it = m_ancestorClassNames.begin();
it != m_ancestorClassNames.end();
++it )
{
file.Write(m_className + _T("(") + *it + _T(" *parent){\n") +
_T(" InitWidgetsFromXRC((wxWindow *)parent);\n")
_T(" }\n")
_T("};\n"));
file.Write(m_className + wxT("(") + *it + wxT(" *parent){\n") +
wxT(" InitWidgetsFromXRC((wxWindow *)parent);\n")
wxT(" }\n")
wxT("};\n"));
}
}
}
@@ -315,11 +315,11 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
else
{
if (flagCPP)
parOutput = _T("resource.cpp");
parOutput = wxT("resource.cpp");
else if (flagPython)
parOutput = _T("resource.py");
parOutput = wxT("resource.py");
else
parOutput = _T("resource.xrs");
parOutput = wxT("resource.xrs");
}
}
if (!parOutput.empty())
@@ -329,10 +329,10 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
parOutput = fn.GetFullPath();
parOutputPath = wxPathOnly(parOutput);
}
if (!parOutputPath) parOutputPath = _T(".");
if (!parOutputPath) parOutputPath = wxT(".");
if (!cmdline.Found("n", &parFuncname))
parFuncname = _T("InitXmlResource");
parFuncname = wxT("InitXmlResource");
for (size_t i = 0; i < cmdline.GetParamCount(); i++)
{
@@ -378,19 +378,19 @@ void XmlResApp::CompileRes()
wxString XmlResApp::GetInternalFileName(const wxString& name, const wxArrayString& flist)
{
wxString name2 = name;
name2.Replace(_T(":"), _T("_"));
name2.Replace(_T("/"), _T("_"));
name2.Replace(_T("\\"), _T("_"));
name2.Replace(_T("*"), _T("_"));
name2.Replace(_T("?"), _T("_"));
name2.Replace(wxT(":"), wxT("_"));
name2.Replace(wxT("/"), wxT("_"));
name2.Replace(wxT("\\"), wxT("_"));
name2.Replace(wxT("*"), wxT("_"));
name2.Replace(wxT("?"), wxT("_"));
wxString s = wxFileNameFromPath(parOutput) + _T("$") + name2;
wxString s = wxFileNameFromPath(parOutput) + wxT("$") + name2;
if (wxFileExists(s) && flist.Index(s) == wxNOT_FOUND)
{
for (int i = 0;; i++)
{
s.Printf(wxFileNameFromPath(parOutput) + _T("$%03i-") + name2, i);
s.Printf(wxFileNameFromPath(parOutput) + wxT("$%03i-") + name2, i);
if (!wxFileExists(s) || flist.Index(s) != wxNOT_FOUND)
break;
}
@@ -405,13 +405,13 @@ wxArrayString XmlResApp::PrepareTempFiles()
for (size_t i = 0; i < parFiles.GetCount(); i++)
{
if (flagVerbose)
wxPrintf(_T("processing ") + parFiles[i] + _T("...\n"));
wxPrintf(wxT("processing ") + parFiles[i] + wxT("...\n"));
wxXmlDocument doc;
if (!doc.Load(parFiles[i]))
{
wxLogError(_T("Error parsing file ") + parFiles[i]);
wxLogError(wxT("Error parsing file ") + parFiles[i]);
retCode = 1;
continue;
}
@@ -425,9 +425,9 @@ wxArrayString XmlResApp::PrepareTempFiles()
wxXmlNode* node = (doc.GetRoot())->GetChildren();
wxString classValue,nameValue;
while(node){
if(node->GetName() == _T("object")
&& node->GetAttribute(_T("class"),&classValue)
&& node->GetAttribute(_T("name"),&nameValue)){
if(node->GetName() == wxT("object")
&& node->GetAttribute(wxT("class"),&classValue)
&& node->GetAttribute(wxT("name"),&nameValue)){
aXRCWndClassData.Add(
XRCWndClassData(nameValue,classValue,node)
@@ -452,36 +452,36 @@ static bool NodeContainsFilename(wxXmlNode *node)
const wxString name = node->GetName();
// Any bitmaps (bitmap2 is used for disabled toolbar buttons):
if ( name == _T("bitmap") || name == _T("bitmap2") )
if ( name == wxT("bitmap") || name == wxT("bitmap2") )
return true;
if ( name == _T("icon") )
if ( name == wxT("icon") )
return true;
// wxBitmapButton:
wxXmlNode *parent = node->GetParent();
if (parent != NULL &&
parent->GetAttribute(_T("class"), _T("")) == _T("wxBitmapButton") &&
(name == _T("focus") ||
name == _T("disabled") ||
name == _T("hover") ||
name == _T("selected")))
parent->GetAttribute(wxT("class"), wxT("")) == wxT("wxBitmapButton") &&
(name == wxT("focus") ||
name == wxT("disabled") ||
name == wxT("hover") ||
name == wxT("selected")))
return true;
// wxBitmap or wxIcon toplevel resources:
if ( name == _T("object") )
if ( name == wxT("object") )
{
wxString klass = node->GetAttribute(_T("class"), wxEmptyString);
if (klass == _T("wxBitmap") ||
klass == _T("wxIcon") ||
klass == _T("data") )
wxString klass = node->GetAttribute(wxT("class"), wxEmptyString);
if (klass == wxT("wxBitmap") ||
klass == wxT("wxIcon") ||
klass == wxT("data") )
return true;
}
// URLs in wxHtmlWindow:
if ( name == _T("url") &&
if ( name == wxT("url") &&
parent != NULL &&
parent->GetAttribute(_T("class"), _T("")) == _T("wxHtmlWindow") )
parent->GetAttribute(wxT("class"), wxT("")) == wxT("wxHtmlWindow") )
{
// FIXME: this is wrong for e.g. http:// URLs
return true;
@@ -513,7 +513,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt
fullname = inputPath + wxFILE_SEP_PATH + n->GetContent();
if (flagVerbose)
wxPrintf(_T("adding ") + fullname + _T("...\n"));
wxPrintf(wxT("adding ") + fullname + wxT("...\n"));
wxString filename = GetInternalFileName(n->GetContent(), flist);
n->SetContent(filename);
@@ -549,22 +549,22 @@ void XmlResApp::MakePackageZIP(const wxArrayString& flist)
wxString files;
for (size_t i = 0; i < flist.GetCount(); i++)
files += flist[i] + _T(" ");
files += flist[i] + wxT(" ");
files.RemoveLast();
if (flagVerbose)
wxPrintf(_T("compressing ") + parOutput + _T("...\n"));
wxPrintf(wxT("compressing ") + parOutput + wxT("...\n"));
wxString cwd = wxGetCwd();
wxSetWorkingDirectory(parOutputPath);
int execres = wxExecute(_T("zip -9 -j ") +
wxString(flagVerbose ? _T("\"") : _T("-q \"")) +
parOutput + _T("\" ") + files, true);
int execres = wxExecute(wxT("zip -9 -j ") +
wxString(flagVerbose ? wxT("\"") : wxT("-q \"")) +
parOutput + wxT("\" ") + files, true);
wxSetWorkingDirectory(cwd);
if (execres == -1)
{
wxLogError(_T("Unable to execute zip program. Make sure it is in the path."));
wxLogError(_T("You can download it at http://www.cdrom.com/pub/infozip/"));
wxLogError(wxT("Unable to execute zip program. Make sure it is in the path."));
wxLogError(wxT("You can download it at http://www.cdrom.com/pub/infozip/"));
retCode = 1;
return;
}
@@ -585,9 +585,9 @@ static wxString FileToCppArray(wxString filename, int num)
wxASSERT_MSG( static_cast<wxFileOffset>(lng) == offset,
wxT("Huge file not supported") );
snum.Printf(_T("%i"), num);
output.Printf(_T("static size_t xml_res_size_") + snum + _T(" = %i;\n"), lng);
output += _T("static unsigned char xml_res_file_") + snum + _T("[] = {\n");
snum.Printf(wxT("%i"), num);
output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %i;\n"), lng);
output += wxT("static unsigned char xml_res_file_") + snum + wxT("[] = {\n");
// we cannot use string literals because MSVC is dumb wannabe compiler
// with arbitrary limitation to 2048 strings :(
@@ -596,12 +596,12 @@ static wxString FileToCppArray(wxString filename, int num)
for (size_t i = 0, linelng = 0; i < lng; i++)
{
tmp.Printf(_T("%i"), buffer[i]);
if (i != 0) output << _T(',');
tmp.Printf(wxT("%i"), buffer[i]);
if (i != 0) output << wxT(',');
if (linelng > 70)
{
linelng = 0;
output << _T("\n");
output << wxT("\n");
}
output << tmp;
linelng += tmp.Length()+1;
@@ -609,7 +609,7 @@ static wxString FileToCppArray(wxString filename, int num)
delete[] buffer;
output += _T("};\n\n");
output += wxT("};\n\n");
return output;
}
@@ -621,7 +621,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
size_t i;
if (flagVerbose)
wxPrintf(_T("creating C++ source file ") + parOutput + _T("...\n"));
wxPrintf(wxT("creating C++ source file ") + parOutput + wxT("...\n"));
file.Write(""
"//\n"
@@ -673,8 +673,8 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
wxString mime;
wxString ext = wxFileName(flist[i]).GetExt();
if ( ext.Lower() == _T("xrc") )
mime = _T("text/xml");
if ( ext.Lower() == wxT("xrc") )
mime = wxT("text/xml");
#if wxUSE_MIMETYPE
else
{
@@ -688,7 +688,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
#endif // wxUSE_MIMETYPE
s.Printf(" XRC_ADD_FILE(wxT(\"XRC_resource/" + flist[i] +
"\"), xml_res_file_%i, xml_res_size_%i, _T(\"%s\"));\n",
"\"), xml_res_file_%i, xml_res_size_%i, wxT(\"%s\"));\n",
i, i, mime.c_str());
file.Write(s);
}
@@ -707,7 +707,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist)
void XmlResApp::GenCPPHeader()
{
wxString fileSpec = ((parOutput.BeforeLast('.')).AfterLast('/')).AfterLast('\\');
wxString heaFileName = fileSpec + _T(".h");
wxString heaFileName = fileSpec + wxT(".h");
wxFFile file(heaFileName, wxT("wt"));
file.Write(
@@ -739,7 +739,7 @@ static wxString FileToPythonArray(wxString filename, int num)
wxASSERT_MSG( static_cast<wxFileOffset>(lng) == offset,
wxT("Huge file not supported") );
snum.Printf(_T("%i"), num);
snum.Printf(wxT("%i"), num);
output = " xml_res_file_" + snum + " = '''\\\n";
unsigned char *buffer = new unsigned char[lng];
@@ -754,15 +754,15 @@ static wxString FileToPythonArray(wxString filename, int num)
linelng = 0;
}
else if (c < 32 || c > 127 || c == '\'')
tmp.Printf(_T("\\x%02x"), c);
tmp.Printf(wxT("\\x%02x"), c);
else if (c == '\\')
tmp = _T("\\\\");
tmp = wxT("\\\\");
else
tmp = (wxChar)c;
if (linelng > 70)
{
linelng = 0;
output << _T("\\\n");
output << wxT("\\\n");
}
output << tmp;
linelng += tmp.Length();
@@ -770,7 +770,7 @@ static wxString FileToPythonArray(wxString filename, int num)
delete[] buffer;
output += _T("'''\n\n");
output += wxT("'''\n\n");
return output;
}
@@ -782,7 +782,7 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist)
size_t i;
if (flagVerbose)
wxPrintf(_T("creating Python source file ") + parOutput + _T("...\n"));
wxPrintf(wxT("creating Python source file ") + parOutput + wxT("...\n"));
file.Write(
"#\n"
@@ -863,12 +863,12 @@ ExtractedStrings XmlResApp::FindStrings()
for (size_t i = 0; i < parFiles.GetCount(); i++)
{
if (flagVerbose)
wxPrintf(_T("processing ") + parFiles[i] + _T("...\n"));
wxPrintf(wxT("processing ") + parFiles[i] + wxT("...\n"));
wxXmlDocument doc;
if (!doc.Load(parFiles[i]))
{
wxLogError(_T("Error parsing file ") + parFiles[i]);
wxLogError(wxT("Error parsing file ") + parFiles[i]);
retCode = 1;
continue;
}
@@ -937,20 +937,20 @@ XmlResApp::FindStrings(const wxString& filename, wxXmlNode *node)
n->GetType() == wxXML_CDATA_SECTION_NODE) &&
// ...it is textnode...
(
node/*not n!*/->GetName() == _T("label") ||
(node/*not n!*/->GetName() == _T("value") &&
node/*not n!*/->GetName() == wxT("label") ||
(node/*not n!*/->GetName() == wxT("value") &&
!n->GetContent().IsNumber()) ||
node/*not n!*/->GetName() == _T("help") ||
node/*not n!*/->GetName() == _T("longhelp") ||
node/*not n!*/->GetName() == _T("tooltip") ||
node/*not n!*/->GetName() == _T("htmlcode") ||
node/*not n!*/->GetName() == _T("title") ||
node/*not n!*/->GetName() == _T("item")
node/*not n!*/->GetName() == wxT("help") ||
node/*not n!*/->GetName() == wxT("longhelp") ||
node/*not n!*/->GetName() == wxT("tooltip") ||
node/*not n!*/->GetName() == wxT("htmlcode") ||
node/*not n!*/->GetName() == wxT("title") ||
node/*not n!*/->GetName() == wxT("item")
))
// ...and known to contain translatable string
{
if (!flagGettext ||
node->GetAttribute(_T("translate"), _T("1")) != _T("0"))
node->GetAttribute(wxT("translate"), wxT("1")) != wxT("0"))
{
arr.push_back
(