From 8325937efa3777433f50c3556ca5b8347bc8b425 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Mon, 16 Dec 2002 20:25:28 +0000 Subject: [PATCH] Last samples/Unicode fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/docvwmdi/doc.cpp | 28 +++++++-------- samples/docvwmdi/docview.cpp | 66 ++++++++++++++++++------------------ samples/docvwmdi/view.cpp | 10 +++--- 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/samples/docvwmdi/doc.cpp b/samples/docvwmdi/doc.cpp index 5a327aefe3..dc0c9c5e70 100644 --- a/samples/docvwmdi/doc.cpp +++ b/samples/docvwmdi/doc.cpp @@ -49,14 +49,14 @@ wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream) wxDocument::SaveObject(stream); wxInt32 n = doodleSegments.Number(); - stream << n << '\n'; + stream << n << _T('\n'); wxNode *node = doodleSegments.First(); while (node) { DoodleSegment *segment = (DoodleSegment *)node->Data(); segment->SaveObject(stream); - stream << '\n'; + stream << _T('\n'); node = node->Next(); } @@ -71,14 +71,14 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream) wxTextOutputStream text_stream( stream ); wxInt32 n = doodleSegments.Number(); - text_stream << n << '\n'; + text_stream << n << _T('\n'); wxNode *node = doodleSegments.First(); while (node) { DoodleSegment *segment = (DoodleSegment *)node->Data(); segment->SaveObject(stream); - text_stream << '\n'; + text_stream << _T('\n'); node = node->Next(); } @@ -155,16 +155,16 @@ DoodleSegment::~DoodleSegment(void) wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream) { wxInt32 n = lines.Number(); - stream << n << '\n'; + stream << n << _T('\n'); wxNode *node = lines.First(); while (node) { DoodleLine *line = (DoodleLine *)node->Data(); - stream << line->x1 << " " << - line->y1 << " " << - line->x2 << " " << - line->y2 << "\n"; + stream << line->x1 << _T(" ") << + line->y1 << _T(" ") << + line->x2 << _T(" ") << + line->y2 << _T("\n"); node = node->Next(); } @@ -176,16 +176,16 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream) wxTextOutputStream text_stream( stream ); wxInt32 n = lines.Number(); - text_stream << n << '\n'; + text_stream << n << _T('\n'); wxNode *node = lines.First(); while (node) { DoodleLine *line = (DoodleLine *)node->Data(); - text_stream << line->x1 << " " << - line->y1 << " " << - line->x2 << " " << - line->y2 << "\n"; + text_stream << line->x1 << _T(" ") << + line->y1 << _T(" ") << + line->x2 << _T(" ") << + line->y2 << _T("\n"); node = node->Next(); } diff --git a/samples/docvwmdi/docview.cpp b/samples/docvwmdi/docview.cpp index 69ce099317..51ca36d7a3 100644 --- a/samples/docvwmdi/docview.cpp +++ b/samples/docvwmdi/docview.cpp @@ -56,48 +56,48 @@ bool MyApp::OnInit(void) m_docManager = new wxDocManager; //// Create a template relating drawing documents to their views - (void) new wxDocTemplate((wxDocManager *) m_docManager, "Drawing", "*.drw", "", "drw", "Drawing Doc", "Drawing View", + (void) new wxDocTemplate((wxDocManager *) m_docManager, _T("Drawing"), _T("*.drw"), _T(""), _T("drw"), _T("Drawing Doc"), _T("Drawing View"), CLASSINFO(DrawingDocument), CLASSINFO(DrawingView)); //// Create a template relating text documents to their views - (void) new wxDocTemplate(m_docManager, "Text", "*.txt", "", "txt", "Text Doc", "Text View", + (void) new wxDocTemplate(m_docManager, _T("Text"), _T("*.txt"), _T(""), _T("txt"), _T("Text Doc"), _T("Text View"), CLASSINFO(TextEditDocument), CLASSINFO(TextEditView)); //// Create the main frame window frame = new MyFrame((wxDocManager *) m_docManager, (wxFrame *) NULL, - "DocView Demo", wxPoint(0, 0), wxSize(500, 400), + _T("DocView Demo"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); //// Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - frame->SetIcon(wxIcon("doc")); + frame->SetIcon(wxIcon(_T("doc"))); #endif #ifdef __X__ - frame->SetIcon(wxIcon("doc.xbm")); + frame->SetIcon(wxIcon(_T("doc.xbm"))); #endif //// Make a menubar wxMenu *file_menu = new wxMenu; wxMenu *edit_menu = (wxMenu *) NULL; - file_menu->Append(wxID_NEW, "&New...\tCtrl-N"); - file_menu->Append(wxID_OPEN, "&Open...\tCtrl-X"); + file_menu->Append(wxID_NEW, _T("&New...\tCtrl-N")); + file_menu->Append(wxID_OPEN, _T("&Open...\tCtrl-X")); file_menu->AppendSeparator(); - file_menu->Append(wxID_EXIT, "E&xit\tAlt-X"); + file_menu->Append(wxID_EXIT, _T("E&xit\tAlt-X")); // A nice touch: a history of files visited. Use this menu. m_docManager->FileHistoryUseMenu(file_menu); wxMenu *help_menu = new wxMenu; - help_menu->Append(DOCVIEW_ABOUT, "&About\tF1"); + help_menu->Append(DOCVIEW_ABOUT, _T("&About\tF1")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); if (edit_menu) - menu_bar->Append(edit_menu, "&Edit"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(edit_menu, _T("&Edit")); + menu_bar->Append(help_menu, _T("&Help")); //// Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -124,60 +124,60 @@ wxMDIChildFrame *MyApp::CreateChildFrame(wxDocument *doc, wxView *view, bool isC { //// Make a child frame wxDocMDIChildFrame *subframe = - new wxDocMDIChildFrame(doc, view, GetMainFrame(), -1, "Child Frame", + new wxDocMDIChildFrame(doc, view, GetMainFrame(), -1, _T("Child Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); #ifdef __WXMSW__ - subframe->SetIcon(wxString(isCanvas ? "chart" : "notepad")); + subframe->SetIcon(wxString(isCanvas ? _T("chart") : _T("notepad"))); #endif #ifdef __X__ - subframe->SetIcon(wxIcon("doc.xbm")); + subframe->SetIcon(wxIcon(_T("doc.xbm"))); #endif //// Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(wxID_NEW, "&New..."); - file_menu->Append(wxID_OPEN, "&Open..."); - file_menu->Append(wxID_CLOSE, "&Close"); - file_menu->Append(wxID_SAVE, "&Save"); - file_menu->Append(wxID_SAVEAS, "Save &As..."); + file_menu->Append(wxID_NEW, _T("&New...")); + file_menu->Append(wxID_OPEN, _T("&Open...")); + file_menu->Append(wxID_CLOSE, _T("&Close")); + file_menu->Append(wxID_SAVE, _T("&Save")); + file_menu->Append(wxID_SAVEAS, _T("Save &As...")); if (isCanvas) { file_menu->AppendSeparator(); - file_menu->Append(wxID_PRINT, "&Print..."); - file_menu->Append(wxID_PRINT_SETUP, "Print &Setup..."); - file_menu->Append(wxID_PREVIEW, "Print Pre&view"); + file_menu->Append(wxID_PRINT, _T("&Print...")); + file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); + file_menu->Append(wxID_PREVIEW, _T("Print Pre&view")); } file_menu->AppendSeparator(); - file_menu->Append(wxID_EXIT, "E&xit"); + file_menu->Append(wxID_EXIT, _T("E&xit")); wxMenu *edit_menu = (wxMenu *) NULL; if (isCanvas) { edit_menu = new wxMenu; - edit_menu->Append(wxID_UNDO, "&Undo"); - edit_menu->Append(wxID_REDO, "&Redo"); + edit_menu->Append(wxID_UNDO, _T("&Undo")); + edit_menu->Append(wxID_REDO, _T("&Redo")); edit_menu->AppendSeparator(); - edit_menu->Append(DOCVIEW_CUT, "&Cut last segment"); + edit_menu->Append(DOCVIEW_CUT, _T("&Cut last segment")); doc->GetCommandProcessor()->SetEditMenu(edit_menu); } wxMenu *help_menu = new wxMenu; - help_menu->Append(DOCVIEW_ABOUT, "&About"); + help_menu->Append(DOCVIEW_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); if (isCanvas) - menu_bar->Append(edit_menu, "&Edit"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(edit_menu, _T("&Edit")); + menu_bar->Append(help_menu, _T("&Help")); //// Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); @@ -196,14 +196,14 @@ END_EVENT_TABLE() MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, long type): - wxDocMDIParentFrame(manager, frame, -1, title, pos, size, type, "myFrame") + wxDocMDIParentFrame(manager, frame, -1, title, pos, size, type, _T("myFrame")) { editMenu = (wxMenu *) NULL; } void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { - (void)wxMessageBox("DocView Demo\nAuthor: Julian Smart\nUsage: docview.exe", "About DocView"); + (void)wxMessageBox(_T("DocView Demo\nAuthor: Julian Smart\nUsage: docview.exe"), _T("About DocView")); } // Creates a canvas. Called from view.cpp when a new drawing diff --git a/samples/docvwmdi/view.cpp b/samples/docvwmdi/view.cpp index 2f873099a8..6e67a8c51f 100644 --- a/samples/docvwmdi/view.cpp +++ b/samples/docvwmdi/view.cpp @@ -47,7 +47,7 @@ END_EVENT_TABLE() bool DrawingView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) { frame = wxGetApp().CreateChildFrame(doc, this, TRUE); - frame->SetTitle("DrawingView"); + frame->SetTitle(_T("DrawingView")); canvas = GetMainFrame()->CreateCanvas(this, frame); #ifdef __X__ @@ -129,7 +129,7 @@ bool DrawingView::OnClose(bool deleteWindow) void DrawingView::OnCut(wxCommandEvent& WXUNUSED(event) ) { DrawingDocument *doc = (DrawingDocument *)GetDocument(); - doc->GetCommandProcessor()->Submit(new DrawingCommand((const wxString) "Cut Last Segment", DOODLE_CUT, doc, (DoodleSegment *) NULL)); + doc->GetCommandProcessor()->Submit(new DrawingCommand(_T("Cut Last Segment"), DOODLE_CUT, doc, (DoodleSegment *) NULL)); } IMPLEMENT_DYNAMIC_CLASS(TextEditView, wxView) @@ -141,7 +141,7 @@ bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) int width, height; frame->GetClientSize(&width, &height); textsw = new MyTextWindow(this, frame, wxPoint(0, 0), wxSize(width, height), wxTE_MULTILINE); - frame->SetTitle("TextEditView"); + frame->SetTitle(_T("TextEditView")); #ifdef __X__ // X seems to require a forced resize @@ -230,7 +230,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) // We've got a valid segment on mouse left up, so store it. DrawingDocument *doc = (DrawingDocument *)view->GetDocument(); - doc->GetCommandProcessor()->Submit(new DrawingCommand("Add Segment", DOODLE_ADD, doc, currentSegment)); + doc->GetCommandProcessor()->Submit(new DrawingCommand(_T("Add Segment"), DOODLE_ADD, doc, currentSegment)); view->GetDocument()->Modify(TRUE); currentSegment = (DoodleSegment *) NULL; @@ -257,7 +257,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) // Define a constructor for my text subwindow MyTextWindow::MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style): - wxTextCtrl(frame, -1, "", pos, size, style) + wxTextCtrl(frame, -1, _T(""), pos, size, style) { view = v; } -- 2.45.2