Unicode compilation fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2002-11-07 12:04:36 +00:00
parent b6241cc22d
commit d399635e06
8 changed files with 91 additions and 88 deletions

View File

@@ -108,7 +108,7 @@
{ {
wxImage::AddHandler(new wxPNGHandler); wxImage::AddHandler(new wxPNGHandler);
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame("wxHtmlWindow testing application", MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
wxPoint(50, 50), wxSize(150, 50)); wxPoint(50, 50), wxSize(150, 50));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -135,12 +135,12 @@
// create a menu bar // create a menu bar
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
menuFile->Append(Minimal_About, "&About"); menuFile->Append(Minimal_About, _("&About"));
menuFile->Append(Minimal_Quit, "E&xit"); menuFile->Append(Minimal_Quit, _("E&xit"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -159,13 +159,13 @@
{ {
wxBoxSizer *topsizer; wxBoxSizer *topsizer;
wxHtmlWindow *html; wxHtmlWindow *html;
wxDialog dlg(this, -1, wxString("About")); wxDialog dlg(this, -1, wxString(_("About")));
topsizer = new wxBoxSizer(wxVERTICAL); topsizer = new wxBoxSizer(wxVERTICAL);
html = new wxHtmlWindow(&dlg, -1, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER); html = new wxHtmlWindow(&dlg, -1, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
html -> SetBorders(0); html -> SetBorders(0);
html -> LoadPage("data/about.htm"); html -> LoadPage(wxT("data/about.htm"));
html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(), html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
html -> GetInternalRepresentation() -> GetHeight()); html -> GetInternalRepresentation() -> GetHeight());
@@ -173,7 +173,7 @@
topsizer -> Add(new wxStaticLine(&dlg, -1), 0, wxEXPAND | wxLEFT | wxRIGHT, 10); topsizer -> Add(new wxStaticLine(&dlg, -1), 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
wxButton *bu1 = new wxButton(&dlg, wxID_OK, "Okay"); wxButton *bu1 = new wxButton(&dlg, wxID_OK, _("OK"));
bu1 -> SetDefault(); bu1 -> SetDefault();
topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15); topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);

View File

@@ -111,11 +111,11 @@
#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB #if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
wxFileSystem::AddHandler(new wxZipFSHandler); wxFileSystem::AddHandler(new wxZipFSHandler);
#endif #endif
SetVendorName("wxWindows"); SetVendorName(wxT("wxWindows"));
SetAppName("wxHTMLHelp"); SetAppName(wxT("wxHTMLHelp"));
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame("HTML Help Sample", MyFrame *frame = new MyFrame(_("HTML Help Sample"),
wxPoint(50, 50), wxSize(150, 50)); wxPoint(50, 50), wxSize(150, 50));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -143,12 +143,12 @@
// create a menu bar // create a menu bar
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
menuFile->Append(Minimal_Help, "&Help"); menuFile->Append(Minimal_Help, _("&Help"));
menuFile->Append(Minimal_Quit, "E&xit"); menuFile->Append(Minimal_Quit, _("E&xit"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -156,20 +156,20 @@
help.UseConfig(wxConfig::Get()); help.UseConfig(wxConfig::Get());
bool ret; bool ret;
#if defined(__WXMAC__) && !defined(__DARWIN__) #if defined(__WXMAC__) && !defined(__DARWIN__)
ret = help.AddBook(":helpfiles:testing.hhp"); ret = help.AddBook(wxT(":helpfiles:testing.hhp"));
#else #else
help.SetTempDir("."); help.SetTempDir(wxT("."));
ret = help.AddBook("helpfiles/testing.hhp"); ret = help.AddBook(wxT("helpfiles/testing.hhp"));
#endif #endif
if (! ret) if (! ret)
wxMessageBox("Failed adding book helpfiles/testing.hhp"); wxMessageBox(wxT("Failed adding book helpfiles/testing.hhp"));
#if defined(__WXMAC__) && !defined(__DARWIN__) #if defined(__WXMAC__) && !defined(__DARWIN__)
ret = help.AddBook(":helpfiles:another.hhp"); ret = help.AddBook(wxT(":helpfiles:another.hhp"));
#else #else
ret = help.AddBook("helpfiles/another.hhp"); ret = help.AddBook(wxT("helpfiles/another.hhp"));
#endif #endif
if (! ret) if (! ret)
wxMessageBox("Failed adding book helpfiles/another.hhp"); wxMessageBox(_("Failed adding book helpfiles/another.hhp"));
} }
@@ -183,7 +183,7 @@
void MyFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
{ {
help.Display("Test HELPFILE"); help.Display(wxT("Test HELPFILE"));
} }
void MyFrame::OnClose(wxCloseEvent& event) void MyFrame::OnClose(wxCloseEvent& event)

View File

@@ -66,8 +66,8 @@ bool MyApp::OnInit()
wxInitAllImageHandlers(); wxInitAllImageHandlers();
wxFileSystem::AddHandler(new wxZipFSHandler); wxFileSystem::AddHandler(new wxZipFSHandler);
SetVendorName("wxWindows"); SetVendorName(wxT("wxWindows"));
SetAppName("wxHTMLHelp"); SetAppName(wxT("wxHTMLHelp"));
wxConfig::Get(); // create an instance wxConfig::Get(); // create an instance
help = new wxHtmlHelpController; help = new wxHtmlHelpController;

View File

@@ -129,7 +129,7 @@ bool MyApp::OnInit()
wxImage::AddHandler(new wxGIFHandler); wxImage::AddHandler(new wxGIFHandler);
#endif #endif
MyFrame *frame = new MyFrame("Printing test", MyFrame *frame = new MyFrame(_("Printing test"),
wxPoint(150, 50), wxSize(640, 480)); wxPoint(150, 50), wxSize(640, 480));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -155,20 +155,20 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
{ {
// create a menu bar // create a menu bar
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
menuFile->Append(Minimal_Open, "Open...\tCtrl-O"); menuFile->Append(Minimal_Open, _("Open...\tCtrl-O"));
menuFile->AppendSeparator(); menuFile->AppendSeparator();
menuFile->Append(Minimal_PageSetup, "Page Setup"); menuFile->Append(Minimal_PageSetup, _("Page Setup"));
menuFile->Append(Minimal_PrintSetup, "Printer Setup"); menuFile->Append(Minimal_PrintSetup, _("Printer Setup"));
menuFile->Append(Minimal_Print, "Print..."); menuFile->Append(Minimal_Print, _("Print..."));
menuFile->Append(Minimal_Preview, "Preview..."); menuFile->Append(Minimal_Preview, _("Preview..."));
menuFile->AppendSeparator(); menuFile->AppendSeparator();
menuFile->Append(wxID_ABOUT, "&About"); menuFile->Append(wxID_ABOUT, _("&About"));
menuFile->AppendSeparator(); menuFile->AppendSeparator();
menuFile->Append(Minimal_Quit, "&Exit"); menuFile->Append(Minimal_Quit, _("&Exit"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -176,13 +176,13 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
CreateStatusBar(1); CreateStatusBar(1);
m_Html = new wxHtmlWindow(this); m_Html = new wxHtmlWindow(this);
m_Html -> SetRelatedFrame(this, "HTML : %s"); m_Html -> SetRelatedFrame(this, _("HTML : %s"));
m_Html -> SetRelatedStatusBar(0); m_Html -> SetRelatedStatusBar(0);
m_Name = "test.htm"; m_Name = wxT("test.htm");
m_Html -> LoadPage(m_Name); m_Html -> LoadPage(m_Name);
m_Prn = new wxHtmlEasyPrinting("Easy Printing Demo", this); m_Prn = new wxHtmlEasyPrinting(_("Easy Printing Demo"), this);
m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL); m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL);
} }
// frame destructor // frame destructor
@@ -204,7 +204,7 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{ {
wxMessageBox("HTML printing sample\n\n(c) Vaclav Slavik, 1999"); wxMessageBox(_("HTML printing sample\n\n(c) Vaclav Slavik, 1999"));
} }
@@ -234,13 +234,13 @@ void MyFrame::OnPreview(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
{ {
wxFileDialog dialog(this, "Open HTML page", "", "", "*.htm", 0); wxFileDialog dialog(this, _("Open HTML page"), wxT(""), wxT(""), wxT("*.htm"), 0);
if (dialog.ShowModal() == wxID_OK) if (dialog.ShowModal() == wxID_OK)
{ {
m_Name = dialog.GetPath(); m_Name = dialog.GetPath();
m_Html -> LoadPage(m_Name); m_Html -> LoadPage(m_Name);
m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL); m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL);
} }
} }

View File

@@ -140,12 +140,12 @@ class BoldProcessor : public wxHtmlProcessor
wxFileSystem::AddHandler(new wxInternetFSHandler); wxFileSystem::AddHandler(new wxInternetFSHandler);
#endif #endif
SetVendorName("wxWindows"); SetVendorName(wxT("wxWindows"));
SetAppName("wxHtmlTest"); SetAppName(wxT("wxHtmlTest"));
// the following call to wxConfig::Get will use it to create an object... // the following call to wxConfig::Get will use it to create an object...
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame("wxHtmlWindow testing application", MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
wxPoint(50, 50), wxSize(640, 480)); wxPoint(50, 50), wxSize(640, 480));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -167,25 +167,26 @@ class BoldProcessor : public wxHtmlProcessor
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size, wxDEFAULT_FRAME_STYLE, "html_test_app") : wxFrame((wxFrame *)NULL, -1, title, pos, size, wxDEFAULT_FRAME_STYLE,
wxT("html_test_app"))
{ {
// create a menu bar // create a menu bar
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
wxMenu *menuNav = new wxMenu; wxMenu *menuNav = new wxMenu;
menuFile->Append(Minimal_PageOpen, "&Open HTML page..."); menuFile->Append(Minimal_PageOpen, _("&Open HTML page..."));
menuFile->AppendSeparator(); menuFile->AppendSeparator();
menuFile->Append(Minimal_Processor, "&Remove bold attribute", "", TRUE); menuFile->Append(Minimal_Processor, _("&Remove bold attribute"), wxT(""), TRUE);
menuFile->AppendSeparator(); menuFile->AppendSeparator();
menuFile->Append(Minimal_Quit, "&Close frame"); menuFile->Append(Minimal_Quit, _("&Close frame"));
menuNav->Append(Minimal_Back, "Go &BACK"); menuNav->Append(Minimal_Back, _("Go &BACK"));
menuNav->Append(Minimal_Forward, "Go &FORWARD"); menuNav->Append(Minimal_Forward, _("Go &FORWARD"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
menuBar->Append(menuNav, "&Navigate"); menuBar->Append(menuNav, _("&Navigate"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -195,10 +196,10 @@ class BoldProcessor : public wxHtmlProcessor
m_Processor = new BoldProcessor; m_Processor = new BoldProcessor;
m_Processor->Enable(FALSE); m_Processor->Enable(FALSE);
m_Html = new wxHtmlWindow(this); m_Html = new wxHtmlWindow(this);
m_Html->SetRelatedFrame(this, "HTML : %s"); m_Html->SetRelatedFrame(this, _("HTML : %s"));
m_Html->SetRelatedStatusBar(0); m_Html->SetRelatedStatusBar(0);
m_Html->ReadCustomization(wxConfig::Get()); m_Html->ReadCustomization(wxConfig::Get());
m_Html->LoadPage("test.htm"); m_Html->LoadPage(wxT("test.htm"));
m_Html->AddProcessor(m_Processor); m_Html->AddProcessor(m_Processor);
} }
@@ -215,19 +216,19 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnPageOpen(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPageOpen(wxCommandEvent& WXUNUSED(event))
{ {
wxString p = wxFileSelector(wxT("Open HTML document"), wxT(""), wxT(""), wxT(""), wxT("HTML files|*.htm")); wxString p = wxFileSelector(_("Open HTML document"), wxT(""), wxT(""), wxT(""), wxT("HTML files|*.htm"));
if (p != wxEmptyString) if (p != wxEmptyString)
m_Html -> LoadPage(p); m_Html -> LoadPage(p);
} }
void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event))
{ {
if (!m_Html -> HistoryBack()) wxMessageBox("You reached prehistory era!"); if (!m_Html -> HistoryBack()) wxMessageBox(_("You reached prehistory era!"));
} }
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
{ {
if (!m_Html -> HistoryForward()) wxMessageBox("No more items in history!"); if (!m_Html -> HistoryForward()) wxMessageBox(_("No more items in history!"));
} }
void MyFrame::OnProcessor(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnProcessor(wxCommandEvent& WXUNUSED(event))

View File

@@ -45,7 +45,7 @@ public:
bool MyVFS::CanOpen(const wxString& location) bool MyVFS::CanOpen(const wxString& location)
{ {
return (GetProtocol(location) == "myVFS"); return (GetProtocol(location) == wxT("myVFS"));
} }
@@ -55,6 +55,7 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location)
wxFSFile *f; wxFSFile *f;
wxInputStream *str; wxInputStream *str;
static char buf[1024]; static char buf[1024];
wxCharBuffer loc = location.ToAscii();
sprintf(buf, "<html><body><h2><i>You're in Node <u>%s</u></i></h2><p>" sprintf(buf, "<html><body><h2><i>You're in Node <u>%s</u></i></h2><p>"
"Where do you want to go?<br><blockquote>" "Where do you want to go?<br><blockquote>"
@@ -62,7 +63,8 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location)
"<a href=\"%s-2\">sub-2</a><br>" "<a href=\"%s-2\">sub-2</a><br>"
"<a href=\"%s-3\">sub-3</a><br>" "<a href=\"%s-3\">sub-3</a><br>"
"</blockquote></body></html>", "</blockquote></body></html>",
location.GetData(), location.GetData(), location.GetData(), location.GetData()); (const char*)loc, (const char*)loc, (const char*)loc,
(const char*)loc);
// NB: There's a terrible hack involved: we fill 'buf' with new data every // NB: There's a terrible hack involved: we fill 'buf' with new data every
// time this method is called and return new wxMemoryInputStream pointing to it. // time this method is called and return new wxMemoryInputStream pointing to it.
@@ -70,7 +72,7 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location)
// this won't happen because wxHTML keeps only one "page" file opened at the // this won't happen because wxHTML keeps only one "page" file opened at the
// time. // time.
str = new wxMemoryInputStream(buf, strlen(buf)); str = new wxMemoryInputStream(buf, strlen(buf));
f = new wxFSFile(str, location, "text/html", wxEmptyString, wxDateTime::Today()); f = new wxFSFile(str, location, wxT("text/html"), wxEmptyString, wxDateTime::Today());
return f; return f;
} }
@@ -159,7 +161,7 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location)
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame("wxHtmlWindow testing application", MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
wxPoint(50, 50), wxSize(640, 480)); wxPoint(50, 50), wxSize(640, 480));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -188,14 +190,14 @@ wxHtmlWindow *html;
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
wxMenu *menuNav = new wxMenu; wxMenu *menuNav = new wxMenu;
menuFile->Append(Minimal_Quit, "E&xit"); menuFile->Append(Minimal_Quit, _("E&xit"));
menuNav->Append(Minimal_Back, "Go &BACK"); menuNav->Append(Minimal_Back, _("Go &BACK"));
menuNav->Append(Minimal_Forward, "Go &FORWARD"); menuNav->Append(Minimal_Forward, _("Go &FORWARD"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
menuBar->Append(menuNav, "&Navigate"); menuBar->Append(menuNav, _("&Navigate"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -203,9 +205,9 @@ wxHtmlWindow *html;
CreateStatusBar(2); CreateStatusBar(2);
html = new wxHtmlWindow(this); html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, "VFS Demo: '%s'"); html -> SetRelatedFrame(this, _("VFS Demo: '%s'"));
html -> SetRelatedStatusBar(1); html -> SetRelatedStatusBar(1);
html -> LoadPage("start.htm"); html -> LoadPage(wxT("start.htm"));
} }
@@ -219,11 +221,11 @@ wxHtmlWindow *html;
void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event))
{ {
if (!html -> HistoryBack()) wxMessageBox("You reached prehistory era!"); if (!html -> HistoryBack()) wxMessageBox(_("You reached prehistory era!"));
} }
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
{ {
if (!html -> HistoryForward()) wxMessageBox("No more items in history!"); if (!html -> HistoryForward()) wxMessageBox(_("No more items in history!"));
} }

View File

@@ -153,7 +153,7 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame( "wxHtmlWindow testing application", MyFrame *frame = new MyFrame( _("wxHtmlWindow testing application"),
wxPoint(50, 50), wxSize(640, 480) ); wxPoint(50, 50), wxSize(640, 480) );
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -181,14 +181,14 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
wxMenu *menuNav = new wxMenu; wxMenu *menuNav = new wxMenu;
menuFile->Append(Minimal_Quit, "E&xit"); menuFile->Append(Minimal_Quit, _("E&xit"));
menuNav->Append(Minimal_Back, "Go &BACK"); menuNav->Append(Minimal_Back, _("Go &BACK"));
menuNav->Append(Minimal_Forward, "Go &FORWARD"); menuNav->Append(Minimal_Forward, _("Go &FORWARD"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
menuBar->Append(menuNav, "&Navigate"); menuBar->Append(menuNav, _("&Navigate"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -196,9 +196,9 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
CreateStatusBar(2); CreateStatusBar(2);
html = new wxHtmlWindow(this); html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, "VFS Demo: '%s'"); html -> SetRelatedFrame(this, _("VFS Demo: '%s'"));
html -> SetRelatedStatusBar(1); html -> SetRelatedStatusBar(1);
html -> LoadPage("start.htm"); html -> LoadPage(wxT("start.htm"));
} }
@@ -212,11 +212,11 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event))
{ {
if (!html -> HistoryBack()) wxMessageBox("You reached prehistory era!"); if (!html -> HistoryBack()) wxMessageBox(_("You reached prehistory era!"));
} }
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
{ {
if (!html -> HistoryForward()) wxMessageBox("No more items in history!"); if (!html -> HistoryForward()) wxMessageBox(_("No more items in history!"));
} }

View File

@@ -112,7 +112,7 @@ bool MyApp::OnInit()
wxFileSystem::AddHandler(new wxZipFSHandler); wxFileSystem::AddHandler(new wxZipFSHandler);
// Create the main application window // Create the main application window
MyFrame *frame = new MyFrame( "wxHtmlWindow testing application", MyFrame *frame = new MyFrame(_("wxHtmlWindow testing application"),
wxPoint(50, 50), wxSize(640, 480) ); wxPoint(50, 50), wxSize(640, 480) );
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
@@ -141,14 +141,14 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
wxMenu *menuFile = new wxMenu; wxMenu *menuFile = new wxMenu;
wxMenu *menuNav = new wxMenu; wxMenu *menuNav = new wxMenu;
menuFile->Append(Minimal_Quit, "E&xit"); menuFile->Append(Minimal_Quit, _("E&xit"));
menuNav->Append(Minimal_Back, "Go &BACK"); menuNav->Append(Minimal_Back, _("Go &BACK"));
menuNav->Append(Minimal_Forward, "Go &FORWARD"); menuNav->Append(Minimal_Forward, _("Go &FORWARD"));
// now append the freshly created menu to the menu bar... // now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar; wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File"); menuBar->Append(menuFile, _("&File"));
menuBar->Append(menuNav, "&Navigate"); menuBar->Append(menuNav, _("&Navigate"));
// ... and attach this menu bar to the frame // ... and attach this menu bar to the frame
SetMenuBar(menuBar); SetMenuBar(menuBar);
@@ -157,9 +157,9 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
{ {
html = new wxHtmlWindow(this); html = new wxHtmlWindow(this);
html -> SetRelatedFrame(this, "HTML : %s"); html -> SetRelatedFrame(this, _("HTML : %s"));
html -> SetRelatedStatusBar(0); html -> SetRelatedStatusBar(0);
html -> LoadPage("start.htm"); html -> LoadPage(wxT("start.htm"));
} }
} }
@@ -174,10 +174,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event))
{ {
if (!html -> HistoryBack()) wxMessageBox("You reached prehistory era!"); if (!html -> HistoryBack()) wxMessageBox(_("You reached prehistory era!"));
} }
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
{ {
if (!html -> HistoryForward()) wxMessageBox("No more items in history!"); if (!html -> HistoryForward()) wxMessageBox(_("No more items in history!"));
} }