From 600683ca0561c9d56e73f1faa3f21d8a6670936b Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 15 Dec 2002 17:25:36 +0000 Subject: [PATCH] Fixed all remaining samples/Unicode compilation errors. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/ipc/client.cpp | 48 +++--- samples/ipc/client.h | 2 +- samples/ipc/ddesetup.h | 6 +- samples/ipc/server.cpp | 30 ++-- samples/ipc/server.h | 6 +- samples/joytest/joytest.cpp | 20 +-- samples/minifram/minifram.cpp | 28 ++-- samples/minifram/minifram.h | 4 +- samples/nativdlg/nativdlg.cpp | 12 +- samples/newgrid/griddemo.cpp | 274 ++++++++++++++++---------------- samples/oleauto/oleauto.cpp | 32 ++-- samples/ownerdrw/ownerdrw.cpp | 68 ++++---- samples/png/pngdemo.cpp | 26 +-- samples/printing/printing.cpp | 56 +++---- samples/printing/printing.h | 2 +- samples/proplist/proplist.cpp | 102 ++++++------ samples/proplist/proplist.h | 8 +- samples/propsize/propsize.cpp | 34 ++-- samples/regtest/regtest.cpp | 84 +++++----- samples/rotate/rotate.cpp | 16 +- samples/sashtest/sashtest.cpp | 50 +++--- samples/scrollsub/scrollsub.cpp | 56 +++---- 22 files changed, 481 insertions(+), 483 deletions(-) diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index be407db5ab..9c479b0075 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -76,7 +76,7 @@ bool MyApp::OnInit() wxString service = IPC_SERVICE; // ignored under DDE, host name in TCP/IP based classes - wxString hostName = "localhost"; + wxString hostName = _T("localhost"); if (argc > 1) service = argv[1]; @@ -94,23 +94,23 @@ bool MyApp::OnInit() while ( !the_connection ) { - if ( wxMessageBox("Failed to make connection to server.\nRetry?", - "Client Demo Error", + if ( wxMessageBox(_T("Failed to make connection to server.\nRetry?"), + _T("Client Demo Error"), wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES ) { // no server return FALSE; } - the_connection = (MyConnection *)my_client->MakeConnection(hostName, service, "IPC TEST"); + the_connection = (MyConnection *)my_client->MakeConnection(hostName, service, _T("IPC TEST")); } } if (!the_connection->StartAdvise(IPC_ADVISE_NAME)) - wxMessageBox("StartAdvise failed", "Client Demo Error"); + wxMessageBox(_T("StartAdvise failed"), _T("Client Demo Error")); // Create the main frame window - (new MyFrame(NULL, "Client"))->Show(TRUE); + (new MyFrame(NULL, _T("Client")))->Show(TRUE); return TRUE; } @@ -139,50 +139,50 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(CLIENT_EXECUTE, "&Execute\tCtrl-E"); - file_menu->Append(CLIENT_REQUEST, "&Request\tCtrl-R"); - file_menu->Append(CLIENT_POKE, "&Poke\tCtrl-P"); - file_menu->Append(CLIENT_QUIT, "&Quit\tCtrl-Q"); + file_menu->Append(CLIENT_EXECUTE, _T("&Execute\tCtrl-E")); + file_menu->Append(CLIENT_REQUEST, _T("&Request\tCtrl-R")); + file_menu->Append(CLIENT_POKE, _T("&Poke\tCtrl-P")); + file_menu->Append(CLIENT_QUIT, _T("&Quit\tCtrl-Q")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); // Associate the menu bar with the frame SetMenuBar(menu_bar); // Make a listbox which shows the choices made in the server the_list = new wxListBox(this, CLIENT_LISTBOX, wxPoint(5, 5)); - the_list->Append("Apple"); - the_list->Append("Pear"); - the_list->Append("Orange"); - the_list->Append("Banana"); - the_list->Append("Fruit"); + the_list->Append(_T("Apple")); + the_list->Append(_T("Pear")); + the_list->Append(_T("Orange")); + the_list->Append(_T("Banana")); + the_list->Append(_T("Fruit")); } void MyFrame::OnExecute(wxCommandEvent& event) { if (the_connection) - if (!the_connection->Execute("Hello from the client!")) - wxMessageBox("Execute failed", "Client Demo Error"); + if (!the_connection->Execute(_T("Hello from the client!"))) + wxMessageBox(_T("Execute failed"), _T("Client Demo Error")); } void MyFrame::OnPoke(wxCommandEvent& event) { if (the_connection) - if (!the_connection->Poke("An item", "Some data to poke at the server!")) - wxMessageBox("Poke failed", "Client Demo Error"); + if (!the_connection->Poke(_T("An item"), _T("Some data to poke at the server!"))) + wxMessageBox(_T("Poke failed"), _T("Client Demo Error")); } void MyFrame::OnRequest(wxCommandEvent& event) { if (the_connection) { - char *data = the_connection->Request("An item"); + wxChar *data = the_connection->Request(_T("An item")); if (data) - wxMessageBox(data, "Client: Request", wxOK); + wxMessageBox(data, _T("Client: Request"), wxOK); else - wxMessageBox("Request failed", "Client Demo Error"); + wxMessageBox(_T("Request failed"), _T("Client Demo Error")); } } @@ -196,7 +196,7 @@ wxConnectionBase *MyClient::OnMakeConnection() return new MyConnection; } -bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format) +bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format) { if (the_list) { diff --git a/samples/ipc/client.h b/samples/ipc/client.h index 5131e1ca45..a5e453701c 100644 --- a/samples/ipc/client.h +++ b/samples/ipc/client.h @@ -37,7 +37,7 @@ private: class MyConnection: public wxConnection { public: - bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format); + bool OnAdvise(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format); bool OnDisconnect(); }; diff --git a/samples/ipc/ddesetup.h b/samples/ipc/ddesetup.h index 193f0d3b93..e5886c9ad0 100644 --- a/samples/ipc/ddesetup.h +++ b/samples/ipc/ddesetup.h @@ -15,10 +15,10 @@ #include // the default service name -#define IPC_SERVICE "4242" +#define IPC_SERVICE _T("4242") // the IPC topic -#define IPC_TOPIC "IPC TEST" +#define IPC_TOPIC _T("IPC TEST") // the name of the item we're being advised about -#define IPC_ADVISE_NAME "Item" +#define IPC_ADVISE_NAME _T("Item") diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 1f4a3b63fe..5d9b0cf1aa 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -70,7 +70,7 @@ MyConnection *the_connection = NULL; bool MyApp::OnInit() { // Create the main frame window - (new MyFrame(NULL, "Server"))->Show(TRUE); + (new MyFrame(NULL, _T("Server")))->Show(TRUE); // service name (DDE classes) or port number (TCP/IP based classes) wxString service = IPC_SERVICE; @@ -108,22 +108,22 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(SERVER_EXIT, "&Quit\tCtrl-Q"); + file_menu->Append(SERVER_EXIT, _T("&Quit\tCtrl-Q")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); // Associate the menu bar with the frame SetMenuBar(menu_bar); // Make a listbox wxListBox *list = new wxListBox(this, SERVER_LISTBOX, wxPoint(5, 5)); - list->Append("Apple"); - list->Append("Pear"); - list->Append("Orange"); - list->Append("Banana"); - list->Append("Fruit"); + list->Append(_T("Apple")); + list->Append(_T("Pear")); + list->Append(_T("Orange")); + list->Append(_T("Banana")); + list->Append(_T("Fruit")); } // Set the client process's listbox to this item @@ -138,7 +138,7 @@ void MyFrame::OnListBoxClick(wxCommandEvent& WXUNUSED(event)) one connection can receive advise messages */ if (the_connection) { - the_connection->Advise(IPC_ADVISE_NAME, (wxChar *)value.c_str()); + the_connection->Advise(IPC_ADVISE_NAME, (wxChar*)value.c_str()); } } } @@ -158,7 +158,7 @@ IPCDialogBox::IPCDialogBox(wxWindow *parent, const wxString& title, : wxDialog(parent, -1, title, pos, size) { m_connection = connection; - (void)new wxButton(this, SERVER_QUIT_BUTTON, "Quit this connection", + (void)new wxButton(this, SERVER_QUIT_BUTTON, _T("Quit this connection"), wxPoint(5, 5)); Fit(); } @@ -197,7 +197,7 @@ wxConnectionBase *MyServer::OnAcceptConnection(const wxString& topic) MyConnection::MyConnection() : wxConnection() { - dialog = new IPCDialogBox(wxTheApp->GetTopWindow(), "Connection", + dialog = new IPCDialogBox(wxTheApp->GetTopWindow(), _T("Connection"), wxPoint(100, 100), wxSize(500, 500), this); dialog->Show(TRUE); the_connection = this; @@ -217,7 +217,7 @@ MyConnection::~MyConnection() } bool MyConnection::OnExecute(const wxString& WXUNUSED(topic), - char *data, + wxChar *data, int WXUNUSED(size), wxIPCFormat WXUNUSED(format)) { @@ -227,7 +227,7 @@ bool MyConnection::OnExecute(const wxString& WXUNUSED(topic), bool MyConnection::OnPoke(const wxString& WXUNUSED(topic), const wxString& item, - char *data, + wxChar *data, int WXUNUSED(size), wxIPCFormat WXUNUSED(format)) { @@ -235,12 +235,12 @@ bool MyConnection::OnPoke(const wxString& WXUNUSED(topic), return TRUE; } -char *MyConnection::OnRequest(const wxString& WXUNUSED(topic), +wxChar *MyConnection::OnRequest(const wxString& WXUNUSED(topic), const wxString& WXUNUSED(item), int * WXUNUSED(size), wxIPCFormat WXUNUSED(format)) { - return "Here, have your data, client!"; + return _T("Here, have your data, client!"); } bool MyConnection::OnStartAdvise(const wxString& WXUNUSED(topic), diff --git a/samples/ipc/server.h b/samples/ipc/server.h index 93de320cc3..6f65c463ba 100644 --- a/samples/ipc/server.h +++ b/samples/ipc/server.h @@ -45,9 +45,9 @@ public: MyConnection(); ~MyConnection(); - bool OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format); - char *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format); - bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format); + bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format); + wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format); + bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format); bool OnStartAdvise(const wxString& topic, const wxString& item); IPCDialogBox *dialog; diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index d1eac3e5ea..bfcb3873b9 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -49,12 +49,12 @@ bool MyApp::OnInit() wxJoystick stick(wxJOYSTICK1); if (!stick.IsOk()) { - wxMessageBox("No joystick detected!"); + wxMessageBox(_T("No joystick detected!")); return FALSE; } #if wxUSE_WAVE - m_fire.Create("gun.wav"); + m_fire.Create(_T("gun.wav")); #endif // wxUSE_WAVE m_maxX = stick.GetXMax(); @@ -62,25 +62,25 @@ bool MyApp::OnInit() // Create the main frame window - frame = new MyFrame(NULL, "Joystick Demo", wxDefaultPosition, + frame = new MyFrame(NULL, _T("Joystick Demo"), wxDefaultPosition, wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - frame->SetIcon(wxIcon("joyicon")); + frame->SetIcon(wxIcon(_T("joyicon"))); #endif #ifdef __X__ - frame->SetIcon(wxIcon("joyicon.xbm")); + frame->SetIcon(wxIcon(_T("joyicon.xbm"))); #endif // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(JOYTEST_QUIT, "&Exit"); + file_menu->Append(JOYTEST_QUIT, _T("&Exit")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -135,11 +135,11 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) xpos = pt.x; ypos = pt.y; - char buf[100]; + wxString buf; if (event.ButtonDown()) - sprintf(buf, "Joystick (%d, %d) Fire!", pt.x, pt.y); + buf.Printf(_T("Joystick (%d, %d) Fire!"), pt.x, pt.y); else - sprintf(buf, "Joystick (%d, %d)", pt.x, pt.y); + buf.Printf(_T("Joystick (%d, %d)"), pt.x, pt.y); frame->SetStatusText(buf); diff --git a/samples/minifram/minifram.cpp b/samples/minifram/minifram.cpp index 796773a8b7..e99b132d58 100644 --- a/samples/minifram/minifram.cpp +++ b/samples/minifram/minifram.cpp @@ -53,16 +53,16 @@ wxButton *button = (wxButton*) NULL; bool MyApp::OnInit() { // Create the main frame window - main_frame = new MyMainFrame((wxFrame *) NULL, -1, "wxFrame sample", + main_frame = new MyMainFrame((wxFrame *) NULL, -1, _T("wxFrame sample"), wxPoint(100, 100), wxSize(300, 200)); main_frame->CreateToolBar(wxNO_BORDER|wxTB_VERTICAL, ID_TOOLBAR); InitToolbar(main_frame->GetToolBar()); - button = new wxButton( main_frame, ID_REPARENT, "Press to reparent!" ); + button = new wxButton( main_frame, ID_REPARENT, _T("Press to reparent!") ); // Create the mini frame window - mini_frame = new MyMiniFrame( main_frame, -1, "wxMiniFrame sample", + mini_frame = new MyMiniFrame( main_frame, -1, _T("wxMiniFrame sample"), wxPoint(100, 100), wxSize(220, 100)); mini_frame_exists = TRUE; @@ -100,24 +100,24 @@ bool MyApp::InitToolbar(wxToolBar* toolBar) int width = 16; int currentX = 5; - toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "New file"); + toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("New file")); currentX += width + 5; - toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Open file"); + toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Open file")); currentX += width + 5; - toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Save file"); + toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Save file")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Copy"); + toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Copy")); currentX += width + 5; - toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Cut"); + toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Cut")); currentX += width + 5; - toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Paste"); + toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Paste")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Reparent the button"); + toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Reparent the button")); currentX += width + 5; toolBar->AddSeparator(); - toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Help"); + toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, _T("Help")); toolBar->Realize(); @@ -184,9 +184,9 @@ void MyMainFrame::OnReparent(wxCommandEvent& WXUNUSED(event)) // practical jokers might find satisfaction in reparenting the button // after closing the mini_frame. We'll have the last laugh. if (! mini_frame_exists) - wxMessageBox("The miniframe no longer exists.\n" - "You don't want to make this button an orphan, do you?", - "You got to be kidding"); + wxMessageBox(_T("The miniframe no longer exists.\n") + _T("You don't want to make this button an orphan, do you?"), + _T("You got to be kidding")); else { button->Reparent( mini_frame ); diff --git a/samples/minifram/minifram.h b/samples/minifram/minifram.h index ea3c215c51..bcfeeb9346 100644 --- a/samples/minifram/minifram.h +++ b/samples/minifram/minifram.h @@ -23,7 +23,7 @@ class MyApp: public wxApp class MyMiniFrame: public wxMiniFrame { public: - MyMiniFrame(wxFrame *parent, wxWindowID id = -1, const wxString& title = "wxToolBar Sample", + MyMiniFrame(wxFrame *parent, wxWindowID id = -1, const wxString& title = _T("wxToolBar Sample"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize ); void OnCloseWindow(wxCloseEvent& event); @@ -36,7 +36,7 @@ DECLARE_EVENT_TABLE() class MyMainFrame: public wxFrame { public: - MyMainFrame(wxFrame *parent, wxWindowID id = -1, const wxString& title = "wxToolBar Sample", + MyMainFrame(wxFrame *parent, wxWindowID id = -1, const wxString& title = _T("wxToolBar Sample"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize ); void OnCloseWindow(wxCloseEvent& event); diff --git a/samples/nativdlg/nativdlg.cpp b/samples/nativdlg/nativdlg.cpp index 764f619784..12d5b5648c 100644 --- a/samples/nativdlg/nativdlg.cpp +++ b/samples/nativdlg/nativdlg.cpp @@ -47,7 +47,7 @@ MyApp::MyApp() bool MyApp::OnInit(void) { // Create the main frame window - frame = new MyFrame(NULL, -1, "wxWindows Native Dialog Sample", wxPoint(0, 0), wxSize(300, 250)); + frame = new MyFrame(NULL, -1, _T("wxWindows Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250)); // Give it a status line frame->CreateStatusBar(2); @@ -55,18 +55,18 @@ bool MyApp::OnInit(void) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(RESOURCE_TEST1, "&Dialog box test", "Test dialog box resource"); - file_menu->Append(RESOURCE_QUIT, "E&xit", "Quit program"); + file_menu->Append(RESOURCE_TEST1, _T("&Dialog box test"), _T("Test dialog box resource")); + file_menu->Append(RESOURCE_QUIT, _T("E&xit"), _T("Quit program")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); // Make a panel - frame->panel = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(400, 400), 0, "MyMainFrame"); + frame->panel = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(400, 400), 0, _T("MyMainFrame")); frame->Show(TRUE); // Return the main frame window @@ -95,7 +95,7 @@ void MyFrame::OnQuit(wxCommandEvent& event) void MyFrame::OnTest1(wxCommandEvent& event) { MyDialog *dialog = new MyDialog; - if (dialog->LoadNativeDialog(this, "dialog1")) + if (dialog->LoadNativeDialog(this, _T("dialog1"))) { /* wxTextCtrl *text = (wxTextCtrl *)wxFindWindowByName("multitext3", dialog); diff --git a/samples/newgrid/griddemo.cpp b/samples/newgrid/griddemo.cpp index e1820b8a53..a13e12f181 100644 --- a/samples/newgrid/griddemo.cpp +++ b/samples/newgrid/griddemo.cpp @@ -130,7 +130,7 @@ END_EVENT_TABLE() GridFrame::GridFrame() - : wxFrame( (wxFrame *)NULL, -1, "wxWindows grid class demo", + : wxFrame( (wxFrame *)NULL, -1, _T("wxWindows grid class demo"), wxDefaultPosition, wxDefaultSize ) { @@ -138,91 +138,91 @@ GridFrame::GridFrame() int logW = gridW, logH = 100; wxMenu *fileMenu = new wxMenu; - fileMenu->Append( ID_VTABLE, "&Virtual table test\tCtrl-V"); - fileMenu->Append( ID_BUGS_TABLE, "&Bugs table test\tCtrl-B"); - fileMenu->Append( ID_SMALL_GRID, "&Small Grid test\tCtrl-S"); + fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V")); + fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B")); + fileMenu->Append( ID_SMALL_GRID, _T("&Small Grid test\tCtrl-S")); fileMenu->AppendSeparator(); - fileMenu->Append( wxID_EXIT, "E&xit\tAlt-X" ); + fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") ); wxMenu *viewMenu = new wxMenu; - viewMenu->Append( ID_TOGGLEROWLABELS, "&Row labels", "", TRUE ); - viewMenu->Append( ID_TOGGLECOLLABELS, "&Col labels", "", TRUE ); - viewMenu->Append( ID_TOGGLEEDIT, "&Editable", "", TRUE ); - viewMenu->Append( ID_TOGGLEROWSIZING, "Ro&w drag-resize", "", TRUE ); - viewMenu->Append( ID_TOGGLECOLSIZING, "C&ol drag-resize", "", TRUE ); - viewMenu->Append( ID_TOGGLEGRIDSIZING, "&Grid drag-resize", "", TRUE ); - viewMenu->Append( ID_TOGGLEGRIDLINES, "&Grid Lines", "", TRUE ); - viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, "&Set Cell Highlight Width...", "" ); - viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, "&Set Cell RO Highlight Width...", "" ); - viewMenu->Append( ID_AUTOSIZECOLS, "&Auto-size cols" ); - viewMenu->Append( ID_CELLOVERFLOW, "&Overflow cells", "", TRUE ); - viewMenu->Append( ID_RESIZECELL, "&Resize cell (7,1)", "", TRUE ); + viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), _T(""), TRUE ); + viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), _T(""), TRUE ); + viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), _T(""), TRUE ); + viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), _T(""), TRUE ); + viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), _T(""), TRUE ); + viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), _T(""), TRUE ); + viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), _T(""), TRUE ); + viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width..."), _T("") ); + viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width..."), _T("") ); + viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") ); + viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), _T(""), TRUE ); + viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), _T(""), TRUE ); wxMenu *rowLabelMenu = new wxMenu; - viewMenu->Append( ID_ROWLABELALIGN, "R&ow label alignment", + viewMenu->Append( ID_ROWLABELALIGN, _T("R&ow label alignment"), rowLabelMenu, - "Change alignment of row labels" ); + _T("Change alignment of row labels") ); - rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, "&Horizontal" ); - rowLabelMenu->Append( ID_ROWLABELVERTALIGN, "&Vertical" ); + rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, _T("&Horizontal") ); + rowLabelMenu->Append( ID_ROWLABELVERTALIGN, _T("&Vertical") ); wxMenu *colLabelMenu = new wxMenu; - viewMenu->Append( ID_COLLABELALIGN, "Col l&abel alignment", + viewMenu->Append( ID_COLLABELALIGN, _T("Col l&abel alignment"), colLabelMenu, - "Change alignment of col labels" ); + _T("Change alignment of col labels") ); - colLabelMenu->Append( ID_COLLABELHORIZALIGN, "&Horizontal" ); - colLabelMenu->Append( ID_COLLABELVERTALIGN, "&Vertical" ); + colLabelMenu->Append( ID_COLLABELHORIZALIGN, _T("&Horizontal") ); + colLabelMenu->Append( ID_COLLABELVERTALIGN, _T("&Vertical") ); wxMenu *colMenu = new wxMenu; - colMenu->Append( ID_SETLABELCOLOUR, "Set &label colour..." ); - colMenu->Append( ID_SETLABELTEXTCOLOUR, "Set label &text colour..." ); - colMenu->Append( ID_SETLABEL_FONT, "Set label fo&nt..." ); - colMenu->Append( ID_GRIDLINECOLOUR, "&Grid line colour..." ); - colMenu->Append( ID_SET_CELL_FG_COLOUR, "Set cell &foreground colour..." ); - colMenu->Append( ID_SET_CELL_BG_COLOUR, "Set cell &background colour..." ); + colMenu->Append( ID_SETLABELCOLOUR, _T("Set &label colour...") ); + colMenu->Append( ID_SETLABELTEXTCOLOUR, _T("Set label &text colour...") ); + colMenu->Append( ID_SETLABEL_FONT, _T("Set label fo&nt...") ); + colMenu->Append( ID_GRIDLINECOLOUR, _T("&Grid line colour...") ); + colMenu->Append( ID_SET_CELL_FG_COLOUR, _T("Set cell &foreground colour...") ); + colMenu->Append( ID_SET_CELL_BG_COLOUR, _T("Set cell &background colour...") ); wxMenu *editMenu = new wxMenu; - editMenu->Append( ID_INSERTROW, "Insert &row" ); - editMenu->Append( ID_INSERTCOL, "Insert &column" ); - editMenu->Append( ID_DELETEROW, "Delete selected ro&ws" ); - editMenu->Append( ID_DELETECOL, "Delete selected co&ls" ); - editMenu->Append( ID_CLEARGRID, "Cl&ear grid cell contents" ); + editMenu->Append( ID_INSERTROW, _T("Insert &row") ); + editMenu->Append( ID_INSERTCOL, _T("Insert &column") ); + editMenu->Append( ID_DELETEROW, _T("Delete selected ro&ws") ); + editMenu->Append( ID_DELETECOL, _T("Delete selected co&ls") ); + editMenu->Append( ID_CLEARGRID, _T("Cl&ear grid cell contents") ); wxMenu *selectMenu = new wxMenu; - selectMenu->Append( ID_SELECT_UNSELECT, "Add new cells to the selection", - "When off, old selection is deselected before " - "selecting the new cells", TRUE ); - selectMenu->Append( ID_SELECT_ALL, "Select all"); - selectMenu->Append( ID_SELECT_ROW, "Select row 2"); - selectMenu->Append( ID_SELECT_COL, "Select col 2"); - selectMenu->Append( ID_SELECT_CELL, "Select cell (3, 1)"); - selectMenu->Append( ID_DESELECT_ALL, "Deselect all"); - selectMenu->Append( ID_DESELECT_ROW, "Deselect row 2"); - selectMenu->Append( ID_DESELECT_COL, "Deselect col 2"); - selectMenu->Append( ID_DESELECT_CELL, "Deselect cell (3, 1)"); + selectMenu->Append( ID_SELECT_UNSELECT, _T("Add new cells to the selection"), + _T("When off, old selection is deselected before ") + _T("selecting the new cells"), TRUE ); + selectMenu->Append( ID_SELECT_ALL, _T("Select all")); + selectMenu->Append( ID_SELECT_ROW, _T("Select row 2")); + selectMenu->Append( ID_SELECT_COL, _T("Select col 2")); + selectMenu->Append( ID_SELECT_CELL, _T("Select cell (3, 1)")); + selectMenu->Append( ID_DESELECT_ALL, _T("Deselect all")); + selectMenu->Append( ID_DESELECT_ROW, _T("Deselect row 2")); + selectMenu->Append( ID_DESELECT_COL, _T("Deselect col 2")); + selectMenu->Append( ID_DESELECT_CELL, _T("Deselect cell (3, 1)")); wxMenu *selectionMenu = new wxMenu; - selectMenu->Append( ID_CHANGESEL, "Change &selection mode", + selectMenu->Append( ID_CHANGESEL, _T("Change &selection mode"), selectionMenu, - "Change selection mode" ); + _T("Change selection mode") ); - selectionMenu->Append( ID_SELCELLS, "Select &Cells" ); - selectionMenu->Append( ID_SELROWS, "Select &Rows" ); - selectionMenu->Append( ID_SELCOLS, "Select C&ols" ); + selectionMenu->Append( ID_SELCELLS, _T("Select &Cells") ); + selectionMenu->Append( ID_SELROWS, _T("Select &Rows") ); + selectionMenu->Append( ID_SELCOLS, _T("Select C&ols") ); wxMenu *helpMenu = new wxMenu; - helpMenu->Append( ID_ABOUT, "&About wxGrid demo" ); + helpMenu->Append( ID_ABOUT, _T("&About wxGrid demo") ); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append( fileMenu, "&File" ); - menuBar->Append( viewMenu, "&View" ); - menuBar->Append( colMenu, "&Colours" ); - menuBar->Append( editMenu, "&Edit" ); - menuBar->Append( selectMenu, "&Select" ); - menuBar->Append( helpMenu, "&Help" ); + menuBar->Append( fileMenu, _T("&File") ); + menuBar->Append( viewMenu, _T("&View") ); + menuBar->Append( colMenu, _T("&Colours") ); + menuBar->Append( editMenu, _T("&Edit") ); + menuBar->Append( selectMenu, _T("&Select") ); + menuBar->Append( helpMenu, _T("&Help") ); SetMenuBar( menuBar ); @@ -255,41 +255,41 @@ GridFrame::GridFrame() grid->AppendRows(ir); grid->SetRowSize( 0, 60 ); - grid->SetCellValue( 0, 0, "Ctrl+Home\nwill go to\nthis cell" ); + grid->SetCellValue( 0, 0, _T("Ctrl+Home\nwill go to\nthis cell") ); - grid->SetCellValue( 0, 1, "A long piece of text to demonstrate wrapping." ); + grid->SetCellValue( 0, 1, _T("A long piece of text to demonstrate wrapping.") ); grid->SetCellRenderer(0 , 1, new wxGridCellAutoWrapStringRenderer); grid->SetCellEditor( 0, 1 , new wxGridCellAutoWrapStringEditor); - grid->SetCellValue( 0, 2, "Blah" ); - grid->SetCellValue( 0, 3, "Read only" ); + grid->SetCellValue( 0, 2, _T("Blah") ); + grid->SetCellValue( 0, 3, _T("Read only") ); grid->SetReadOnly( 0, 3 ); - grid->SetCellValue( 0, 4, "Can veto edit this cell" ); + grid->SetCellValue( 0, 4, _T("Can veto edit this cell") ); - grid->SetCellValue( 0, 5, "Press\nCtrl+arrow\nto skip over\ncells" ); + grid->SetCellValue( 0, 5, _T("Press\nCtrl+arrow\nto skip over\ncells") ); grid->SetRowSize( 99, 60 ); - grid->SetCellValue( 99, 99, "Ctrl+End\nwill go to\nthis cell" ); - grid->SetCellValue( 1, 0, "This default cell will overflow into neighboring cells, but not if you turn overflow off."); + grid->SetCellValue( 99, 99, _T("Ctrl+End\nwill go to\nthis cell") ); + grid->SetCellValue( 1, 0, _T("This default cell will overflow into neighboring cells, but not if you turn overflow off.")); grid->SetCellTextColour(1, 2, *wxRED); grid->SetCellBackgroundColour(1, 2, *wxGREEN); - grid->SetCellValue( 1, 4, "I'm in the middle"); + grid->SetCellValue( 1, 4, _T("I'm in the middle")); - grid->SetCellValue(2, 2, "red"); + grid->SetCellValue(2, 2, _T("red")); grid->SetCellTextColour(2, 2, *wxRED); - grid->SetCellValue(3, 3, "green on grey"); + grid->SetCellValue(3, 3, _T("green on grey")); grid->SetCellTextColour(3, 3, *wxGREEN); grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY); - grid->SetCellValue(4, 4, "a weird looking cell"); + grid->SetCellValue(4, 4, _T("a weird looking cell")); grid->SetCellAlignment(4, 4, wxALIGN_CENTRE, wxALIGN_CENTRE); grid->SetCellRenderer(4, 4, new MyGridCellRenderer); - grid->SetCellValue(3, 0, "0"); + grid->SetCellValue(3, 0, _T("0")); grid->SetCellRenderer(3, 0, new wxGridCellBoolRenderer); grid->SetCellEditor(3, 0, new wxGridCellBoolEditor); @@ -301,23 +301,23 @@ GridFrame::GridFrame() attr->SetBackgroundColour(*wxRED); grid->SetRowAttr(5, attr); - grid->SetCellValue(2, 4, "a wider column"); + grid->SetCellValue(2, 4, _T("a wider column")); grid->SetColSize(4, 120); grid->SetColMinimalWidth(4, 120); grid->SetCellTextColour(5, 8, *wxGREEN); - grid->SetCellValue(5, 8, "Bg from row attr\nText col from cell attr"); - grid->SetCellValue(5, 5, "Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't"); + grid->SetCellValue(5, 8, _T("Bg from row attr\nText col from cell attr")); + grid->SetCellValue(5, 5, _T("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't")); grid->SetColFormatFloat(6); - grid->SetCellValue(0, 6, "3.1415"); - grid->SetCellValue(1, 6, "1415"); - grid->SetCellValue(2, 6, "12345.67890"); + grid->SetCellValue(0, 6, _T("3.1415")); + grid->SetCellValue(1, 6, _T("1415")); + grid->SetCellValue(2, 6, _T("12345.67890")); grid->SetColFormatFloat(7, 6, 2); - grid->SetCellValue(0, 7, "3.1415"); - grid->SetCellValue(1, 7, "1415"); - grid->SetCellValue(2, 7, "12345.67890"); + grid->SetCellValue(0, 7, _T("3.1415")); + grid->SetCellValue(1, 7, _T("1415")); + grid->SetCellValue(2, 7, _T("12345.67890")); const wxString choices[] = { @@ -332,7 +332,7 @@ GridFrame::GridFrame() grid->SetCellSize(7, 1, 3, 4); grid->SetCellAlignment(7, 1, wxALIGN_CENTRE, wxALIGN_CENTRE); - grid->SetCellValue(7, 1, "Big box!"); + grid->SetCellValue(7, 1, _T("Big box!")); wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); topSizer->Add( grid, @@ -434,10 +434,10 @@ void GridFrame::ToggleGridLines( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::OnSetHighlightWidth( wxCommandEvent& WXUNUSED(ev) ) { - wxString choices[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}; + wxString choices[] = { _T("0"), _T("1"), _T("2"), _T("3"), _T("4"), _T("5"), _T("6"), _T("7"), _T("8"), _T("9"), _T("10")}; - wxSingleChoiceDialog dlg(this, "Choose the thickness of the highlight pen:", - "Pen Width", 11, choices); + wxSingleChoiceDialog dlg(this, _T("Choose the thickness of the highlight pen:"), + _T("Pen Width"), 11, choices); int current = grid->GetCellHighlightPenWidth(); dlg.SetSelection(current); @@ -448,10 +448,10 @@ void GridFrame::OnSetHighlightWidth( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::OnSetROHighlightWidth( wxCommandEvent& WXUNUSED(ev) ) { - wxString choices[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}; + wxString choices[] = { _T("0"), _T("1"), _T("2"), _T("3"), _T("4"), _T("5"), _T("6"), _T("7"), _T("8"), _T("9"), _T("10")}; - wxSingleChoiceDialog dlg(this, "Choose the thickness of the highlight pen:", - "Pen Width", 11, choices); + wxSingleChoiceDialog dlg(this, _T("Choose the thickness of the highlight pen:"), + _T("Pen Width"), 11, choices); int current = grid->GetCellHighlightROPenWidth(); dlg.SetSelection(current); @@ -760,22 +760,22 @@ void GridFrame::OnAddToSelectToggle(wxCommandEvent& event) void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) { - logBuf = ""; + logBuf = _T(""); if ( ev.GetRow() != -1 ) { - logBuf << "Left click on row label " << ev.GetRow(); + logBuf << _T("Left click on row label ") << ev.GetRow(); } else if ( ev.GetCol() != -1 ) { - logBuf << "Left click on col label " << ev.GetCol(); + logBuf << _T("Left click on col label ") << ev.GetCol(); } else { - logBuf << "Left click on corner label"; + logBuf << _T("Left click on corner label"); } - if ( ev.ShiftDown() ) logBuf << " (shift down)"; - if ( ev.ControlDown() ) logBuf << " (control down)"; + if ( ev.ShiftDown() ) logBuf << _T(" (shift down)"); + if ( ev.ControlDown() ) logBuf << _T(" (control down)"); wxLogMessage( wxT("%s"), logBuf.c_str() ); // you must call event skip if you want default grid processing @@ -786,9 +786,9 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) void GridFrame::OnCellLeftClick( wxGridEvent& ev ) { - logBuf = ""; - logBuf << "Left click at row " << ev.GetRow() - << " col " << ev.GetCol(); + logBuf = _T(""); + logBuf << _T("Left click at row ") << ev.GetRow() + << _T(" col ") << ev.GetCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); // you must call event skip if you want default grid processing @@ -800,8 +800,8 @@ void GridFrame::OnCellLeftClick( wxGridEvent& ev ) void GridFrame::OnRowSize( wxGridSizeEvent& ev ) { - logBuf = ""; - logBuf << "Resized row " << ev.GetRowOrCol(); + logBuf = _T(""); + logBuf << _T("Resized row ") << ev.GetRowOrCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); ev.Skip(); @@ -810,8 +810,8 @@ void GridFrame::OnRowSize( wxGridSizeEvent& ev ) void GridFrame::OnColSize( wxGridSizeEvent& ev ) { - logBuf = ""; - logBuf << "Resized col " << ev.GetRowOrCol(); + logBuf = _T(""); + logBuf << _T("Resized col ") << ev.GetRowOrCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); ev.Skip(); @@ -820,17 +820,17 @@ void GridFrame::OnColSize( wxGridSizeEvent& ev ) void GridFrame::OnSelectCell( wxGridEvent& ev ) { - logBuf = ""; + logBuf = _T(""); if ( ev.Selecting() ) - logBuf << "Selected "; + logBuf << _T("Selected "); else - logBuf << "Deselected "; - logBuf << "cell at row " << ev.GetRow() - << " col " << ev.GetCol() - << " ( ControlDown: "<< (ev.ControlDown() ? 'T':'F') - << ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F') - << ", AltDown: "<< (ev.AltDown() ? 'T':'F') - << ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )"; + logBuf << _T("Deselected "); + logBuf << _T("cell at row ") << ev.GetRow() + << _T(" col ") << ev.GetCol() + << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') + << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') + << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F') + << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )"); wxLogMessage( wxT("%s"), logBuf.c_str() ); // you must call Skip() if you want the default processing @@ -840,19 +840,19 @@ void GridFrame::OnSelectCell( wxGridEvent& ev ) void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) { - logBuf = ""; + logBuf = _T(""); if ( ev.Selecting() ) - logBuf << "Selected "; + logBuf << _T("Selected "); else - logBuf << "Deselected "; - logBuf << "cells from row " << ev.GetTopRow() - << " col " << ev.GetLeftCol() - << " to row " << ev.GetBottomRow() - << " col " << ev.GetRightCol() - << " ( ControlDown: "<< (ev.ControlDown() ? 'T':'F') - << ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F') - << ", AltDown: "<< (ev.AltDown() ? 'T':'F') - << ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )"; + logBuf << _T("Deselected "); + logBuf << _T("cells from row ") << ev.GetTopRow() + << _T(" col ") << ev.GetLeftCol() + << _T(" to row ") << ev.GetBottomRow() + << _T(" col ") << ev.GetRightCol() + << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') + << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') + << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F') + << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )"); wxLogMessage( wxT("%s"), logBuf.c_str() ); ev.Skip(); @@ -860,10 +860,10 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) void GridFrame::OnCellValueChanged( wxGridEvent& ev ) { - logBuf = ""; - logBuf << "Value changed for cell at" - << " row " << ev.GetRow() - << " col " << ev.GetCol(); + logBuf = _T(""); + logBuf << _T("Value changed for cell at") + << _T(" row ") << ev.GetRow() + << _T(" col ") << ev.GetCol(); wxLogMessage( wxT("%s"), logBuf.c_str() ); @@ -906,10 +906,10 @@ void GridFrame::OnEditorHidden( wxGridEvent& ev ) void GridFrame::About( wxCommandEvent& WXUNUSED(ev) ) { - (void)wxMessageBox( "\n\nwxGrid demo \n\n" - "Michael Bedward \n" - "mbedward@ozemail.com.au \n\n", - "About", + (void)wxMessageBox( _T("\n\nwxGrid demo \n\n") + _T("Michael Bedward \n") + _T("mbedward@ozemail.com.au \n\n"), + _T("About"), wxOK ); } @@ -927,7 +927,7 @@ void GridFrame::OnBugsTable(wxCommandEvent& ) void GridFrame::OnSmallGrid(wxCommandEvent& ) { - wxFrame* frame = new wxFrame(NULL, -1, "A Small Grid", + wxFrame* frame = new wxFrame(NULL, -1, _T("A Small Grid"), wxDefaultPosition, wxSize(640, 480)); wxPanel* panel = new wxPanel(frame, -1); wxGrid* grid = new wxGrid(panel, -1, wxPoint(10,10), wxSize(400,400), @@ -944,16 +944,16 @@ void GridFrame::OnVTable(wxCommandEvent& ) // MB: wxGetNumberFromUser doesn't work properly for wxMotif wxString s; s << s_sizeGrid; - s = wxGetTextFromUser( "Size of the table to create", - "Size:", + s = wxGetTextFromUser( _T("Size of the table to create"), + _T("Size:"), s ); s.ToLong( &s_sizeGrid ); #else - s_sizeGrid = wxGetNumberFromUser("Size of the table to create", - "Size: ", - "wxGridDemo question", + s_sizeGrid = wxGetNumberFromUser(_T("Size of the table to create"), + _T("Size: "), + _T("wxGridDemo question"), s_sizeGrid, 0, 32000, this); #endif @@ -1033,7 +1033,7 @@ wxGridCellAttr *MyGridCellAttrProvider::GetAttr(int row, int col, // ============================================================================ BigGridFrame::BigGridFrame(long sizeGrid) - : wxFrame(NULL, -1, "Plugin Virtual Table", + : wxFrame(NULL, -1, _T("Plugin Virtual Table"), wxDefaultPosition, wxSize(500, 450)) { m_grid = new wxGrid(this, -1, wxDefaultPosition, wxDefaultSize); @@ -1331,7 +1331,7 @@ BugsGridTable::BugsGridTable() // ---------------------------------------------------------------------------- BugsGridFrame::BugsGridFrame() - : wxFrame(NULL, -1, "Bugs table", + : wxFrame(NULL, -1, _T("Bugs table"), wxDefaultPosition, wxSize(500, 300)) { wxGrid *grid = new wxGrid(this, -1, wxDefaultPosition); diff --git a/samples/oleauto/oleauto.cpp b/samples/oleauto/oleauto.cpp index 1c745b8519..1297437a4b 100644 --- a/samples/oleauto/oleauto.cpp +++ b/samples/oleauto/oleauto.cpp @@ -134,7 +134,7 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { // Create the main application window - MyFrame *frame = new MyFrame("OleAuto wxWindows App", + MyFrame *frame = new MyFrame(_T("OleAuto wxWindows App"), wxPoint(50, 50), wxSize(450, 340)); // Show it and tell the application that it's our main window @@ -162,21 +162,21 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(OleAuto_Test, "&Test Excel Automation..."); - menuFile->Append(OleAuto_About, "&About..."); + menuFile->Append(OleAuto_Test, _T("&Test Excel Automation...")); + menuFile->Append(OleAuto_About, _T("&About...")); menuFile->AppendSeparator(); - menuFile->Append(OleAuto_Quit, "E&xit"); + menuFile->Append(OleAuto_Quit, _T("E&xit")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, "&File"); + menuBar->Append(menuFile, _T("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText("Welcome to wxWindows!"); + SetStatusText(_T("Welcome to wxWindows!")); } @@ -190,8 +190,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox("This is an OLE Automation sample", - "About OleAuto", wxOK | wxICON_INFORMATION, this); + wxMessageBox(_T("This is an OLE Automation sample"), + _T("About OleAuto"), wxOK | wxICON_INFORMATION, this); } /* Tests OLE automation by making the active Excel cell bold, @@ -199,26 +199,26 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) */ void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWindows automation test!' in bold."); + wxMessageBox(_T("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWindows automation test!' in bold.")); wxAutomationObject excelObject, rangeObject; - if (!excelObject.GetInstance("Excel.Application")) + if (!excelObject.GetInstance(_T("Excel.Application"))) { - if (!excelObject.CreateInstance("Excel.Application")) + if (!excelObject.CreateInstance(_T("Excel.Application"))) { - wxMessageBox("Could not create Excel object."); + wxMessageBox(_T("Could not create Excel object.")); return; } } - if (!excelObject.PutProperty("ActiveCell.Value", "wxWindows automation test!")) + if (!excelObject.PutProperty(_T("ActiveCell.Value"), _T("wxWindows automation test!"))) { - wxMessageBox("Could not set active cell value."); + wxMessageBox(_T("Could not set active cell value.")); return; } #ifdef HAVE_BOOL - if (!excelObject.PutProperty("ActiveCell.Font.Bold", wxVariant((bool) TRUE)) ) + if (!excelObject.PutProperty(_T("ActiveCell.Font.Bold"), wxVariant((bool) TRUE)) ) { - wxMessageBox("Could not put Bold property to active cell."); + wxMessageBox(_T("Could not put Bold property to active cell.")); return; } #endif diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index 1474b59868..85608c96e6 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -40,7 +40,7 @@ class OwnerDrawnFrame : public wxFrame { public: // ctor & dtor - OwnerDrawnFrame(wxFrame *frame, char *title, int x, int y, int w, int h); + OwnerDrawnFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h); ~OwnerDrawnFrame(); // notifications @@ -84,7 +84,7 @@ IMPLEMENT_APP(OwnerDrawnApp); bool OwnerDrawnApp::OnInit(void) { OwnerDrawnFrame *pFrame - = new OwnerDrawnFrame(NULL, "wxWindows Ownerdraw Sample", + = new OwnerDrawnFrame(NULL, _T("wxWindows Ownerdraw Sample"), 50, 50, 450, 340); SetTopWindow(pFrame); @@ -108,82 +108,82 @@ void OwnerDrawnFrame::InitMenu() fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE); // sorry for my artistic skills... - wxBitmap bmpBell("bell"), bmpSound("sound"), bmpNoSound("nosound"); + wxBitmap bmpBell(_T("bell")), bmpSound(_T("sound")), bmpNoSound(_T("nosound")); // construct submenu - pItem = new wxMenuItem(sub_menu, Menu_Sub1, "Submenu &first", "large"); + pItem = new wxMenuItem(sub_menu, Menu_Sub1, _T("Submenu &first"), _T("large")); pItem->SetFont(fontLarge); sub_menu->Append(pItem); - pItem = new wxMenuItem(sub_menu, Menu_Sub2, "Submenu &second", "italic", + pItem = new wxMenuItem(sub_menu, Menu_Sub2, _T("Submenu &second"), _T("italic"), wxITEM_CHECK); pItem->SetFont(fontItalic); sub_menu->Append(pItem); - pItem = new wxMenuItem(sub_menu, Menu_Sub3, "Submenu &third", "underlined", + pItem = new wxMenuItem(sub_menu, Menu_Sub3, _T("Submenu &third"), _T("underlined"), wxITEM_CHECK); pItem->SetFont(fontUlined); sub_menu->Append(pItem); // construct menu - pItem = new wxMenuItem(file_menu, Menu_Test1, "&Uncheckable", "red item"); + pItem = new wxMenuItem(file_menu, Menu_Test1, _T("&Uncheckable"), _T("red item")); pItem->SetFont(*wxITALIC_FONT); pItem->SetTextColour(wxColor(255, 0, 0)); pItem->SetMarginWidth(23); file_menu->Append(pItem); - pItem = new wxMenuItem(file_menu, Menu_Test2, "&Checkable", - "checkable item", wxITEM_CHECK); + pItem = new wxMenuItem(file_menu, Menu_Test2, _T("&Checkable"), + _T("checkable item"), wxITEM_CHECK); pItem->SetFont(*wxSMALL_FONT); file_menu->Append(pItem); file_menu->Check(Menu_Test2, TRUE); - pItem = new wxMenuItem(file_menu, Menu_Test3, "&Disabled", "disabled item"); + pItem = new wxMenuItem(file_menu, Menu_Test3, _T("&Disabled"), _T("disabled item")); pItem->SetFont(*wxNORMAL_FONT); file_menu->Append(pItem); file_menu->Enable(Menu_Test3, FALSE); file_menu->AppendSeparator(); - pItem = new wxMenuItem(file_menu, Menu_Bitmap, "&Bell", - "check/uncheck me!", wxITEM_CHECK); + pItem = new wxMenuItem(file_menu, Menu_Bitmap, _T("&Bell"), + _T("check/uncheck me!"), wxITEM_CHECK); pItem->SetFont(fontBmp); pItem->SetBitmaps(bmpBell); file_menu->Append(pItem); - pItem = new wxMenuItem(file_menu, Menu_Bitmap2, "So&und", - "icon changes!", wxITEM_CHECK); + pItem = new wxMenuItem(file_menu, Menu_Bitmap2, _T("So&und"), + _T("icon changes!"), wxITEM_CHECK); pItem->SetFont(fontBmp); pItem->SetBitmaps(bmpSound, bmpNoSound); file_menu->Append(pItem); file_menu->AppendSeparator(); - pItem = new wxMenuItem(file_menu, Menu_Submenu, "&Sub menu", "", + pItem = new wxMenuItem(file_menu, Menu_Submenu, _T("&Sub menu"), _T(""), wxITEM_CHECK, sub_menu); pItem->SetFont(*wxSWISS_FONT); file_menu->Append(pItem); file_menu->AppendSeparator(); - pItem = new wxMenuItem(file_menu, Menu_Quit, "&Quit", "Normal item", + pItem = new wxMenuItem(file_menu, Menu_Quit, _T("&Quit"), _T("Normal item"), wxITEM_NORMAL); pItem->SetFont(*wxNORMAL_FONT); file_menu->Append(pItem); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); SetMenuBar(menu_bar); } // main frame constructor -OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, +OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h) : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) { // set the icon - SetIcon(wxIcon("mondrian")); + SetIcon(wxIcon(_T("mondrian"))); // create the menu InitMenu(); @@ -192,16 +192,16 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, const int widths[] = { -1, 60 }; CreateStatusBar(2); SetStatusWidths(2, widths); - SetStatusText("no selection", 0); + SetStatusText(_T("no selection"), 0); // make a panel with some controls wxPanel *pPanel = new wxPanel(this, -1, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL); // check list box - static const char* aszChoices[] = { "Hello", "world", "and", - "goodbye", "cruel", "world", - "-------", "owner-drawn", "listbox" }; + static const wxChar* aszChoices[] = { _T("Hello"), _T("world"), _T("and"), + _T("goodbye"), _T("cruel"), _T("world"), + _T("-------"), _T("owner-drawn"), _T("listbox") }; wxString *astrChoices = new wxString[WXSIZEOF(aszChoices)]; unsigned int ui; @@ -228,9 +228,9 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, char *title, m_pListBox->Check(2); // normal (but owner-drawn) listbox - static const char* aszColors[] = { "Red", "Blue", "Pink", - "Green", "Yellow", - "Black", "Violet" }; + static const wxChar* aszColors[] = { _T("Red"), _T("Blue"), _T("Pink"), + _T("Green"), _T("Yellow"), + _T("Black"), _T("Violet") }; struct { unsigned int r, g, b; } aColors[] = { {255,0,0}, {0,0,255}, {255,128,192}, @@ -288,8 +288,8 @@ void OwnerDrawnFrame::OnQuit(wxCommandEvent& event) void OwnerDrawnFrame::OnAbout(wxCommandEvent& event) { wxMessageDialog dialog(this, - "Demo of owner-drawn controls\n", - "About wxOwnerDrawn", wxYES_NO | wxCANCEL); + _T("Demo of owner-drawn controls\n"), + _T("About wxOwnerDrawn"), wxYES_NO | wxCANCEL); dialog.ShowModal(); } @@ -297,16 +297,16 @@ void OwnerDrawnFrame::OnListboxSelect(wxCommandEvent& event) { wxString strSelection; unsigned int nSel = event.GetSelection(); - strSelection.sprintf(wxT("item %d selected (%schecked)"), nSel, - m_pListBox->IsChecked(nSel) ? wxT("") : wxT("not ")); + strSelection.Printf(wxT("item %d selected (%schecked)"), nSel, + m_pListBox->IsChecked(nSel) ? wxT("") : wxT("not ")); SetStatusText(strSelection); } void OwnerDrawnFrame::OnListboxDblClick(wxCommandEvent& event) { wxString strSelection; - strSelection.sprintf(wxT("item %d double clicked"), - m_pListBox->GetSelection()); + strSelection.Printf(wxT("item %d double clicked"), + m_pListBox->GetSelection()); wxMessageDialog dialog(this, strSelection); dialog.ShowModal(); } @@ -315,7 +315,7 @@ void OwnerDrawnFrame::OnCheckboxToggle(wxCommandEvent& event) { wxString strSelection; unsigned int nItem = event.GetInt(); - strSelection.sprintf(wxT("item %d was %schecked"), nItem, - m_pListBox->IsChecked(nItem) ? wxT("") : wxT("un")); + strSelection.Printf(wxT("item %d was %schecked"), nItem, + m_pListBox->IsChecked(nItem) ? wxT("") : wxT("un")); SetStatusText(strSelection); } diff --git a/samples/png/pngdemo.cpp b/samples/png/pngdemo.cpp index 186d3c90ac..7100fd22bd 100644 --- a/samples/png/pngdemo.cpp +++ b/samples/png/pngdemo.cpp @@ -38,7 +38,7 @@ bool MyApp::OnInit(void) wxImage::AddHandler(new wxPNGHandler); // Create the main frame window - frame = new MyFrame((wxFrame *) NULL, "wxPNGBitmap Demo", wxPoint(0, 0), wxSize(300, 300)); + frame = new MyFrame((wxFrame *) NULL, _T("wxPNGBitmap Demo"), wxPoint(0, 0), wxSize(300, 300)); // Give it a status line frame->CreateStatusBar(2); @@ -47,15 +47,15 @@ bool MyApp::OnInit(void) wxMenu *file_menu = new wxMenu; wxMenu *help_menu = new wxMenu; - file_menu->Append(PNGDEMO_LOAD_FILE, "&Load file", "Load file"); - file_menu->Append(PNGDEMO_SAVE_FILE, "&Save file", "Save file"); - file_menu->Append(PNGDEMO_QUIT, "E&xit", "Quit program"); - help_menu->Append(PNGDEMO_ABOUT, "&About", "About PNG demo"); + file_menu->Append(PNGDEMO_LOAD_FILE, _T("&Load file"), _T("Load file")); + file_menu->Append(PNGDEMO_SAVE_FILE, _T("&Save file"), _T("Save file")); + file_menu->Append(PNGDEMO_QUIT, _T("E&xit"), _T("Quit program")); + help_menu->Append(PNGDEMO_ABOUT, _T("&About"), _T("About PNG demo")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -68,7 +68,7 @@ bool MyApp::OnInit(void) frame->Show(TRUE); - frame->SetStatusText("Hello, wxWindows"); + frame->SetStatusText(_T("Hello, wxWindows")); return TRUE; } @@ -104,8 +104,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("PNG demo\nJulian Smart (c) 1998", - "About PNG Demo", wxOK); + (void)wxMessageBox(_T("PNG demo\nJulian Smart (c) 1998"), + _T("About PNG Demo"), wxOK); } void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event)) @@ -114,7 +114,7 @@ void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event)) (const wxChar *)NULL, wxT("png"), wxT("PNG files (*.png)|*.png") ); - if (f == "") return; + if (f == _T("")) return; wxBitmap *backstore = new wxBitmap( 150, 150 ); @@ -127,7 +127,7 @@ void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event)) memDC.SetPen( *wxBLACK_PEN ); memDC.DrawLine( 0, 0, 0, 10 ); memDC.SetTextForeground( *wxWHITE ); - memDC.DrawText( "This is a memory dc.", 10, 10 ); + memDC.DrawText( _T("This is a memory dc."), 10, 10 ); memDC.SelectObject( wxNullBitmap ); @@ -143,7 +143,7 @@ void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event)) (const wxChar *) NULL, wxT("png"), wxT("PNG files (*.png)|*.png")); - if (f == "") + if (f == _T("")) return; if ( g_TestBitmap ) diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index c9c2e6b1e8..0ce10f7655 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -64,7 +64,7 @@ wxPageSetupData* g_pageSetupData = (wxPageSetupData*) NULL; IMPLEMENT_APP(MyApp) // Writes a header on a page. Margin units are in millimetres. -bool WritePageHeader(wxPrintout *printout, wxDC *dc, char *text, float mmToLogical); +bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical); MyApp::MyApp() { @@ -80,7 +80,7 @@ bool MyApp::OnInit(void) g_pageSetupData = new wxPageSetupDialogData; // Create the main frame window - frame = new MyFrame((wxFrame *) NULL, (char *) "wxWindows Printing Demo", wxPoint(0, 0), wxSize(400, 400)); + frame = new MyFrame((wxFrame *) NULL, _T("wxWindows Printing Demo"), wxPoint(0, 0), wxSize(400, 400)); // Give it a status line frame->CreateStatusBar(2); @@ -91,10 +91,10 @@ bool MyApp::OnInit(void) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(WXPRINT_PRINT, "&Print...", "Print"); - file_menu->Append(WXPRINT_PRINT_SETUP, "Print &Setup...", "Setup printer properties"); - file_menu->Append(WXPRINT_PAGE_SETUP, "Page Set&up...", "Page setup"); - file_menu->Append(WXPRINT_PREVIEW, "Print Pre&view", "Preview"); + file_menu->Append(WXPRINT_PRINT, _T("&Print..."), _T("Print")); + file_menu->Append(WXPRINT_PRINT_SETUP, _T("Print &Setup..."), _T("Setup printer properties")); + file_menu->Append(WXPRINT_PAGE_SETUP, _T("Page Set&up..."), _T("Page setup")); + file_menu->Append(WXPRINT_PREVIEW, _T("Print Pre&view"), _T("Preview")); #if wxUSE_ACCEL // Accelerators @@ -106,21 +106,21 @@ bool MyApp::OnInit(void) #if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW file_menu->AppendSeparator(); - file_menu->Append(WXPRINT_PRINT_PS, "Print PostScript...", "Print (PostScript)"); - file_menu->Append(WXPRINT_PRINT_SETUP_PS, "Print Setup PostScript...", "Setup printer properties (PostScript)"); - file_menu->Append(WXPRINT_PAGE_SETUP_PS, "Page Setup PostScript...", "Page setup (PostScript)"); - file_menu->Append(WXPRINT_PREVIEW_PS, "Print Preview PostScript", "Preview (PostScript)"); + file_menu->Append(WXPRINT_PRINT_PS, _T("Print PostScript..."), _T("Print (PostScript)")); + file_menu->Append(WXPRINT_PRINT_SETUP_PS, _T("Print Setup PostScript..."), _T("Setup printer properties (PostScript)")); + file_menu->Append(WXPRINT_PAGE_SETUP_PS, _T("Page Setup PostScript..."), _T("Page setup (PostScript)")); + file_menu->Append(WXPRINT_PREVIEW_PS, _T("Print Preview PostScript"), _T("Preview (PostScript)")); #endif file_menu->AppendSeparator(); - file_menu->Append(WXPRINT_QUIT, "E&xit", "Exit program"); + file_menu->Append(WXPRINT_QUIT, _T("E&xit"), _T("Exit program")); wxMenu *help_menu = new wxMenu; - help_menu->Append(WXPRINT_ABOUT, "&About", "About this demo"); + help_menu->Append(WXPRINT_ABOUT, _T("&About"), _T("About this demo")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -135,7 +135,7 @@ bool MyApp::OnInit(void) frame->Centre(wxBOTH); frame->Show(TRUE); - frame->SetStatusText("Printing demo"); + frame->SetStatusText(_T("Printing demo")); SetTopWindow(frame); @@ -182,13 +182,13 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event)) wxPrintDialogData printDialogData(* g_printData); wxPrinter printer(& printDialogData); - MyPrintout printout("My printout"); + MyPrintout printout(_T("My printout")); if (!printer.Print(this, &printout, TRUE)) { if (wxPrinter::GetLastError() == wxPRINTER_ERROR) - wxMessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wxOK); + wxMessageBox(_T("There was a problem printing.\nPerhaps your current printer is not set correctly?"), _T("Printing"), wxOK); else - wxMessageBox("You canceled printing", "Printing", wxOK); + wxMessageBox(_T("You canceled printing"), _T("Printing"), wxOK); } else { @@ -204,11 +204,11 @@ void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event)) if (!preview->Ok()) { delete preview; - wxMessageBox("There was a problem previewing.\nPerhaps your current printer is not set correctly?", "Previewing", wxOK); + wxMessageBox(_T("There was a problem previewing.\nPerhaps your current printer is not set correctly?"), _T("Previewing"), wxOK); return; } - wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview", wxPoint(100, 100), wxSize(600, 650)); + wxPreviewFrame *frame = new wxPreviewFrame(preview, this, _T("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650)); frame->Centre(wxBOTH); frame->Initialize(); frame->Show(TRUE); @@ -240,7 +240,7 @@ void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event)) { wxPostScriptPrinter printer(g_printData); - MyPrintout printout("My printout"); + MyPrintout printout(_T("My printout")); printer.Print(this, &printout, TRUE); (*g_printData) = printer.GetPrintData(); @@ -251,7 +251,7 @@ void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event)) // Pass two printout objects: for preview, and possible printing. wxPrintDialogData printDialogData(* g_printData); wxPrintPreview *preview = new wxPrintPreview(new MyPrintout, new MyPrintout, & printDialogData); - wxPreviewFrame *frame = new wxPreviewFrame(preview, this, "Demo Print Preview", wxPoint(100, 100), wxSize(600, 650)); + wxPreviewFrame *frame = new wxPreviewFrame(preview, this, _T("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650)); frame->Centre(wxBOTH); frame->Initialize(); frame->Show(TRUE); @@ -283,8 +283,8 @@ void MyFrame::OnPageSetupPS(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPrintAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("wxWindows printing demo\nAuthor: Julian Smart", - "About wxWindows printing demo", wxOK|wxCENTRE); + (void)wxMessageBox(_T("wxWindows printing demo\nAuthor: Julian Smart"), + _T("About wxWindows printing demo"), wxOK|wxCENTRE); } void MyFrame::Draw(wxDC& dc) @@ -488,7 +488,7 @@ void MyPrintout::DrawPageTwo(wxDC *dc) { // GetTextExtent demo: - wxString words[7] = {"This ", "is ", "GetTextExtent ", "testing ", "string. ", "Enjoy ", "it!"}; + wxString words[7] = {_T("This "), _T("is "), _T("GetTextExtent "), _T("testing "), _T("string. "), _T("Enjoy "), _T("it!")}; long w, h; long x = 200, y= 250; wxFont fnt(15, wxSWISS, wxNORMAL, wxNORMAL); @@ -503,7 +503,7 @@ void MyPrintout::DrawPageTwo(wxDC *dc) dc->SetFont(* wxGetApp().m_testFont); } - dc->DrawText("Some test text", 200, 300 ); + dc->DrawText(_T("Some test text"), 200, 300 ); // TESTING @@ -526,11 +526,11 @@ void MyPrintout::DrawPageTwo(wxDC *dc) dc->DrawLine( (long)leftMarginLogical, (long)bottomMarginLogical, (long)rightMarginLogical, (long)bottomMarginLogical); - WritePageHeader(this, dc, "A header", logUnitsFactor); + WritePageHeader(this, dc, _T("A header"), logUnitsFactor); } // Writes a header on a page. Margin units are in millimetres. -bool WritePageHeader(wxPrintout *printout, wxDC *dc, char *text, float mmToLogical) +bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical) { /* static wxFont *headerFont = (wxFont *) NULL; diff --git a/samples/printing/printing.h b/samples/printing/printing.h index 927676794c..46276c2428 100644 --- a/samples/printing/printing.h +++ b/samples/printing/printing.h @@ -70,7 +70,7 @@ DECLARE_EVENT_TABLE() class MyPrintout: public wxPrintout { public: - MyPrintout(char *title = "My printout"):wxPrintout(title) {} + MyPrintout(wxChar *title = _T("My printout")):wxPrintout(title) {} bool OnPrintPage(int page); bool HasPage(int page); bool OnBeginDocument(int startPage, int endPage); diff --git a/samples/proplist/proplist.cpp b/samples/proplist/proplist.cpp index b64a165092..8c04d7d35c 100644 --- a/samples/proplist/proplist.cpp +++ b/samples/proplist/proplist.cpp @@ -47,25 +47,25 @@ bool MyApp::OnInit(void) RegisterValidators(); // Create the main frame window - m_mainFrame = new MyFrame(NULL, "wxPropertySheet Demo", wxPoint(0, 0), wxSize(300, 400), wxDEFAULT_FRAME_STYLE); + m_mainFrame = new MyFrame(NULL, _T("wxPropertySheet Demo"), wxPoint(0, 0), wxSize(300, 400), wxDEFAULT_FRAME_STYLE); // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(PROPERTY_TEST_DIALOG_LIST, "Test property list &dialog..."); - file_menu->Append(PROPERTY_TEST_FRAME_LIST, "Test property list &frame..."); + file_menu->Append(PROPERTY_TEST_DIALOG_LIST, _T("Test property list &dialog...")); + file_menu->Append(PROPERTY_TEST_FRAME_LIST, _T("Test property list &frame...")); file_menu->AppendSeparator(); - file_menu->Append(PROPERTY_TEST_DIALOG_FORM, "Test property form d&ialog..."); - file_menu->Append(PROPERTY_TEST_FRAME_FORM, "Test property form f&rame..."); + file_menu->Append(PROPERTY_TEST_DIALOG_FORM, _T("Test property form d&ialog...")); + file_menu->Append(PROPERTY_TEST_FRAME_FORM, _T("Test property form f&rame...")); file_menu->AppendSeparator(); - file_menu->Append(PROPERTY_QUIT, "E&xit"); + file_menu->Append(PROPERTY_QUIT, _T("E&xit")); wxMenu *help_menu = new wxMenu; - help_menu->Append(PROPERTY_ABOUT, "&About"); + help_menu->Append(PROPERTY_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame m_mainFrame->SetMenuBar(menu_bar); @@ -133,21 +133,21 @@ void MyFrame::OnFrameForm(wxCommandEvent& event) void MyFrame::OnAbout(wxCommandEvent& event) { - (void)wxMessageBox("Property Classes Demo\nAuthor: Julian Smart", "About Property Classes Test"); + (void)wxMessageBox(_T("Property Classes Demo\nAuthor: Julian Smart"), _T("About Property Classes Test")); } void MyApp::RegisterValidators(void) { - myListValidatorRegistry.RegisterValidator((wxString)"real", new wxRealListValidator); - myListValidatorRegistry.RegisterValidator((wxString)"string", new wxStringListValidator); - myListValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerListValidator); - myListValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolListValidator); - myListValidatorRegistry.RegisterValidator((wxString)"stringlist", new wxListOfStringsListValidator); - - myFormValidatorRegistry.RegisterValidator((wxString)"real", new wxRealFormValidator); - myFormValidatorRegistry.RegisterValidator((wxString)"string", new wxStringFormValidator); - myFormValidatorRegistry.RegisterValidator((wxString)"integer", new wxIntegerFormValidator); - myFormValidatorRegistry.RegisterValidator((wxString)"bool", new wxBoolFormValidator); + myListValidatorRegistry.RegisterValidator((wxString)_T("real"), new wxRealListValidator); + myListValidatorRegistry.RegisterValidator((wxString)_T("string"), new wxStringListValidator); + myListValidatorRegistry.RegisterValidator((wxString)_T("integer"), new wxIntegerListValidator); + myListValidatorRegistry.RegisterValidator((wxString)_T("bool"), new wxBoolListValidator); + myListValidatorRegistry.RegisterValidator((wxString)_T("stringlist"), new wxListOfStringsListValidator); + + myFormValidatorRegistry.RegisterValidator((wxString)_T("real"), new wxRealFormValidator); + myFormValidatorRegistry.RegisterValidator((wxString)_T("string"), new wxStringFormValidator); + myFormValidatorRegistry.RegisterValidator((wxString)_T("integer"), new wxIntegerFormValidator); + myFormValidatorRegistry.RegisterValidator((wxString)_T("bool"), new wxBoolFormValidator); } void MyApp::PropertyListTest(bool useDialog) @@ -157,17 +157,17 @@ void MyApp::PropertyListTest(bool useDialog) wxPropertySheet *sheet = new wxPropertySheet; - sheet->AddProperty(new wxProperty("fred", 1.0, "real")); - sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool")); - sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerListValidator(-50, 50))); - sheet->AddProperty(new wxProperty("bill", 25.0, "real", new wxRealListValidator(0.0, 100.0))); - sheet->AddProperty(new wxProperty("julian", "one", "string")); - sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp"))); + sheet->AddProperty(new wxProperty(_T("fred"), 1.0, _T("real"))); + sheet->AddProperty(new wxProperty(_T("tough choice"), (bool)TRUE, _T("bool"))); + sheet->AddProperty(new wxProperty(_T("ian"), (long)45, _T("integer"), new wxIntegerListValidator(-50, 50))); + sheet->AddProperty(new wxProperty(_T("bill"), 25.0, _T("real"), new wxRealListValidator(0.0, 100.0))); + sheet->AddProperty(new wxProperty(_T("julian"), _T("one"), _T("string"))); + sheet->AddProperty(new wxProperty(_T("bitmap"), _T("none"), _T("string"), new wxFilenameListValidator(_T("Select a bitmap file"), _T("*.bmp")))); wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL); - sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings))); + sheet->AddProperty(new wxProperty(_T("constrained"), _T("one"), _T("string"), new wxStringListValidator(strings))); wxStringList *strings2 = new wxStringList(wxT("earth"), wxT("fire"), wxT("wind"), wxT("water"), NULL); - sheet->AddProperty(new wxProperty("string list", strings2, "stringlist")); + sheet->AddProperty(new wxProperty(_T("string list"), strings2, _T("stringlist"))); wxPropertyListView *view = new wxPropertyListView ( @@ -180,13 +180,13 @@ void MyApp::PropertyListTest(bool useDialog) wxPropertyListFrame *propFrame = NULL; if (useDialog) { - propDialog = new PropListDialog(view, NULL, "Property Sheet Test", + propDialog = new PropListDialog(view, NULL, _T("Property Sheet Test"), wxPoint(-1, -1), wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS); m_childWindow = propDialog; } else { - propFrame = new PropListFrame(view, NULL, "Property Sheet Test", wxPoint(-1, -1), wxSize(400, 500)); + propFrame = new PropListFrame(view, NULL, _T("Property Sheet Test"), wxPoint(-1, -1), wxSize(400, 500)); m_childWindow = propFrame; } @@ -215,12 +215,12 @@ void MyApp::PropertyFormTest(bool useDialog) wxPropertySheet *sheet = new wxPropertySheet; - sheet->AddProperty(new wxProperty("fred", 25.0, "real", new wxRealFormValidator(0.0, 100.0))); - sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool")); - sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerFormValidator(-50, 50))); - sheet->AddProperty(new wxProperty("julian", "one", "string")); + sheet->AddProperty(new wxProperty(_T("fred"), 25.0, _T("real"), new wxRealFormValidator(0.0, 100.0))); + sheet->AddProperty(new wxProperty(_T("tough choice"), (bool)TRUE, _T("bool"))); + sheet->AddProperty(new wxProperty(_T("ian"), (long)45, _T("integer"), new wxIntegerFormValidator(-50, 50))); + sheet->AddProperty(new wxProperty(_T("julian"), _T("one"), _T("string"))); wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL); - sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings))); + sheet->AddProperty(new wxProperty(_T("constrained"), _T("one"), _T("string"), new wxStringFormValidator(strings))); wxPropertyFormView *view = new wxPropertyFormView(NULL); @@ -229,13 +229,13 @@ void MyApp::PropertyFormTest(bool useDialog) if (useDialog) { - propDialog = new PropFormDialog(view, NULL, "Property Form Test", + propDialog = new PropFormDialog(view, NULL, _T("Property Form Test"), wxPoint(-1, -1), wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL); m_childWindow = propDialog; } else { - propFrame = new PropFormFrame(view, NULL, "Property Form Test", + propFrame = new PropFormFrame(view, NULL, _T("Property Form Test"), wxPoint(-1, -1), wxSize(380, 250)); propFrame->Initialize(); m_childWindow = propFrame; @@ -268,14 +268,14 @@ void MyApp::PropertyFormTest(bool useDialog) #endif // Add items to the panel - wxButton *okButton = new wxButton(panel, wxID_OK, "OK", wxPoint(-1, -1), - wxSize(80, 26), 0, wxDefaultValidator, "ok"); - wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, "Cancel", wxPoint(-1, -1), - wxSize(80, 26), 0, wxDefaultValidator, "cancel"); - wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, "Update", wxPoint(-1, -1), - wxSize(80, 26), 0, wxDefaultValidator, "update"); - wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, "Revert", wxPoint(-1, -1), - wxSize(80, 26), 0, wxDefaultValidator, "revert"); + wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxPoint(-1, -1), + wxSize(80, 26), 0, wxDefaultValidator, _T("ok")); + wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, _T("Cancel"), wxPoint(-1, -1), + wxSize(80, 26), 0, wxDefaultValidator, _T("cancel")); + wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, _T("Update"), wxPoint(-1, -1), + wxSize(80, 26), 0, wxDefaultValidator, _T("update")); + wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, _T("Revert"), wxPoint(-1, -1), + wxSize(80, 26), 0, wxDefaultValidator, _T("revert")); c = new wxLayoutConstraints; c->right.SameAs(panel, wxRight, 4); @@ -306,8 +306,8 @@ void MyApp::PropertyFormTest(bool useDialog) okButton->SetConstraints(c); // The name of this text item matches the "fred" property - wxTextCtrl *text = new wxTextCtrl(panel, -1, "Fred", wxPoint(-1, -1), wxSize( - 200, -1), 0, wxDefaultValidator, "fred"); + wxTextCtrl *text = new wxTextCtrl(panel, -1, _T("Fred"), wxPoint(-1, -1), wxSize( + 200, -1), 0, wxDefaultValidator, _T("fred")); c = new wxLayoutConstraints; c->left.SameAs(panel, wxLeft, 4); @@ -316,8 +316,8 @@ void MyApp::PropertyFormTest(bool useDialog) c->width.AsIs(); text->SetConstraints(c); - wxCheckBox *checkBox = new wxCheckBox(panel, -1, "Yes or no", wxPoint(-1, -1), - wxSize(-1, -1), 0, wxDefaultValidator, "tough choice"); + wxCheckBox *checkBox = new wxCheckBox(panel, -1, _T("Yes or no"), wxPoint(-1, -1), + wxSize(-1, -1), 0, wxDefaultValidator, _T("tough choice")); c = new wxLayoutConstraints; c->left.SameAs(text, wxRight, 20); @@ -327,7 +327,7 @@ void MyApp::PropertyFormTest(bool useDialog) checkBox->SetConstraints(c); wxSlider *slider = new wxSlider(panel, -1, -50, 50, 150, wxPoint(-1, -1), - wxSize(200,10), 0, wxDefaultValidator, "ian"); + wxSize(200,10), 0, wxDefaultValidator, _T("ian")); c = new wxLayoutConstraints; c->left.SameAs(panel, wxLeft, 4); @@ -337,7 +337,7 @@ void MyApp::PropertyFormTest(bool useDialog) slider->SetConstraints(c); wxListBox *listBox = new wxListBox(panel, -1, wxPoint(-1, -1), - wxSize(200, 100), 0, NULL, 0, wxDefaultValidator, "constrained"); + wxSize(200, 100), 0, NULL, 0, wxDefaultValidator, _T("constrained")); c = new wxLayoutConstraints; c->left.SameAs(panel, wxLeft, 4); diff --git a/samples/proplist/proplist.h b/samples/proplist/proplist.h index a277b1c85f..f984f05655 100644 --- a/samples/proplist/proplist.h +++ b/samples/proplist/proplist.h @@ -61,7 +61,7 @@ class PropListFrame: public wxPropertyListFrame public: PropListFrame(wxPropertyListView *v, wxFrame *parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"): + long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")): wxPropertyListFrame(v, parent, title, pos, size, style, name) { } @@ -76,7 +76,7 @@ class PropListDialog: public wxPropertyListDialog public: PropListDialog(wxPropertyListView *v, wxWindow *parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox"): + long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = _T("dialogBox")): wxPropertyListDialog(v, parent, title, pos, size, style, name) { } @@ -91,7 +91,7 @@ class PropFormFrame: public wxPropertyFormFrame public: PropFormFrame(wxPropertyFormView *v, wxFrame *parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame"): + long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")): wxPropertyFormFrame(v, parent, title, pos, size, style, name) { } @@ -107,7 +107,7 @@ class PropFormDialog: public wxPropertyFormDialog public: PropFormDialog(wxPropertyFormView *v, wxWindow *parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox"): + long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = _T("dialogBox")): wxPropertyFormDialog(v, parent, title, pos, size, style, name) { } diff --git a/samples/propsize/propsize.cpp b/samples/propsize/propsize.cpp index d17a0e57f5..ac01949d32 100644 --- a/samples/propsize/propsize.cpp +++ b/samples/propsize/propsize.cpp @@ -119,7 +119,7 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { // Create the main application window - MyFrame *frame = new MyFrame("Proportional resize", + MyFrame *frame = new MyFrame(_T("Proportional resize"), wxPoint(50, 50), wxSize(450, 340)); // Show it and tell the application that it's our main window @@ -145,15 +145,15 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) SetIcon(wxICON(mondrian)); // create a menu bar - wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); + wxMenu *menuFile = new wxMenu(_T(""), wxMENU_TEAROFF); - menuFile->Append(wxID_ABOUT, "&About...\tCtrl-A", "Show about dialog"); + menuFile->Append(wxID_ABOUT, _T("&About...\tCtrl-A"), _T("Show about dialog")); menuFile->AppendSeparator(); - menuFile->Append(Minimal_Quit, "E&xit\tAlt-X", "Quit this program"); + menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, "&File"); + menuBar->Append(menuFile, _T("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -161,7 +161,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(1); - SetStatusText("Resize the frame to see how controls react"); + SetStatusText(_T("Resize the frame to see how controls react")); #endif // wxUSE_STATUSBAR #define AddLine(orient) \ @@ -175,42 +175,42 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); // top row -- top-aligned wxBoxSizer *hsizer1 = new wxBoxSizer( wxHORIZONTAL ); - hsizer1->AddButton( "one", wxALIGN_LEFT | wxALIGN_TOP); + hsizer1->AddButton( _T("one"), wxALIGN_LEFT | wxALIGN_TOP); hsizer1->AddLine(wxVERTICAL); - hsizer1->AddButton( "two", wxALIGN_CENTER_HORIZONTAL | wxALIGN_TOP); + hsizer1->AddButton( _T("two"), wxALIGN_CENTER_HORIZONTAL | wxALIGN_TOP); hsizer1->AddLine(wxVERTICAL); - hsizer1->AddButton( "three", wxALIGN_RIGHT | wxALIGN_TOP); + hsizer1->AddButton( _T("three"), wxALIGN_RIGHT | wxALIGN_TOP); topsizer->Add(hsizer1, 1, wxEXPAND); topsizer->AddLine(wxHORIZONTAL); wxBoxSizer *hsizer2 = new wxBoxSizer( wxHORIZONTAL ); - hsizer2->AddButton( "four", wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + hsizer2->AddButton( _T("four"), wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); hsizer2->AddLine(wxVERTICAL); // sizer that preserves it's shape wxBoxSizer *vsizer = new wxBoxSizer( wxVERTICAL ); vsizer->Add( - new wxButton( this, -1, "up", wxDefaultPosition, wxSize(100,25) ), + new wxButton( this, -1, _T("up"), wxDefaultPosition, wxSize(100,25) ), 1, wxEXPAND); vsizer->Add( - new wxButton( this, -1, "down", wxDefaultPosition, wxSize(100,25) ), + new wxButton( this, -1, _T("down"), wxDefaultPosition, wxSize(100,25) ), 1, wxEXPAND); hsizer2->Add(vsizer, 1, wxSHAPED | wxALIGN_CENTER); hsizer2->AddLine(wxVERTICAL); - hsizer2->AddButton( "six", wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + hsizer2->AddButton( _T("six"), wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); topsizer->Add(hsizer2, 1, wxEXPAND); topsizer->AddLine(wxHORIZONTAL); wxBoxSizer *hsizer3 = new wxBoxSizer( wxHORIZONTAL ); - hsizer3->AddButton( "seven", wxALIGN_LEFT | wxALIGN_BOTTOM); + hsizer3->AddButton( _T("seven"), wxALIGN_LEFT | wxALIGN_BOTTOM); hsizer3->AddLine(wxVERTICAL); - hsizer3->AddButton( "eight", wxALIGN_CENTER_HORIZONTAL | wxALIGN_BOTTOM); + hsizer3->AddButton( _T("eight"), wxALIGN_CENTER_HORIZONTAL | wxALIGN_BOTTOM); hsizer3->AddLine(wxVERTICAL); // wxEXPAND should have no effect - hsizer3->AddButton( "nine", wxEXPAND | wxALIGN_RIGHT | wxALIGN_BOTTOM); + hsizer3->AddButton( _T("nine"), wxEXPAND | wxALIGN_RIGHT | wxALIGN_BOTTOM); topsizer->Add(hsizer3, 1, wxEXPAND); @@ -246,5 +246,5 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) #endif // wxBETA_NUMBER ); - wxMessageBox(msg, "About Shaped Sizer", wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, _T("About Shaped Sizer"), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index 4510d71fc0..9e4c080e48 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -172,7 +172,7 @@ class RegFrame : public wxFrame { public: // ctor & dtor - RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h); + RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h); virtual ~RegFrame(); // callbacks @@ -273,23 +273,23 @@ END_EVENT_TABLE() wxMenu *CreateRegistryMenu() { wxMenu *pMenuNew = new wxMenu; - pMenuNew->Append(Menu_NewKey, "&Key", "Create a new key"); + pMenuNew->Append(Menu_NewKey, _T("&Key"), _T("Create a new key")); pMenuNew->AppendSeparator(); - pMenuNew->Append(Menu_NewText, "&Text value", "Create a new text value"); - pMenuNew->Append(Menu_NewBinary, "&Binary value", "Create a new binary value"); + pMenuNew->Append(Menu_NewText, _T("&Text value"), _T("Create a new text value")); + pMenuNew->Append(Menu_NewBinary, _T("&Binary value"), _T("Create a new binary value")); wxMenu *pMenuReg = new wxMenu; - pMenuReg->Append(Menu_New, "&New", pMenuNew); - pMenuReg->Append(Menu_Delete, "&Delete...", "Delete selected key/value"); + pMenuReg->Append(Menu_New, _T("&New"), pMenuNew); + pMenuReg->Append(Menu_Delete, _T("&Delete..."), _T("Delete selected key/value")); pMenuReg->AppendSeparator(); - pMenuReg->Append(Menu_GoTo, "&Go to...\tCtrl-G", "Go to registry key"); - pMenuReg->Append(Menu_Expand, "&Expand", "Expand current key"); - pMenuReg->Append(Menu_Collapse, "&Collapse", "Collapse current key"); - pMenuReg->Append(Menu_Toggle, "&Toggle", "Toggle current key"); + pMenuReg->Append(Menu_GoTo, _T("&Go to...\tCtrl-G"), _T("Go to registry key")); + pMenuReg->Append(Menu_Expand, _T("&Expand"), _T("Expand current key")); + pMenuReg->Append(Menu_Collapse, _T("&Collapse"), _T("Collapse current key")); + pMenuReg->Append(Menu_Toggle, _T("&Toggle"), _T("Toggle current key")); pMenuReg->AppendSeparator(); - pMenuReg->Append(Menu_Refresh, "&Refresh", "Refresh the subtree"); + pMenuReg->Append(Menu_Refresh, _T("&Refresh"), _T("Refresh the subtree")); pMenuReg->AppendSeparator(); - pMenuReg->Append(Menu_Info, "&Properties","Information about current selection"); + pMenuReg->Append(Menu_Info, _T("&Properties"),_T("Information about current selection")); return pMenuReg; } @@ -303,7 +303,7 @@ IMPLEMENT_APP(RegApp) bool RegApp::OnInit() { // create the main frame window and show it - RegFrame *frame = new RegFrame(NULL, "wxRegTest", 50, 50, 600, 350); + RegFrame *frame = new RegFrame(NULL, _T("wxRegTest"), 50, 50, 600, 350); frame->Show(TRUE); SetTopWindow(frame); @@ -315,7 +315,7 @@ bool RegApp::OnInit() // RegFrame // ---------------------------------------------------------------------------- -RegFrame::RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h) +RegFrame::RegFrame(wxFrame *parent, wxChar *title, int x, int y, int w, int h) : wxFrame(parent, -1, title, wxPoint(x, y), wxSize(w, h)) { // this reduces flicker effects @@ -323,20 +323,20 @@ RegFrame::RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h) // set the icon // ------------ - SetIcon(wxIcon("app_icon")); + SetIcon(wxIcon(_T("app_icon"))); // create menu // ----------- wxMenu *pMenuFile = new wxMenu; - pMenuFile->Append(Menu_Test, "Te&st", "Test key creation"); + pMenuFile->Append(Menu_Test, _T("Te&st"), _T("Test key creation")); pMenuFile->AppendSeparator(); - pMenuFile->Append(Menu_About, "&About...", "Show an extraordinarly beautiful dialog"); + pMenuFile->Append(Menu_About, _T("&About..."), _T("Show an extraordinarly beautiful dialog")); pMenuFile->AppendSeparator(); - pMenuFile->Append(Menu_Quit, "E&xit", "Quit this program"); + pMenuFile->Append(Menu_Quit, _T("E&xit"), _T("Quit this program")); wxMenuBar *pMenu = new wxMenuBar; - pMenu->Append(pMenuFile, "&File"); - pMenu->Append(CreateRegistryMenu(), "&Registry"); + pMenu->Append(pMenuFile, _T("&File")); + pMenu->Append(CreateRegistryMenu(), _T("&Registry")); SetMenuBar(pMenu); // create child controls @@ -362,9 +362,9 @@ void RegFrame::OnQuit(wxCommandEvent& event) void RegFrame::OnAbout(wxCommandEvent& event) { wxMessageDialog dialog(this, - "wxRegistry sample\n" - "© 1998, 2000 Vadim Zeitlin", - "About wxRegTest", wxOK); + _T("wxRegistry sample\n") + _T("© 1998, 2000 Vadim Zeitlin"), + _T("About wxRegTest"), wxOK); dialog.ShowModal(); } @@ -421,7 +421,7 @@ void RegFrame::OnNewKey(wxCommandEvent& WXUNUSED(event)) { if ( m_treeCtrl->IsKeySelected() ) { m_treeCtrl->CreateNewKey( - wxGetTextFromUser("Enter the name of the new key")); + wxGetTextFromUser(_T("Enter the name of the new key"))); } } @@ -429,7 +429,7 @@ void RegFrame::OnNewText(wxCommandEvent& WXUNUSED(event)) { if ( m_treeCtrl->IsKeySelected() ) { m_treeCtrl->CreateNewTextValue( - wxGetTextFromUser("Enter the name for the new text value")); + wxGetTextFromUser(_T("Enter the name for the new text value"))); } } @@ -437,7 +437,7 @@ void RegFrame::OnNewBinary(wxCommandEvent& WXUNUSED(event)) { if ( m_treeCtrl->IsKeySelected() ) { m_treeCtrl->CreateNewBinaryValue( - wxGetTextFromUser("Enter the name for the new binary value")); + wxGetTextFromUser(_T("Enter the name for the new binary value"))); } } @@ -452,8 +452,8 @@ void RegFrame::OnInfo(wxCommandEvent& WXUNUSED(event)) RegImageList::RegImageList() : wxImageList(16, 16, TRUE) { // should be in sync with enum RegImageList::RegIcon - static const char *aszIcons[] = { "key1","key2","key3","value1","value2" }; - wxString str = "icon_"; + static const wxChar *aszIcons[] = { _T("key1"),_T("key2"),_T("key3"),_T("value1"),_T("value2") }; + wxString str = _T("icon_"); for ( unsigned int n = 0; n < WXSIZEOF(aszIcons); n++ ) { Add(wxIcon(str + aszIcons[n], wxBITMAP_TYPE_ICO_RESOURCE)); } @@ -519,7 +519,7 @@ RegTreeCtrl::RegTreeCtrl(wxWindow *parent, wxWindowID id) // create root keys // ---------------- - m_pRoot = InsertNewTreeNode(NULL, "Registry Root", RegImageList::Root); + m_pRoot = InsertNewTreeNode(NULL, _T("Registry Root"), RegImageList::Root); // create popup menu // ----------------- @@ -590,14 +590,14 @@ void RegTreeCtrl::OnMenuTest() return; } - wxRegKey key1(pNode->Key(), "key1"); + wxRegKey key1(pNode->Key(), _T("key1")); if ( key1.Create() ) { - wxRegKey key2a(key1, "key2a"), key2b(key1, "key2b"); + wxRegKey key2a(key1, _T("key2a")), key2b(key1, _T("key2b")); if ( key2a.Create() && key2b.Create() ) { // put some values under the newly created keys - key1.SetValue(wxT("first_term"), "10"); - key1.SetValue(wxT("second_term"), "7"); - key2a = "this is the unnamed value"; + key1.SetValue(wxT("first_term"), _T("10")); + key1.SetValue(wxT("second_term"), _T("7")); + key2a = _T("this is the unnamed value"); key2b.SetValue(wxT("sum"), 17); // refresh tree @@ -760,8 +760,8 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event) nameDst << wxString(dst->FullName()).AfterFirst('\\') << '\\' << wxString(src->FullName()).AfterLast('\\'); - wxString verb = m_copyOnDrop ? "copy" : "move"; - wxString what = isKey ? "key" : "value"; + wxString verb = m_copyOnDrop ? _T("copy") : _T("move"); + wxString what = isKey ? _T("key") : _T("value"); if ( wxMessageBox(wxString::Format ( @@ -771,7 +771,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event) nameSrc.c_str(), nameDst.c_str() ), - "RegTest Confirm", + _T("RegTest Confirm"), wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) { return; } @@ -868,10 +868,10 @@ bool RegTreeCtrl::TreeNode::OnExpand() while ( bCont ) { wxString strItem; if (str.IsEmpty()) - strItem = ""; + strItem = _T(""); else strItem = str; - strItem += " = "; + strItem += _T(" = "); // determine the appropriate icon RegImageList::Icon icon; @@ -1088,13 +1088,13 @@ void RegTreeCtrl::DeleteSelected() return; } - wxString what = pCurrent->IsKey() ? "key" : "value"; + wxString what = pCurrent->IsKey() ? _T("key") : _T("value"); if ( wxMessageBox(wxString::Format ( wxT("Do you really want to delete this %s?"), what.c_str() ), - "Confirmation", + _T("Confirmation"), wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) { return; } @@ -1135,7 +1135,7 @@ void RegTreeCtrl::CreateNewTextValue(const wxString& strName) return; } - if ( pCurrent->Key().SetValue(strName, "") ) + if ( pCurrent->Key().SetValue(strName, _T("")) ) pCurrent->Refresh(); } diff --git a/samples/rotate/rotate.cpp b/samples/rotate/rotate.cpp index 2f26cf2a7e..c7eacc7ef7 100644 --- a/samples/rotate/rotate.cpp +++ b/samples/rotate/rotate.cpp @@ -89,7 +89,7 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { - m_image = wxImage("kclub.bmp", wxBITMAP_TYPE_BMP); + m_image = wxImage(_T("kclub.bmp"), wxBITMAP_TYPE_BMP); // any unused colour will do m_image.SetMaskColour( 0, 255, 255 ); @@ -101,7 +101,7 @@ bool MyApp::OnInit() return FALSE; } - MyFrame *frame = new MyFrame ("wxWindows rotate sample", + MyFrame *frame = new MyFrame (_T("wxWindows rotate sample"), wxPoint(20,20), wxSize(600,450)); frame->Show (TRUE); @@ -117,12 +117,12 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) new MyCanvas(this); wxMenu *menuFile = new wxMenu; - menuFile->Append (ID_Angle, "Set &angle\tCtrl-A"); + menuFile->Append (ID_Angle, _T("Set &angle\tCtrl-A")); menuFile->AppendSeparator(); - menuFile->Append (ID_Quit, "E&xit\tAlt-X"); + menuFile->Append (ID_Quit, _T("E&xit\tAlt-X")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append (menuFile, "&File"); + menuBar->Append (menuFile, _T("&File")); SetMenuBar (menuBar); } @@ -130,9 +130,9 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) void MyFrame::OnAngle (wxCommandEvent &) { long degrees = (long)((180*m_angle)/M_PI); - degrees = wxGetNumberFromUser("Change the image rotation angle", - "Angle in degrees:", - "wxWindows rotate sample", + degrees = wxGetNumberFromUser(_T("Change the image rotation angle"), + _T("Angle in degrees:"), + _T("wxWindows rotate sample"), degrees, -180, +180, this); diff --git a/samples/sashtest/sashtest.cpp b/samples/sashtest/sashtest.cpp index f59fae02a0..d30052d896 100644 --- a/samples/sashtest/sashtest.cpp +++ b/samples/sashtest/sashtest.cpp @@ -42,33 +42,33 @@ bool MyApp::OnInit(void) { // Create the main frame window - frame = new MyFrame(NULL, -1, "Sash Demo", wxPoint(0, 0), wxSize(500, 400), + frame = new MyFrame(NULL, -1, _T("Sash Demo"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE | wxHSCROLL | wxVSCROLL); // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - frame->SetIcon(wxIcon("sashtest_icn")); + frame->SetIcon(wxIcon(_T("sashtest_icn"))); #endif #ifdef __X__ - frame->SetIcon(wxIcon("sashtest.xbm")); + frame->SetIcon(wxIcon(_T("sashtest.xbm"))); #endif // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(SASHTEST_NEW_WINDOW, "&New window"); - file_menu->Append(SASHTEST_TOGGLE_WINDOW, "&Toggle window"); - file_menu->Append(SASHTEST_QUIT, "&Exit"); + file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window")); + file_menu->Append(SASHTEST_TOGGLE_WINDOW, _T("&Toggle window")); + file_menu->Append(SASHTEST_QUIT, _T("&Exit")); wxMenu *help_menu = new wxMenu; - help_menu->Append(SASHTEST_ABOUT, "&About"); + help_menu->Append(SASHTEST_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -136,10 +136,10 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c win->SetSashVisible(wxSASH_RIGHT, TRUE); win->SetExtraBorderSize(10); - wxTextCtrl* textWindow = new wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize, + wxTextCtrl* textWindow = new wxTextCtrl(win, -1, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxSUNKEN_BORDER); // wxTE_MULTILINE|wxNO_BORDER); - textWindow->SetValue("A help window"); + textWindow->SetValue(_T("A help window")); m_leftWindow1 = win; @@ -163,7 +163,7 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("wxWindows 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998", "About Sash Demo"); + (void)wxMessageBox(_T("wxWindows 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998"), _T("About Sash Demo")); } void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event)) @@ -218,19 +218,17 @@ void MyFrame::OnSashDrag(wxSashEvent& event) void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) { // Make another frame, containing a canvas - MyChild *subframe = new MyChild(frame, "Canvas Frame", + MyChild *subframe = new MyChild(frame, _T("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); - char titleBuf[100]; - sprintf(titleBuf, "Canvas Frame %d", winNumber); - subframe->SetTitle(titleBuf); + subframe->SetTitle(wxString::Format(_T("Canvas Frame %d"), winNumber)); winNumber ++; // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - subframe->SetIcon(wxIcon("sashtest_icn")); + subframe->SetIcon(wxIcon(_T("sashtest_icn"))); #endif // Give it a status line @@ -239,23 +237,23 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(SASHTEST_NEW_WINDOW, "&New window"); - file_menu->Append(SASHTEST_CHILD_QUIT, "&Close child"); - file_menu->Append(SASHTEST_QUIT, "&Exit"); + file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window")); + file_menu->Append(SASHTEST_CHILD_QUIT, _T("&Close child")); + file_menu->Append(SASHTEST_QUIT, _T("&Exit")); wxMenu *option_menu = new wxMenu; // Dummy option - option_menu->Append(SASHTEST_REFRESH, "&Refresh picture"); + option_menu->Append(SASHTEST_REFRESH, _T("&Refresh picture")); wxMenu *help_menu = new wxMenu; - help_menu->Append(SASHTEST_ABOUT, "&About"); + help_menu->Append(SASHTEST_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); - menu_bar->Append(option_menu, "&Options"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(option_menu, _T("&Options")); + menu_bar->Append(help_menu, _T("&Help")); // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); @@ -302,7 +300,7 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawSpline(50, 200, 50, 100, 200, 10); #endif // wxUSE_SPLINES dc.DrawLine(50, 230, 200, 230); - dc.DrawText("This is a test string", 50, 230); + dc.DrawText(_T("This is a test string"), 50, 230); wxPoint points[3]; points[0].x = 200; points[0].y = 300; diff --git a/samples/scrollsub/scrollsub.cpp b/samples/scrollsub/scrollsub.cpp index cc8d3acc7e..371c4f97a5 100644 --- a/samples/scrollsub/scrollsub.cpp +++ b/samples/scrollsub/scrollsub.cpp @@ -144,7 +144,7 @@ END_EVENT_TABLE() MyScrolledWindow::MyScrolledWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size ) - : wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER, "test canvas" ) + : wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER, _T("test canvas") ) { MyTopLabels *top = new MyTopLabels( this, -1, wxDefaultPosition, wxSize(-1,25) ); MyRightLabels *right = new MyRightLabels( this, -1, wxDefaultPosition, wxSize(60,-1) ); @@ -222,9 +222,9 @@ void MyTopLabels::OnPaint( wxPaintEvent &event ) m_owner->GetScrollPixelsPerUnit( &xScrollUnits, 0 ); dc.SetDeviceOrigin( -xOrigin * xScrollUnits, 0 ); - dc.DrawText( "Column 1", 5, 5 ); - dc.DrawText( "Column 2", 105, 5 ); - dc.DrawText( "Column 3", 205, 5 ); + dc.DrawText( _T("Column 1"), 5, 5 ); + dc.DrawText( _T("Column 2"), 105, 5 ); + dc.DrawText( _T("Column 3"), 205, 5 ); } // MyRightLabels @@ -256,12 +256,12 @@ void MyRightLabels::OnPaint( wxPaintEvent &event ) m_owner->GetScrollPixelsPerUnit( 0, &yScrollUnits ); dc.SetDeviceOrigin( 0, -yOrigin * yScrollUnits ); - dc.DrawText( "Row 1", 5, 5 ); - dc.DrawText( "Row 2", 5, 30 ); - dc.DrawText( "Row 3", 5, 55 ); - dc.DrawText( "Row 4", 5, 80 ); - dc.DrawText( "Row 5", 5, 105 ); - dc.DrawText( "Row 6", 5, 130 ); + dc.DrawText( _T("Row 1"), 5, 5 ); + dc.DrawText( _T("Row 2"), 5, 30 ); + dc.DrawText( _T("Row 3"), 5, 55 ); + dc.DrawText( _T("Row 4"), 5, 80 ); + dc.DrawText( _T("Row 5"), 5, 105 ); + dc.DrawText( _T("Row 6"), 5, 130 ); } // MyCanvas @@ -274,20 +274,20 @@ END_EVENT_TABLE() MyCanvas::MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *right, wxWindowID id, const wxPoint &pos, const wxSize &size ) - : wxPanel( parent, id, pos, size, wxSUNKEN_BORDER, "test canvas" ) + : wxPanel( parent, id, pos, size, wxSUNKEN_BORDER, _T("test canvas") ) { m_owner = parent; m_topLabels = top; m_rightLabels = right; - (void)new wxButton( this, -1, "Hallo I", wxPoint(0,50), wxSize(100,25) ); - (void)new wxButton( this, -1, "Hallo II", wxPoint(200,50), wxSize(100,25) ); + (void)new wxButton( this, -1, _T("Hallo I"), wxPoint(0,50), wxSize(100,25) ); + (void)new wxButton( this, -1, _T("Hallo II"), wxPoint(200,50), wxSize(100,25) ); - (void)new wxTextCtrl( this, -1, "Text I", wxPoint(0,100), wxSize(100,25) ); - (void)new wxTextCtrl( this, -1, "Text II", wxPoint(200,100), wxSize(100,25) ); + (void)new wxTextCtrl( this, -1, _T("Text I"), wxPoint(0,100), wxSize(100,25) ); + (void)new wxTextCtrl( this, -1, _T("Text II"), wxPoint(200,100), wxSize(100,25) ); - (void)new wxComboBox( this, -1, "ComboBox I", wxPoint(0,150), wxSize(100,25), 0, NULL ); - (void)new wxComboBox( this, -1, "ComboBox II", wxPoint(200,150), wxSize(100,25), 0, NULL ); + (void)new wxComboBox( this, -1, _T("ComboBox I"), wxPoint(0,150), wxSize(100,25), 0, NULL ); + (void)new wxComboBox( this, -1, _T("ComboBox II"), wxPoint(200,150), wxSize(100,25), 0, NULL ); SetBackgroundColour( wxT("WHEAT") ); @@ -335,7 +335,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) { wxLogMessage( wxT("Redraw first cell") ); dc.DrawRectangle( 0, 0, 100, 25 ); - dc.DrawText( "First Cell", 5, 5 ); + dc.DrawText( _T("First Cell"), 5, 5 ); } } @@ -350,7 +350,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) { wxLogMessage( wxT("Redraw second cell") ); dc.DrawRectangle( 200, 0, 100, 25 ); - dc.DrawText( "Second Cell", 205, 5 ); + dc.DrawText( _T("Second Cell"), 205, 5 ); } } @@ -378,16 +378,16 @@ BEGIN_EVENT_TABLE(MyFrame,wxFrame) END_EVENT_TABLE() MyFrame::MyFrame() - : wxFrame( (wxFrame *)NULL, -1, "wxScrolledWindow sample", + : wxFrame( (wxFrame *)NULL, -1, _T("wxScrolledWindow sample"), wxPoint(20,20), wxSize(470,500) ) { wxMenu *file_menu = new wxMenu(); - file_menu->Append( ID_ABOUT, "&About..."); - file_menu->Append( ID_FULL, "&Full screen on/off"); - file_menu->Append( ID_QUIT, "E&xit\tAlt-X"); + file_menu->Append( ID_ABOUT, _T("&About...")); + file_menu->Append( ID_FULL, _T("&Full screen on/off")); + file_menu->Append( ID_QUIT, _T("E&xit\tAlt-X")); wxMenuBar *menu_bar = new wxMenuBar(); - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); SetMenuBar( menu_bar ); @@ -398,7 +398,7 @@ MyFrame::MyFrame() m_scrolled = new MyScrolledWindow( this, -1, wxDefaultPosition, wxSize(100,100) ); m_scrolled->SetScrollbars( 10, 10, 50, 100 ); - m_log = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,0), wxSize(100,100), wxTE_MULTILINE ); + m_log = new wxTextCtrl( this, -1, _T("This is the log window.\n"), wxPoint(0,0), wxSize(100,100), wxTE_MULTILINE ); wxLog *old_log = wxLog::SetActiveTarget( new wxLogTextCtrl( m_log ) ); delete old_log; @@ -422,9 +422,9 @@ void MyFrame::OnFullScreen( wxCommandEvent &WXUNUSED(event) ) void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) { - (void)wxMessageBox( "wxScroll demo II\n" - "Robert Roebling (c) 1998", - "About wxScroll II Demo", wxICON_INFORMATION | wxOK ); + (void)wxMessageBox( _T("wxScroll demo II\n") + _T("Robert Roebling (c) 1998"), + _T("About wxScroll II Demo"), wxICON_INFORMATION | wxOK ); } //----------------------------------------------------------------------------- -- 2.45.2