diff --git a/samples/artprov/artbrows.cpp b/samples/artprov/artbrows.cpp index 2b13ac4632..93e0f9f638 100644 --- a/samples/artprov/artbrows.cpp +++ b/samples/artprov/artbrows.cpp @@ -28,7 +28,7 @@ #include "artbrows.h" #define ART_CLIENT(id) \ - choice->Append(wxT(#id), (void*)id); + choice->Append(#id, (void*)id); #define ART_ICON(id) \ { \ int ind; \ @@ -37,7 +37,7 @@ ind = images->Add(icon); \ else \ ind = 0; \ - list->InsertItem(index, wxT(#id), ind); \ + list->InsertItem(index, #id, ind); \ list->SetItemPtrData(index, wxPtrToUInt(id)); \ index++; \ } diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index 944e65a85e..479b30cb7c 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -944,7 +944,7 @@ void MyFrame::OnComboBoxUpdate( wxCommandEvent& event ) } else if ( event.GetEventType() == wxEVT_TEXT ) { - wxLogDebug(wxT("EVT_TEXT(id=%i,string=\"%s\")"),event.GetId(),event.GetString().c_str()); + wxLogDebug("EVT_TEXT(id=%i,string=\"%s\")",event.GetId(),event.GetString().c_str()); } else if ( event.GetEventType() == wxEVT_TEXT_ENTER ) { diff --git a/samples/dataview/mymodels.h b/samples/dataview/mymodels.h index 6366250b87..59d3c984a7 100644 --- a/samples/dataview/mymodels.h +++ b/samples/dataview/mymodels.h @@ -226,7 +226,7 @@ public: virtual wxString GetColumnType( unsigned int col ) const wxOVERRIDE { if (col == Col_Toggle) - return wxT( "bool" ); + return "bool"; if (col == Col_IconText) return "wxDataViewIconText"; diff --git a/samples/debugrpt/debugrpt.cpp b/samples/debugrpt/debugrpt.cpp index faa0fe4862..ecf09b2aac 100644 --- a/samples/debugrpt/debugrpt.cpp +++ b/samples/debugrpt/debugrpt.cpp @@ -466,7 +466,7 @@ void MyApp::GenerateReport(wxDebugReport::Context ctx) } else { - wxLogMessage(wxT("Report generated in \"%s\"."), + wxLogMessage("Report generated in \"%s\".", report->GetCompressedFileName().c_str()); report->Reset(); } diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index e5184a3ca5..37744f6178 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -631,7 +631,7 @@ public: size_t WXUNUSED(len), const void *buf) wxOVERRIDE { wxCHECK_MSG( format == m_formatShape, false, - wxT( "unsupported format") ); + "unsupported format"); delete m_shape; m_shape = DnDShape::New(buf); @@ -1150,7 +1150,7 @@ void DnDFrame::OnDragMoveAllow(wxCommandEvent& event) void DnDFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox("Drag-&-Drop Demo\n" - wxT("Please see \"Help|Help...\" for details\n") + "Please see \"Help|Help...\" for details\n" "Copyright (c) 1998 Vadim Zeitlin", "About wxDnD", wxICON_INFORMATION | wxOK, @@ -1175,11 +1175,11 @@ void DnDFrame::OnHelp(wxCommandEvent& /* event */) "it to wordpad or any other droptarget accepting text (and of course you can just drag it\n" "to the right pane). Due to a lot of trace messages, the cursor might take some time to \n" "change, don't release the mouse button until it does. You can change the string being\n" - wxT("dragged in \"File|Test drag...\" dialog.\n") + "dragged in \"File|Test drag...\" dialog.\n" "\n" "\n" "Please send all questions/bug reports/suggestions &c to \n" - wxT("Vadim Zeitlin "), + "Vadim Zeitlin ", "wxDnD Help"); dialog.ShowModal(); @@ -1199,18 +1199,18 @@ void DnDFrame::OnLogClear(wxCommandEvent& /* event */ ) void DnDFrame::LogDragResult(wxDragResult result) { #if wxUSE_STATUSBAR - wxString pc; + wxString msg; switch ( result ) { - case wxDragError: pc = "Error!"; break; - case wxDragNone: pc = "Nothing"; break; - case wxDragCopy: pc = "Copied"; break; - case wxDragMove: pc = "Moved"; break; - case wxDragCancel: pc = "Cancelled"; break; - default: pc = "Huh?"; break; + case wxDragError: msg = "Error!"; break; + case wxDragNone: msg = "Nothing"; break; + case wxDragCopy: msg = "Copied"; break; + case wxDragMove: msg = "Moved"; break; + case wxDragCancel: msg = "Cancelled"; break; + default: msg = "Huh?"; break; } - SetStatusText(wxString("Drag result: ") + pc); + SetStatusText(wxString("Drag result: ") + msg); #else wxUnusedVar(result); #endif // wxUSE_STATUSBAR @@ -1294,9 +1294,9 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) { // PNG support is not always compiled in under Windows, so use BMP there #if wxUSE_LIBPNG - wxFileDialog dialog(this, "Open a PNG file", wxEmptyString, wxEmptyString, wxT("PNG files (*.png)|*.png"), 0); + wxFileDialog dialog(this, "Open a PNG file", wxEmptyString, wxEmptyString, "PNG files (*.png)|*.png", 0); #else - wxFileDialog dialog(this, "Open a BMP file", wxEmptyString, wxEmptyString, wxT("BMP files (*.bmp)|*.bmp"), 0); + wxFileDialog dialog(this, "Open a BMP file", wxEmptyString, wxEmptyString, "BMP files (*.bmp)|*.bmp", 0); #endif if (dialog.ShowModal() != wxID_OK) @@ -1439,7 +1439,7 @@ void DnDFrame::OnCopyFiles(wxCommandEvent& WXUNUSED(event)) { #ifdef __WXMSW__ wxFileDialog dialog(this, "Select a file to copy", wxEmptyString, wxEmptyString, - wxT("All files (*.*)|*.*"), 0); + "All files (*.*)|*.*", 0); wxArrayString filenames; while ( dialog.ShowModal() == wxID_OK ) @@ -1802,7 +1802,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) DnDShapeDataObject shapeData(m_shape); wxDropSource source(shapeData, this); - wxString pc; + wxString msg; switch ( source.DoDragDrop(true) ) { default: @@ -1817,11 +1817,11 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) break; case wxDragCopy: - pc = "copied"; + msg = "copied"; break; case wxDragMove: - pc = "moved"; + msg = "moved"; if ( ms_lastDropTarget != this ) { // don't delete the shape if we dropped it on ourselves! @@ -1836,10 +1836,10 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) break; } - if ( pc.length() ) + if (msg.length() ) { #if wxUSE_STATUSBAR - SetStatusText(wxString("Shape successfully ") + pc); + SetStatusText(wxString("Shape successfully ") + msg); #endif // wxUSE_STATUSBAR } //else: status text already set diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 30173d8e47..c10e374623 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -464,7 +464,7 @@ bool MyFrame::ProcessEvent(wxEvent& event) } catch ( const wxChar *msg ) { - wxLogMessage(wxT("Caught a string \"%s\" in MyFrame"), msg); + wxLogMessage("Caught a string \"%s\" in MyFrame", msg); return true; } diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index 860a7011e0..b88e3ff441 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -343,7 +343,7 @@ enum Exec_Btn_Close }; -static wxString DIALOG_TITLE() +static wxString GetDialogTitle() { return "Exec sample"; } @@ -675,12 +675,11 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) } else { - wxArrayString errorText; - errorText.push_back(""); // no error - errorText.push_back("signal not supported"); - errorText.push_back("permission denied"); - errorText.push_back("no such process"); - errorText.push_back("unspecified error"); + const wxString errorText[] = { "", // no error + "signal not supported", + "permission denied", + "no such process", + "unspecified error" }; wxLogStatus("Failed to kill process %ld with signal %d: %s", pid, sig, errorText[rc]); @@ -742,7 +741,7 @@ wxBEGIN_EVENT_TABLE(ExecQueryDialog, wxDialog) wxEND_EVENT_TABLE() ExecQueryDialog::ExecQueryDialog(const wxString& cmd) - : wxDialog(NULL, wxID_ANY, DIALOG_TITLE(), + : wxDialog(NULL, wxID_ANY, GetDialogTitle(), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { @@ -891,7 +890,7 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event)) { wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) @@ -903,7 +902,7 @@ void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event)) { wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) @@ -927,7 +926,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) } wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) @@ -989,14 +988,14 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) m_cmdLast = "tr [a-z] [A-Z]"; wxString cmd = wxGetTextFromUser("Enter the command: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( !cmd ) return; wxString input = wxGetTextFromUser("Enter the string to send to it: ", - DIALOG_TITLE()); + GetDialogTitle()); if ( !input ) return; @@ -1022,7 +1021,7 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPOpen(wxCommandEvent& WXUNUSED(event)) { wxString cmd = wxGetTextFromUser("Enter the command to launch: ", - DIALOG_TITLE(), + GetDialogTitle(), m_cmdLast); if ( cmd.empty() ) return; @@ -1174,7 +1173,7 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) if ( !wxLaunchDefaultBrowser(s_url) ) { - wxLogError(wxT("Failed to open URL \"%s\""), s_url.c_str()); + wxLogError("Failed to open URL \"%s\"", s_url.c_str()); } } @@ -1187,19 +1186,19 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) bool MyFrame::GetDDEServer() { wxString server = wxGetTextFromUser("Server to connect to:", - DIALOG_TITLE(), m_server); + GetDialogTitle(), m_server); if ( !server ) return false; m_server = server; - wxString topic = wxGetTextFromUser("DDE topic:", DIALOG_TITLE(), m_topic); + wxString topic = wxGetTextFromUser("DDE topic:", GetDialogTitle(), m_topic); if ( !topic ) return false; m_topic = topic; - wxString cmd = wxGetTextFromUser("DDE command:", DIALOG_TITLE(), m_cmdDde); + wxString cmd = wxGetTextFromUser("DDE command:", GetDialogTitle(), m_cmdDde); if ( !cmd ) return false; diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 112e705da5..a73720f811 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -45,7 +45,7 @@ #endif // used as title for several dialog boxes -static wxString SAMPLE_TITLE() +static wxString GetSampleTitle() { return "wxWidgets Font Sample"; } @@ -659,7 +659,7 @@ bool MyFrame::DoEnumerateFamilies(bool fixedWidthOnly, n = wxGetSingleChoiceIndex ( "Choose a facename", - SAMPLE_TITLE(), + GetSampleTitle(), nFacenames, facenames, this @@ -713,7 +713,7 @@ void MyFrame::OnSetNativeDesc(wxCommandEvent& WXUNUSED(event)) font.SetNativeFontInfo(fontInfo); if ( !font.IsOk() ) { - wxLogError(wxT("Font info string \"%s\" is invalid."), + wxLogError("Font info string \"%s\" is invalid.", fontInfo.c_str()); return; } @@ -807,7 +807,7 @@ wxFontEncoding MyFrame::GetEncodingFromUser() int i = wxGetSingleChoiceIndex ( "Choose the encoding", - SAMPLE_TITLE(), + GetSampleTitle(), names, this ); @@ -837,7 +837,7 @@ wxFontFamily MyFrame::GetFamilyFromUser() int i = wxGetSingleChoiceIndex ( "Choose the family", - SAMPLE_TITLE(), + GetSampleTitle(), names, this ); @@ -1088,10 +1088,10 @@ void MyFrame::OnViewMsg(wxCommandEvent& WXUNUSED(event)) { // found! const wxChar *pc = line.c_str() + len; - if ( *pc == wxT('"') ) + if ( *pc == '"') pc++; - while ( *pc && *pc != wxT('"') ) + while ( *pc && *pc != '"') { charset += *pc++; } @@ -1165,7 +1165,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox("wxWidgets font sample\n" "(c) 1999-2006 Vadim Zeitlin", - wxString("About ") + SAMPLE_TITLE(), + wxString("About ") + GetSampleTitle(), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 1439fef65c..1e6c8087ca 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -1850,13 +1850,12 @@ void BugsGridTable::SetValueAsBool( int row, int col, bool value ) wxString BugsGridTable::GetColLabelValue( int col ) { - static wxArrayString headers; - headers.push_back("Id"); - headers.push_back("Summary"); - headers.push_back("Severity"); - headers.push_back("Priority"); - headers.push_back("Platform"); - headers.push_back("Opened?"); + static const wxString headers[] = { "Id", + "Summary", + "Severity", + "Priority", + "Platform", + "Opened?" }; return headers[col]; } diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 31e2bfc268..d02ac51477 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -153,7 +153,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_GIF image.Destroy(); - if ( !image.LoadFile( dir + wxT("horse.gif" )) ) + if ( !image.LoadFile( dir + "horse.gif" ) ) { wxLogError("Can't load GIF image"); } diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index e0b27439f7..241be9d26d 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -397,8 +397,8 @@ void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) } else if ( num == 9 ) { - // this message is not translated (not in catalog) because we used wxT() - // and not _() around it + // this message is not translated (not in catalog) because we + // did not put _() around it str = "You've found a bug in this program!"; } else if ( num == 17 ) diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index cea7e80e80..2c14651761 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -251,7 +251,7 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event)) m_client = new MyClient; bool retval = m_client->Connect(hostname, servername, topic); - wxLogMessage(wxT("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"), + wxLogMessage("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s", hostname.c_str(), servername.c_str(), topic.c_str(), retval ? "connected" : "failed to connect"); diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 04c9be5587..290fee2afe 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -368,7 +368,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(wxFrame* parent) sizerFlex->SetFlexibleDirection(wxHORIZONTAL); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, "Same with grow mode == \"none\""), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3, wxSize(5, 5)); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -377,7 +377,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(wxFrame* parent) sizerFlex->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_NONE); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, "Same with grow mode == \"all\""), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3, wxSize(5, 5)); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -441,15 +441,18 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title) // ---------------------------------------------------------------------------- // some simple macros to help make the sample code below more clear -#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text)) -#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE) +#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, text) +#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE) #define POS(r, c) wxGBPosition(r,c) #define SPAN(r, c) wxGBSpan(r,c) -const wxChar gbsDescription[] =wxT("\ -The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\ -in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\ -static text is positioned at (0,0) and it spans 7 columns."); +wxString GetGbsDescription() +{ + return "\ + The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\ + in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\ + static text is positioned at (0,0) and it spans 7 columns."; +} // Some IDs @@ -479,7 +482,7 @@ MyGridBagSizerFrame::MyGridBagSizerFrame(wxFrame* parent) m_gbs = new wxGridBagSizer(); - m_gbs->Add( new wxStaticText(p, wxID_ANY, gbsDescription), + m_gbs->Add( new wxStaticText(p, wxID_ANY, GetGbsDescription()), POS(0,0), SPAN(1, 7), wxALIGN_CENTER | wxALL, 5); @@ -557,9 +560,9 @@ void MyGridBagSizerFrame::OnMoveBtn(wxCommandEvent& event) { if ( m_gbs->CheckForIntersection(wxGBPosition(3,6), wxGBSpan(1,1)) ) wxMessageBox( -wxT("wxGridBagSizer will not allow items to be in the same cell as\n\ +"wxGridBagSizer will not allow items to be in the same cell as\n\ another item, so this operation will fail. You will also get an assert\n\ -when compiled in debug mode."), "Warning", wxOK | wxICON_INFORMATION); +when compiled in debug mode.", "Warning", wxOK | wxICON_INFORMATION); if ( m_gbs->SetItemPosition(btn, wxGBPosition(3,6)) ) { diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 84d6898b04..a0d2f287a9 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -95,7 +95,7 @@ bool MyApp::OnInit() return false; // Create the main frame window - MyFrame *frame = new MyFrame(wxT("wxListCtrl Test")); + MyFrame *frame = new MyFrame("wxListCtrl Test"); // Show the frame frame->Show(true); @@ -169,7 +169,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) wxEND_EVENT_TABLE() // My frame constructor -MyFrame::MyFrame(const wxChar *title) +MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 500)) { m_listCtrl = NULL; @@ -185,17 +185,17 @@ MyFrame::MyFrame(const wxChar *title) m_imageListSmall = new wxImageList(16, 16, true); #ifdef wxHAS_IMAGES_IN_RESOURCES - m_imageListNormal->Add( wxIcon(wxT("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(wxT("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon1", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon2", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon3", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon4", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon5", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon6", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon7", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon8", wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon("icon9", wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListSmall->Add( wxIcon(wxT("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListSmall->Add( wxIcon("iconsmall", wxBITMAP_TYPE_ICO_RESOURCE) ); #else m_imageListNormal->Add( wxIcon( toolbrai_xpm ) ); @@ -213,77 +213,77 @@ MyFrame::MyFrame(const wxChar *title) // Make a menubar wxMenu *menuFile = new wxMenu; - menuFile->Append(LIST_ABOUT, wxT("&About")); + menuFile->Append(LIST_ABOUT, "&About"); menuFile->AppendSeparator(); - menuFile->Append(LIST_QUIT, wxT("E&xit\tAlt-X")); + menuFile->Append(LIST_QUIT, "E&xit\tAlt-X"); wxMenu *menuView = new wxMenu; - menuView->Append(LIST_LIST_VIEW, wxT("&List view\tF1")); - menuView->Append(LIST_REPORT_VIEW, wxT("&Report view\tF2")); - menuView->Append(LIST_ICON_VIEW, wxT("&Icon view\tF3")); - menuView->Append(LIST_ICON_TEXT_VIEW, wxT("Icon view with &text\tF4")); - menuView->Append(LIST_SMALL_ICON_VIEW, wxT("&Small icon view\tF5")); - menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, wxT("Small icon &view with text\tF6")); - menuView->Append(LIST_VIRTUAL_VIEW, wxT("&Virtual view\tF7")); - menuView->Append(LIST_SMALL_VIRTUAL_VIEW, wxT("Small virtual vie&w\tF8")); + menuView->Append(LIST_LIST_VIEW, "&List view\tF1"); + menuView->Append(LIST_REPORT_VIEW, "&Report view\tF2"); + menuView->Append(LIST_ICON_VIEW, "&Icon view\tF3"); + menuView->Append(LIST_ICON_TEXT_VIEW, "Icon view with &text\tF4"); + menuView->Append(LIST_SMALL_ICON_VIEW, "&Small icon view\tF5"); + menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, "Small icon &view with text\tF6"); + menuView->Append(LIST_VIRTUAL_VIEW, "&Virtual view\tF7"); + menuView->Append(LIST_SMALL_VIRTUAL_VIEW, "Small virtual vie&w\tF8"); menuView->AppendSeparator(); menuView->Append(LIST_SET_ITEMS_COUNT, "Set &number of items"); #ifdef __WXOSX__ menuView->AppendSeparator(); - menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, wxT("Mac: Use Generic Control")); + menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, "Mac: Use Generic Control"); #endif wxMenu *menuList = new wxMenu; - menuList->Append(LIST_GOTO, wxT("&Go to item #3\tCtrl-3")); - menuList->Append(LIST_FOCUS_LAST, wxT("&Make last item current\tCtrl-L")); - menuList->Append(LIST_TOGGLE_FIRST, wxT("To&ggle first item\tCtrl-G")); - menuList->Append(LIST_DESELECT_ALL, wxT("&Deselect All\tCtrl-D")); - menuList->Append(LIST_SELECT_ALL, wxT("S&elect All\tCtrl-A")); + menuList->Append(LIST_GOTO, "&Go to item #3\tCtrl-3"); + menuList->Append(LIST_FOCUS_LAST, "&Make last item current\tCtrl-L"); + menuList->Append(LIST_TOGGLE_FIRST, "To&ggle first item\tCtrl-G"); + menuList->Append(LIST_DESELECT_ALL, "&Deselect All\tCtrl-D"); + menuList->Append(LIST_SELECT_ALL, "S&elect All\tCtrl-A"); menuList->AppendSeparator(); - menuList->Append(LIST_SHOW_COL_INFO, wxT("Show &column info\tCtrl-C")); - menuList->Append(LIST_SHOW_SEL_INFO, wxT("Show &selected items\tCtrl-S")); - menuList->Append(LIST_SHOW_VIEW_RECT, wxT("Show &view rect")); + menuList->Append(LIST_SHOW_COL_INFO, "Show &column info\tCtrl-C"); + menuList->Append(LIST_SHOW_SEL_INFO, "Show &selected items\tCtrl-S"); + menuList->Append(LIST_SHOW_VIEW_RECT, "Show &view rect"); #ifdef wxHAS_LISTCTRL_COLUMN_ORDER - menuList->Append(LIST_SET_COL_ORDER, wxT("Se&t columns order\tShift-Ctrl-O")); - menuList->Append(LIST_GET_COL_ORDER, wxT("Sho&w columns order\tCtrl-O")); + menuList->Append(LIST_SET_COL_ORDER, "Se&t columns order\tShift-Ctrl-O"); + menuList->Append(LIST_GET_COL_ORDER, "Sho&w columns order\tCtrl-O"); #endif // wxHAS_LISTCTRL_COLUMN_ORDER menuList->AppendSeparator(); - menuList->Append(LIST_SORT, wxT("Sor&t\tCtrl-T")); + menuList->Append(LIST_SORT, "Sor&t\tCtrl-T"); menuList->Append(LIST_FIND, "Test Find() performance"); menuList->AppendSeparator(); - menuList->Append(LIST_ADD, wxT("&Append an item\tCtrl-P")); - menuList->Append(LIST_EDIT, wxT("&Edit the item\tCtrl-E")); - menuList->Append(LIST_DELETE, wxT("&Delete first item\tCtrl-X")); - menuList->Append(LIST_DELETE_ALL, wxT("Delete &all items")); + menuList->Append(LIST_ADD, "&Append an item\tCtrl-P"); + menuList->Append(LIST_EDIT, "&Edit the item\tCtrl-E"); + menuList->Append(LIST_DELETE, "&Delete first item\tCtrl-X"); + menuList->Append(LIST_DELETE_ALL, "Delete &all items"); menuList->AppendSeparator(); - menuList->Append(LIST_FREEZE, wxT("Free&ze\tCtrl-Z")); - menuList->Append(LIST_THAW, wxT("Tha&w\tCtrl-W")); + menuList->Append(LIST_FREEZE, "Free&ze\tCtrl-Z"); + menuList->Append(LIST_THAW, "Tha&w\tCtrl-W"); menuList->AppendSeparator(); - menuList->AppendCheckItem(LIST_TOGGLE_LINES, wxT("Toggle &lines\tCtrl-I")); + menuList->AppendCheckItem(LIST_TOGGLE_LINES, "Toggle &lines\tCtrl-I"); menuList->AppendCheckItem(LIST_TOGGLE_MULTI_SEL, - wxT("&Multiple selection\tCtrl-M")); + "&Multiple selection\tCtrl-M"); menuList->Check(LIST_TOGGLE_MULTI_SEL, true); menuList->AppendCheckItem(LIST_TOGGLE_HEADER, "Toggle &header\tCtrl-H"); menuList->Check(LIST_TOGGLE_HEADER, true); menuList->AppendCheckItem(LIST_TOGGLE_BELL, "Toggle &bell on no match"); menuList->AppendSeparator(); menuList->AppendCheckItem(LIST_TOGGLE_CHECKBOXES, - wxT("&Enable Checkboxes")); + "&Enable Checkboxes"); menuList->Check(LIST_TOGGLE_CHECKBOXES, true); - menuList->Append(LIST_TOGGLE_CHECKBOX, wxT("Toggle the item checkbox state")); - menuList->Append(LIST_GET_CHECKBOX, wxT("Get the item checkbox state")); + menuList->Append(LIST_TOGGLE_CHECKBOX, "Toggle the item checkbox state"); + menuList->Append(LIST_GET_CHECKBOX, "Get the item checkbox state"); wxMenu *menuCol = new wxMenu; - menuCol->Append(LIST_SET_FG_COL, wxT("&Foreground colour...")); - menuCol->Append(LIST_SET_BG_COL, wxT("&Background colour...")); - menuCol->AppendCheckItem(LIST_ROW_LINES, wxT("Alternating colours")); + menuCol->Append(LIST_SET_FG_COL, "&Foreground colour..."); + menuCol->Append(LIST_SET_BG_COL, "&Background colour..."); + menuCol->AppendCheckItem(LIST_ROW_LINES, "Alternating colours"); menuCol->AppendCheckItem(LIST_CUSTOM_HEADER_ATTR, "&Custom header attributes"); wxMenuBar *menubar = new wxMenuBar; - menubar->Append(menuFile, wxT("&File")); - menubar->Append(menuView, wxT("&View")); - menubar->Append(menuList, wxT("&List")); - menubar->Append(menuCol, wxT("&Colour")); + menubar->Append(menuFile, "&File"); + menubar->Append(menuView, "&View"); + menubar->Append(menuList, "&List"); + menubar->Append(menuCol, "&Colour"); SetMenuBar(menubar); m_panel = new wxPanel(this, wxID_ANY); @@ -327,7 +327,7 @@ bool MyFrame::CheckNonVirtual() const return true; // "this" == whatever - wxLogWarning(wxT("Can't do this in virtual view, sorry.")); + wxLogWarning("Can't do this in virtual view, sorry."); return false; } @@ -339,22 +339,22 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageDialog dialog(this, wxT("List test sample\nJulian Smart (c) 1997"), - wxT("About list test")); + wxMessageDialog dialog(this, "List test sample\nJulian Smart (c) 1997", + "About list test"); dialog.ShowModal(); } void MyFrame::OnFreeze(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Freezing the control")); + wxLogMessage("Freezing the control"); m_listCtrl->Freeze(); } void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Thawing the control")); + wxLogMessage("Thawing the control"); m_listCtrl->Thaw(); } @@ -380,7 +380,7 @@ void MyFrame::OnToggleBell(wxCommandEvent& event) void MyFrame::OnToggleMacUseGeneric(wxCommandEvent& event) { - wxSystemOptions::SetOption(wxT("mac.listctrl.always_use_generic"), event.IsChecked()); + wxSystemOptions::SetOption("mac.listctrl.always_use_generic", event.IsChecked()); } #endif // __WXOSX__ @@ -486,7 +486,7 @@ void MyFrame::RecreateList(long flags, bool withText) break; default: - wxFAIL_MSG( wxT("unknown listctrl mode") ); + wxFAIL_MSG( "unknown listctrl mode" ); } wxMenuBar* const mb = GetMenuBar(); @@ -508,7 +508,7 @@ void MyFrame::InitWithListItems() { for ( int i = 0; i < m_numListItems; i++ ) { - m_listCtrl->InsertItem(i, wxString::Format(wxT("Item %d"), i)); + m_listCtrl->InsertItem(i, wxString::Format("Item %d", i)); } } @@ -524,15 +524,15 @@ void MyFrame::InitWithReportItems() // note that under MSW for SetColumnWidth() to work we need to create the // items with images initially even if we specify dummy image id wxListItem itemCol; - itemCol.SetText(wxT("Column 1")); + itemCol.SetText("Column 1"); itemCol.SetImage(-1); m_listCtrl->InsertColumn(0, itemCol); - itemCol.SetText(wxT("Column 2 (auto size excluding header)")); + itemCol.SetText("Column 2 (auto size excluding header)"); itemCol.SetAlign(wxLIST_FORMAT_CENTRE); m_listCtrl->InsertColumn(1, itemCol); - itemCol.SetText(wxT("Column 3 (auto size including header)")); + itemCol.SetText("Column 3 (auto size including header)"); itemCol.SetAlign(wxLIST_FORMAT_RIGHT); m_listCtrl->InsertColumn(2, itemCol); @@ -546,7 +546,7 @@ void MyFrame::InitWithReportItems() m_listCtrl->InsertItemInReportView(i); } - m_logWindow->WriteText(wxString::Format(wxT("%d items inserted in %ldms\n"), + m_logWindow->WriteText(wxString::Format("%d items inserted in %ldms\n", m_numListItems, sw.Time())); m_listCtrl->Show(); @@ -674,14 +674,14 @@ void MyFrame::InitWithVirtualItems() if ( m_smallVirtual ) { - m_listCtrl->AppendColumn(wxT("Animal")); - m_listCtrl->AppendColumn(wxT("Sound")); + m_listCtrl->AppendColumn("Animal"); + m_listCtrl->AppendColumn("Sound"); m_listCtrl->SetItemCount(WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS)); } else { - m_listCtrl->AppendColumn(wxT("First Column (size auto)")); - m_listCtrl->AppendColumn(wxT("Second Column (150px)")); + m_listCtrl->AppendColumn("First Column (size auto)"); + m_listCtrl->AppendColumn("Second Column (150px)"); m_listCtrl->SetItemCount(1000000); m_listCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER); m_listCtrl->SetColumnWidth(1, 150); @@ -694,7 +694,7 @@ void MyFrame::OnSort(wxCommandEvent& WXUNUSED(event)) m_listCtrl->SortItems(MyCompareFunction, 0); - m_logWindow->WriteText(wxString::Format(wxT("Sorting %d items took %ld ms\n"), + m_logWindow->WriteText(wxString::Format("Sorting %d items took %ld ms\n", m_listCtrl->GetItemCount(), sw.Time())); } @@ -714,7 +714,7 @@ void MyFrame::OnFind(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) { int selCount = m_listCtrl->GetSelectedItemCount(); - wxLogMessage(wxT("%d items selected:"), selCount); + wxLogMessage("%d items selected:", selCount); // don't show too many items size_t shownCount = 0; @@ -723,12 +723,12 @@ void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) wxLIST_STATE_SELECTED); while ( item != -1 ) { - wxLogMessage(wxT("\t%ld (%s)"), + wxLogMessage("\t%ld (%s)", item, m_listCtrl->GetItemText(item).c_str()); if ( ++shownCount > 10 ) { - wxLogMessage(wxT("\t... more selected items snipped...")); + wxLogMessage("\t... more selected items snipped..."); break; } @@ -812,10 +812,10 @@ void MyFrame::OnGetColOrder(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShowColInfo(wxCommandEvent& WXUNUSED(event)) { int count = m_listCtrl->GetColumnCount(); - wxLogMessage(wxT("%d columns:"), count); + wxLogMessage("%d columns:", count); for ( int c = 0; c < count; c++ ) { - wxLogMessage(wxT("\tcolumn %d has width %d"), c, + wxLogMessage("\tcolumn %d has width %d", c, m_listCtrl->GetColumnWidth(c)); } } @@ -833,8 +833,8 @@ void MyFrame::OnToggleMultiSel(wxCommandEvent& WXUNUSED(event)) else flags |= wxLC_SINGLE_SEL; - m_logWindow->WriteText(wxString::Format(wxT("Current selection mode: %sle\n"), - (flags & wxLC_SINGLE_SEL) ? wxT("sing") : wxT("multip"))); + m_logWindow->WriteText(wxString::Format("Current selection mode: %sle\n", + (flags & wxLC_SINGLE_SEL) ? "sing" : "multip")); RecreateList(flags); } @@ -909,7 +909,7 @@ void MyFrame::OnCustomHeaderAttr(wxCommandEvent& event) void MyFrame::OnAdd(wxCommandEvent& WXUNUSED(event)) { - m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxT("Appended item")); + m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), "Appended item"); } void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) @@ -932,7 +932,7 @@ void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) } else { - m_logWindow->WriteText(wxT("No item to edit")); + m_logWindow->WriteText("No item to edit"); } } } @@ -957,7 +957,7 @@ void MyFrame::OnGetItemCheckBox(wxCommandEvent& WXUNUSED(event)) { bool checked = m_listCtrl->IsItemChecked(item); - wxLogMessage(wxT("Item %ld is %s"), item, checked ? wxT("checked") : wxT("unchecked")); + wxLogMessage("Item %ld is %s", item, checked ? "checked" : "unchecked"); item = m_listCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); @@ -972,7 +972,7 @@ void MyFrame::OnDelete(wxCommandEvent& WXUNUSED(event)) } else { - m_logWindow->WriteText(wxT("Nothing to delete")); + m_logWindow->WriteText("Nothing to delete"); } } @@ -984,7 +984,7 @@ void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event)) m_listCtrl->DeleteAllItems(); - m_logWindow->WriteText(wxString::Format(wxT("Deleting %d items took %ld ms\n"), + m_logWindow->WriteText(wxString::Format("Deleting %d items took %ld ms\n", itemCount, sw.Time())); } @@ -1029,7 +1029,7 @@ wxEND_EVENT_TABLE() void MyListCtrl::OnCacheHint(wxListEvent& event) { - wxLogMessage( wxT("OnCacheHint: cache items %ld..%ld"), + wxLogMessage( "OnCacheHint: cache items %ld..%ld", event.GetCacheFrom(), event.GetCacheTo() ); } @@ -1050,7 +1050,7 @@ void MyListCtrl::OnColClick(wxListEvent& event) x = !x; SetColumnImage(col, x ? 0 : -1); - wxLogMessage( wxT("OnColumnClick at %d."), col ); + wxLogMessage( "OnColumnClick at %d.", col ); } void MyListCtrl::OnColRightClick(wxListEvent& event) @@ -1062,18 +1062,18 @@ void MyListCtrl::OnColRightClick(wxListEvent& event) } // Show popupmenu at position - wxMenu menu(wxT("Test")); - menu.Append(LIST_ABOUT, wxT("&About")); + wxMenu menu("Test"); + menu.Append(LIST_ABOUT, "&About"); PopupMenu(&menu, event.GetPoint()); - wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() ); + wxLogMessage( "OnColumnRightClick at %d.", event.GetColumn() ); } -void MyListCtrl::LogColEvent(const wxListEvent& event, const wxChar *name) +void MyListCtrl::LogColEvent(const wxListEvent& event, const wxString& name) { const int col = event.GetColumn(); - wxLogMessage(wxT("%s: column %d (width = %d or %d)."), + wxLogMessage("%s: column %d (width = %d or %d).", name, col, event.GetItem().GetWidth(), @@ -1082,11 +1082,11 @@ void MyListCtrl::LogColEvent(const wxListEvent& event, const wxChar *name) void MyListCtrl::OnColBeginDrag(wxListEvent& event) { - LogColEvent( event, wxT("OnColBeginDrag") ); + LogColEvent( event, "OnColBeginDrag" ); if ( event.GetColumn() == 0 ) { - wxLogMessage(wxT("Resizing this column shouldn't work.")); + wxLogMessage("Resizing this column shouldn't work."); event.Veto(); } @@ -1094,12 +1094,12 @@ void MyListCtrl::OnColBeginDrag(wxListEvent& event) void MyListCtrl::OnColDragging(wxListEvent& event) { - LogColEvent( event, wxT("OnColDragging") ); + LogColEvent( event, "OnColDragging" ); } void MyListCtrl::OnColEndDrag(wxListEvent& event) { - LogColEvent( event, wxT("OnColEndDrag") ); + LogColEvent( event, "OnColEndDrag" ); } void MyListCtrl::OnBeginDrag(wxListEvent& event) @@ -1107,19 +1107,19 @@ void MyListCtrl::OnBeginDrag(wxListEvent& event) const wxPoint& pt = event.m_pointDrag; int flags; - wxLogMessage( wxT("OnBeginDrag at (%d, %d), item %ld."), + wxLogMessage( "OnBeginDrag at (%d, %d), item %ld.", pt.x, pt.y, HitTest(pt, flags) ); } void MyListCtrl::OnBeginRDrag(wxListEvent& event) { - wxLogMessage( wxT("OnBeginRDrag at %d,%d."), + wxLogMessage( "OnBeginRDrag at %d,%d.", event.m_pointDrag.x, event.m_pointDrag.y ); } void MyListCtrl::OnBeginLabelEdit(wxListEvent& event) { - wxLogMessage( wxT("OnBeginLabelEdit: %s"), event.m_item.m_text.c_str()); + wxLogMessage( "OnBeginLabelEdit: %s", event.m_item.m_text.c_str()); wxTextCtrl * const text = GetEditControl(); if ( !text ) @@ -1134,7 +1134,7 @@ void MyListCtrl::OnBeginLabelEdit(wxListEvent& event) void MyListCtrl::OnEndLabelEdit(wxListEvent& event) { - wxLogMessage( wxT("OnEndLabelEdit: %s"), + wxLogMessage( "OnEndLabelEdit: %s", ( event.IsEditCancelled() ? wxString("[cancelled]") : @@ -1145,18 +1145,18 @@ void MyListCtrl::OnEndLabelEdit(wxListEvent& event) void MyListCtrl::OnDeleteItem(wxListEvent& event) { - LogEvent(event, wxT("OnDeleteItem")); - wxLogMessage( wxT("Number of items when delete event is sent: %d"), GetItemCount() ); + LogEvent(event, "OnDeleteItem"); + wxLogMessage( "Number of items when delete event is sent: %d", GetItemCount() ); } void MyListCtrl::OnDeleteAllItems(wxListEvent& event) { - LogEvent(event, wxT("OnDeleteAllItems")); + LogEvent(event, "OnDeleteAllItems"); } void MyListCtrl::OnSelected(wxListEvent& event) { - LogEvent(event, wxT("OnSelected")); + LogEvent(event, "OnSelected"); if ( GetWindowStyle() & wxLC_REPORT ) { @@ -1166,50 +1166,50 @@ void MyListCtrl::OnSelected(wxListEvent& event) info.m_mask = wxLIST_MASK_TEXT; if ( GetItem(info) ) { - wxLogMessage(wxT("Value of the 2nd field of the selected item: %s"), + wxLogMessage("Value of the 2nd field of the selected item: %s", info.m_text.c_str()); } else { - wxFAIL_MSG(wxT("wxListCtrl::GetItem() failed")); + wxFAIL_MSG("wxListCtrl::GetItem() failed"); } } } void MyListCtrl::OnDeselected(wxListEvent& event) { - LogEvent(event, wxT("OnDeselected")); + LogEvent(event, "OnDeselected"); } void MyListCtrl::OnActivated(wxListEvent& event) { - LogEvent(event, wxT("OnActivated")); + LogEvent(event, "OnActivated"); } void MyListCtrl::OnFocused(wxListEvent& event) { - LogEvent(event, wxT("OnFocused")); + LogEvent(event, "OnFocused"); event.Skip(); } void MyListCtrl::OnItemRightClick(wxListEvent& event) { - LogEvent(event, wxT("OnItemRightClick")); + LogEvent(event, "OnItemRightClick"); event.Skip(); } void MyListCtrl::OnChecked(wxListEvent& event) { - LogEvent(event, wxT("OnChecked")); + LogEvent(event, "OnChecked"); event.Skip(); } void MyListCtrl::OnUnChecked(wxListEvent& event) { - LogEvent(event, wxT("OnUnChecked")); + LogEvent(event, "OnUnChecked"); event.Skip(); } @@ -1220,7 +1220,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) if ( !wxGetKeyState(WXK_SHIFT) ) { - LogEvent(event, wxT("OnListKeyDown")); + LogEvent(event, "OnListKeyDown"); event.Skip(); return; } @@ -1258,7 +1258,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) item = 0; } - wxLogMessage(wxT("Focusing item %ld"), item); + wxLogMessage("Focusing item %ld", item); SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); EnsureVisible(item); @@ -1270,11 +1270,11 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) wxRect r; if ( !GetItemRect(item, r) ) { - wxLogError(wxT("Failed to retrieve rect of item %ld"), item); + wxLogError("Failed to retrieve rect of item %ld", item); break; } - wxLogMessage(wxT("Bounding rect of item %ld is (%d, %d)-(%d, %d)"), + wxLogMessage("Bounding rect of item %ld is (%d, %d)-(%d, %d)", item, r.x, r.y, r.x + r.width, r.y + r.height); } break; @@ -1297,11 +1297,11 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) if ( !GetSubItemRect(item, subItem, r, code) ) { - wxLogError(wxT("Failed to retrieve rect of item %ld column %d"), item, subItem + 1); + wxLogError("Failed to retrieve rect of item %ld column %d", item, subItem + 1); break; } - wxLogMessage(wxT("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"), + wxLogMessage("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)", item, subItem + 1, r.x, r.y, r.x + r.width, r.y + r.height); } @@ -1333,7 +1333,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) { DeleteItem(item); - wxLogMessage(wxT("Item %ld deleted"), item); + wxLogMessage("Item %ld deleted", item); // -1 because the indices were shifted by DeleteItem() item = GetNextItem(item - 1, @@ -1357,7 +1357,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) wxFALLTHROUGH; default: - LogEvent(event, wxT("OnListKeyDown")); + LogEvent(event, "OnListKeyDown"); event.Skip(); } @@ -1365,7 +1365,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) void MyListCtrl::OnChar(wxKeyEvent& event) { - wxLogMessage(wxT("Got char event.")); + wxLogMessage("Got char event."); event.Skip(); } @@ -1385,24 +1385,24 @@ void MyListCtrl::OnRightClick(wxMouseEvent& event) wxString where; switch ( flags ) { - case wxLIST_HITTEST_ABOVE: where = wxT("above"); break; - case wxLIST_HITTEST_BELOW: where = wxT("below"); break; - case wxLIST_HITTEST_NOWHERE: where = wxT("nowhere near"); break; - case wxLIST_HITTEST_ONITEMICON: where = wxT("on icon of"); break; - case wxLIST_HITTEST_ONITEMLABEL: where = wxT("on label of"); break; - case wxLIST_HITTEST_ONITEMRIGHT: where = wxT("right on"); break; - case wxLIST_HITTEST_TOLEFT: where = wxT("to the left of"); break; - case wxLIST_HITTEST_TORIGHT: where = wxT("to the right of"); break; - default: where = wxT("not clear exactly where on"); break; + case wxLIST_HITTEST_ABOVE: where = "above"; break; + case wxLIST_HITTEST_BELOW: where = "below"; break; + case wxLIST_HITTEST_NOWHERE: where = "nowhere near"; break; + case wxLIST_HITTEST_ONITEMICON: where = "on icon of"; break; + case wxLIST_HITTEST_ONITEMLABEL: where = "on label of"; break; + case wxLIST_HITTEST_ONITEMRIGHT: where = "right on"; break; + case wxLIST_HITTEST_TOLEFT: where = "to the left of"; break; + case wxLIST_HITTEST_TORIGHT: where = "to the right of"; break; + default: where = "not clear exactly where on"; break; } - wxLogMessage(wxT("Right double click %s item %ld, subitem %ld"), + wxLogMessage("Right double click %s item %ld, subitem %ld", where.c_str(), item, subitem); } -void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName) +void MyListCtrl::LogEvent(const wxListEvent& event, const wxString& eventName) { - wxLogMessage(wxT("Item %ld: %s (item text = %s, data = %ld)"), + wxLogMessage("Item %ld: %s (item text = %s, data = %ld)", event.GetIndex(), eventName, event.GetText(), static_cast(event.GetData())); } @@ -1415,7 +1415,7 @@ wxString MyListCtrl::OnGetItemText(long item, long column) const } else // "big" virtual control { - return wxString::Format(wxT("Column %ld of item %ld"), column, item); + return wxString::Format("Column %ld of item %ld", column, item); } } @@ -1446,14 +1446,14 @@ wxItemAttr *MyListCtrl::OnGetItemAttr(long item) const void MyListCtrl::InsertItemInReportView(int i) { wxString buf; - buf.Printf(wxT("This is item %d"), i); + buf.Printf("This is item %d", i); long tmp = InsertItem(i, buf, 0); SetItemData(tmp, i); - buf.Printf(wxT("Col 1, item %d"), i); + buf.Printf("Col 1, item %d", i); SetItem(tmp, 1, buf); - buf.Printf(wxT("Item %d in column 2"), i); + buf.Printf("Item %d in column 2", i); SetItem(tmp, 2, buf); } @@ -1490,9 +1490,9 @@ void MyListCtrl::ShowContextMenu(const wxPoint& pos) { wxMenu menu; - menu.Append(wxID_ABOUT, wxT("&About")); + menu.Append(wxID_ABOUT, "&About"); menu.AppendSeparator(); - menu.Append(wxID_EXIT, wxT("E&xit")); + menu.Append(wxID_EXIT, "E&xit"); PopupMenu(&menu, pos.x, pos.y); } diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index 4f4b8a13f4..e48b5292ef 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -79,8 +79,8 @@ private: wxLog *m_logOld; void SetColumnImage(int col, int image); - void LogEvent(const wxListEvent& event, const wxChar *eventName); - void LogColEvent(const wxListEvent& event, const wxChar *eventName); + void LogEvent(const wxListEvent& event, const wxString& eventName); + void LogColEvent(const wxListEvent& event, const wxString& eventName); virtual wxString OnGetItemText(long item, long column) const wxOVERRIDE; virtual int OnGetItemColumnImage(long item, long column) const wxOVERRIDE; @@ -97,7 +97,7 @@ private: class MyFrame: public wxFrame { public: - MyFrame(const wxChar *title); + MyFrame(const wxString& title); virtual ~MyFrame(); protected: diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index 3501d2a243..ae44dae5bc 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -674,9 +674,9 @@ MyFrame::MyFrame() wxLog::DisableTimestamp(); m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl)); - wxLogMessage(wxT("Brief explanations: the commands in the \"Menu\" menu ") - wxT("append/insert/delete items to/from the \"Test\" menu.\n") - wxT("The commands in the \"Menubar\" menu work with the ") + wxLogMessage("Brief explanations: the commands in the \"Menu\" menu " + "append/insert/delete items to/from the \"Test\" menu.\n" + "The commands in the \"Menubar\" menu work with the " "menubar itself.\n\n" "Right click the band below to test popup menus.\n"); #endif diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 9d53b15d94..6fcf42912b 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -70,7 +70,7 @@ wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with a Button" ) ); + panel->SetHelpText("Panel with a Button"); #endif (void) new wxButton( panel, wxID_ANY, "Button", @@ -84,7 +84,7 @@ wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with some Radio Buttons" ) ); + panel->SetHelpText("Panel with some Radio Buttons"); #endif wxString animals[] = @@ -115,7 +115,7 @@ wxPanel *CreateVetoPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "An empty panel" ) ); + panel->SetHelpText("An empty panel"); #endif (void) new wxStaticText( panel, wxID_ANY, @@ -130,7 +130,7 @@ wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with a maximized button" ) ); + panel->SetHelpText("Panel with a maximized button"); #endif wxButton *buttonBig = new wxButton(panel, wxID_ANY, "Maximized button"); @@ -147,7 +147,7 @@ wxPanel *CreateInsertPage(wxBookCtrlBase *parent) wxPanel *panel = new wxPanel(parent); #if wxUSE_HELP - panel->SetHelpText( wxT( "Maroon panel" ) ); + panel->SetHelpText("Maroon panel"); #endif panel->SetBackgroundColour( wxColour( "MAROON" ) ); @@ -642,7 +642,7 @@ wxPanel *MyFrame::CreateNewPage() const wxPanel *panel = new wxPanel(m_bookCtrl, wxID_ANY ); #if wxUSE_HELP - panel->SetHelpText( wxT( "Panel with \"First\" and \"Second\" buttons" ) ); + panel->SetHelpText("Panel with \"First\" and \"Second\" buttons"); #endif (void) new wxButton(panel, wxID_ANY, "First button", wxPoint(10, 30)); diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 5112f5a7e3..7a0fb4a54d 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -107,8 +107,8 @@ wxPGWindowList wxSampleMultiButtonEditor::CreateControls( wxPropertyGrid* propGr wxPGMultiButton* buttons = new wxPGMultiButton( propGrid, sz ); // Add two regular buttons - buttons->Add( wxT("...") ); - buttons->Add( wxT("A") ); + buttons->Add( "..." ); + buttons->Add( "A" ); // Add a bitmap button buttons->Add( wxArtProvider::GetBitmap(wxART_FOLDER) ); @@ -137,19 +137,19 @@ bool wxSampleMultiButtonEditor::OnEvent( wxPropertyGrid* propGrid, if ( event.GetId() == buttons->GetButtonId(0) ) { // Do something when the first button is pressed - wxLogDebug(wxT("First button pressed")); + wxLogDebug("First button pressed"); return false; // Return false since value did not change } if ( event.GetId() == buttons->GetButtonId(1) ) { // Do something when the second button is pressed - wxMessageBox(wxT("Second button pressed")); + wxMessageBox("Second button pressed"); return false; // Return false since value did not change } if ( event.GetId() == buttons->GetButtonId(2) ) { // Do something when the third button is pressed - wxMessageBox(wxT("Third button pressed")); + wxMessageBox("Third button pressed"); return false; // Return false since value did not change } } @@ -181,15 +181,15 @@ public: virtual bool Validate(wxWindow* WXUNUSED(parent)) wxOVERRIDE { wxTextCtrl* tc = wxDynamicCast(GetWindow(), wxTextCtrl); - wxCHECK_MSG(tc, true, wxT("validator window must be wxTextCtrl")); + wxCHECK_MSG(tc, true, "validator window must be wxTextCtrl"); wxString val = tc->GetValue(); if ( val.find(m_invalidWord) == wxString::npos ) return true; - ::wxMessageBox(wxString::Format(wxT("%s is not allowed word"),m_invalidWord.c_str()), - wxT("Validation Failure")); + ::wxMessageBox(wxString::Format("%s is not allowed word",m_invalidWord.c_str()), + "Validation Failure"); return false; } @@ -217,9 +217,9 @@ wxVectorProperty::wxVectorProperty( const wxString& label, : wxPGProperty(label,name) { SetValue( WXVARIANT(value) ); - AddPrivateChild( new wxFloatProperty(wxT("X"),wxPG_LABEL,value.x) ); - AddPrivateChild( new wxFloatProperty(wxT("Y"),wxPG_LABEL,value.y) ); - AddPrivateChild( new wxFloatProperty(wxT("Z"),wxPG_LABEL,value.z) ); + AddPrivateChild( new wxFloatProperty("X",wxPG_LABEL,value.x) ); + AddPrivateChild( new wxFloatProperty("Y",wxPG_LABEL,value.y) ); + AddPrivateChild( new wxFloatProperty("Z",wxPG_LABEL,value.z) ); } wxVectorProperty::~wxVectorProperty() { } @@ -268,9 +268,9 @@ wxTriangleProperty::wxTriangleProperty( const wxString& label, : wxPGProperty(label,name) { SetValue( WXVARIANT(value) ); - AddPrivateChild( new wxVectorProperty(wxT("A"),wxPG_LABEL,value.a) ); - AddPrivateChild( new wxVectorProperty(wxT("B"),wxPG_LABEL,value.b) ); - AddPrivateChild( new wxVectorProperty(wxT("C"),wxPG_LABEL,value.c) ); + AddPrivateChild( new wxVectorProperty("A",wxPG_LABEL,value.a) ); + AddPrivateChild( new wxVectorProperty("B",wxPG_LABEL,value.b) ); + AddPrivateChild( new wxVectorProperty("C",wxPG_LABEL,value.c) ); } wxTriangleProperty::~wxTriangleProperty() { } @@ -319,8 +319,8 @@ public: virtual bool DoShowDialog( wxPropertyGrid* WXUNUSED(propGrid), wxPGProperty* WXUNUSED(property) ) wxOVERRIDE { - wxString s = ::wxGetSingleChoice(wxT("Message"), - wxT("Caption"), + wxString s = ::wxGetSingleChoice("Message", + "Caption", m_choices.GetLabels()); if ( !s.empty() ) { @@ -346,10 +346,10 @@ public: : wxStringProperty(label, name, value) { // Prepare choices - m_choices.Add(wxT("Cat")); - m_choices.Add(wxT("Dog")); - m_choices.Add(wxT("Gibbon")); - m_choices.Add(wxT("Otter")); + m_choices.Add("Cat"); + m_choices.Add("Dog"); + m_choices.Add("Gibbon"); + m_choices.Add("Otter"); } // Set editor to have button @@ -586,15 +586,15 @@ void FormMain::OnMove( wxMoveEvent& event ) // Must check if properties exist (as they may be deleted). // Using m_pPropGridManager, we can scan all pages automatically. - id = m_pPropGridManager->GetPropertyByName( wxT("X") ); + id = m_pPropGridManager->GetPropertyByName( "X" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, x ); - id = m_pPropGridManager->GetPropertyByName( wxT("Y") ); + id = m_pPropGridManager->GetPropertyByName( "Y" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, y ); - id = m_pPropGridManager->GetPropertyByName( wxT("Position") ); + id = m_pPropGridManager->GetPropertyByName( "Position" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxPoint(x,y)) ); @@ -624,15 +624,15 @@ void FormMain::OnResize( wxSizeEvent& event ) // Must check if properties exist (as they may be deleted). // Using m_pPropGridManager, we can scan all pages automatically. - p = m_pPropGridManager->GetPropertyByName( wxT("Width") ); + p = m_pPropGridManager->GetPropertyByName( "Width" ); if ( p && !p->IsValueUnspecified() ) m_pPropGridManager->SetPropertyValue( p, w ); - p = m_pPropGridManager->GetPropertyByName( wxT("Height") ); + p = m_pPropGridManager->GetPropertyByName( "Height" ); if ( p && !p->IsValueUnspecified() ) m_pPropGridManager->SetPropertyValue( p, h ); - id = m_pPropGridManager->GetPropertyByName ( wxT("Size") ); + id = m_pPropGridManager->GetPropertyByName ( "Size" ); if ( id ) m_pPropGridManager->SetPropertyValue( id, WXVARIANT(wxSize(w,h)) ); @@ -646,12 +646,12 @@ void FormMain::OnPropertyGridChanging( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); - if ( p->GetName() == wxT("Font") ) + if ( p->GetName() == "Font" ) { int res = - wxMessageBox(wxString::Format(wxT("'%s' is about to change (to variant of type '%s')\n\nAllow or deny?"), + wxMessageBox(wxString::Format("'%s' is about to change (to variant of type '%s')\n\nAllow or deny?", p->GetName().c_str(),event.GetValue().GetType().c_str()), - wxT("Testing wxEVT_PG_CHANGING"), wxYES_NO, m_pPropGridManager); + "Testing wxEVT_PG_CHANGING", wxYES_NO, m_pPropGridManager); if ( res == wxNO ) { @@ -687,20 +687,20 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) return; // Some settings are disabled outside Windows platform - if ( name == wxT("X") ) + if ( name == "X" ) SetSize( value.As(), -1, -1, -1, wxSIZE_USE_EXISTING ); - else if ( name == wxT("Y") ) + else if ( name == "Y" ) // wxPGVariantToInt is safe long int value getter SetSize ( -1, value.As(), -1, -1, wxSIZE_USE_EXISTING ); - else if ( name == wxT("Width") ) + else if ( name == "Width" ) SetSize ( -1, -1, value.As(), -1, wxSIZE_USE_EXISTING ); - else if ( name == wxT("Height") ) + else if ( name == "Height" ) SetSize ( -1, -1, -1, value.As(), wxSIZE_USE_EXISTING ); - else if ( name == wxT("Label") ) + else if ( name == "Label" ) { SetTitle( value.As() ); } - else if ( name == wxT("Password") ) + else if ( name == "Password" ) { static int pwdMode = 0; @@ -710,7 +710,7 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) pwdMode &= 1; } else - if ( name == wxT("Font") ) + if ( name == "Font" ) { wxFont font = value.As(); wxASSERT( font.IsOk() ); @@ -718,22 +718,22 @@ void FormMain::OnPropertyGridChange( wxPropertyGridEvent& event ) m_pPropGridManager->SetFont( font ); } else - if ( name == wxT("Margin Colour") ) + if ( name == "Margin Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetMarginColour( cpv.m_colour ); } - else if ( name == wxT("Cell Colour") ) + else if ( name == "Cell Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetCellBackgroundColour( cpv.m_colour ); } - else if ( name == wxT("Line Colour") ) + else if ( name == "Line Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetLineColour( cpv.m_colour ); } - else if ( name == wxT("Cell Text Colour") ) + else if ( name == "Cell Text Colour" ) { wxColourPropertyValue cpv = value.As(); m_pPropGridManager->GetGrid()->SetCellTextColour( cpv.m_colour ); @@ -749,9 +749,9 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event ) { m_itemEnable->Enable( true ); if ( property->IsEnabled() ) - m_itemEnable->SetItemLabel( wxT("Disable") ); + m_itemEnable->SetItemLabel( "Disable" ); else - m_itemEnable->SetItemLabel( wxT("Enable") ); + m_itemEnable->SetItemLabel( "Enable" ); } else { @@ -763,7 +763,7 @@ void FormMain::OnPropertyGridSelect( wxPropertyGridEvent& event ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Selected: ")); + wxString text("Selected: "); text += m_pPropGridManager->GetPropertyLabel( prop ); sb->SetStatusText ( text ); } @@ -776,7 +776,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) ) { #if wxUSE_STATUSBAR wxStatusBar* sb = GetStatusBar(); - wxString text(wxT("Page Changed: ")); + wxString text("Page Changed: "); text += m_pPropGridManager->GetPageName(m_pPropGridManager->GetSelectedPage()); sb->SetStatusText( text ); #endif @@ -786,7 +786,7 @@ void FormMain::OnPropertyGridPageChange( wxPropertyGridEvent& WXUNUSED(event) ) void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event ) { - wxLogMessage(wxT("wxPG_EVT_LABEL_EDIT_BEGIN(%s)"), + wxLogMessage("wxPG_EVT_LABEL_EDIT_BEGIN(%s)", event.GetProperty()->GetLabel().c_str()); } @@ -794,7 +794,7 @@ void FormMain::OnPropertyGridLabelEditBegin( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridLabelEditEnding( wxPropertyGridEvent& event ) { - wxLogMessage(wxT("wxPG_EVT_LABEL_EDIT_ENDING(%s)"), + wxLogMessage("wxPG_EVT_LABEL_EDIT_ENDING(%s)", event.GetProperty()->GetLabel().c_str()); } @@ -813,9 +813,9 @@ void FormMain::OnPropertyGridItemRightClick( wxPropertyGridEvent& event ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Right-clicked: ")); + wxString text("Right-clicked: "); text += prop->GetLabel(); - text += wxT(", name="); + text += ", name="; text += m_pPropGridManager->GetPropertyName(prop); sb->SetStatusText( text ); } @@ -835,9 +835,9 @@ void FormMain::OnPropertyGridItemDoubleClick( wxPropertyGridEvent& event ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Double-clicked: ")); + wxString text("Double-clicked: "); text += prop->GetLabel(); - text += wxT(", name="); + text += ", name="; text += m_pPropGridManager->GetPropertyName(prop); sb->SetStatusText ( text ); } @@ -857,15 +857,15 @@ void FormMain::OnPropertyGridButtonClick ( wxCommandEvent& ) wxStatusBar* sb = GetStatusBar(); if ( prop ) { - wxString text(wxT("Button clicked: ")); + wxString text("Button clicked: "); text += m_pPropGridManager->GetPropertyLabel(prop); - text += wxT(", name="); + text += ", name="; text += m_pPropGridManager->GetPropertyName(prop); sb->SetStatusText( text ); } else { - ::wxMessageBox(wxT("SHOULD NOT HAPPEN!!!")); + ::wxMessageBox("SHOULD NOT HAPPEN!!!"); } #endif } @@ -874,14 +874,14 @@ void FormMain::OnPropertyGridButtonClick ( wxCommandEvent& ) void FormMain::OnPropertyGridItemCollapse( wxPropertyGridEvent& ) { - wxLogMessage(wxT("Item was Collapsed")); + wxLogMessage("Item was Collapsed"); } // ----------------------------------------------------------------------- void FormMain::OnPropertyGridItemExpand( wxPropertyGridEvent& ) { - wxLogMessage(wxT("Item was Expanded")); + wxLogMessage("Item was Expanded"); } // ----------------------------------------------------------------------- @@ -890,12 +890,12 @@ void FormMain::OnPropertyGridColBeginDrag( wxPropertyGridEvent& event ) { if ( m_itemVetoDragging->IsChecked() ) { - wxLogMessage(wxT("Splitter %i resize was vetoed"), event.GetColumn()); + wxLogMessage("Splitter %i resize was vetoed", event.GetColumn()); event.Veto(); } else { - wxLogDebug(wxT("Splitter %i resize began"), event.GetColumn()); + wxLogDebug("Splitter %i resize began", event.GetColumn()); } } @@ -905,7 +905,7 @@ void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event ) { wxUnusedVar(event); // For now, let's not spam the log output - //wxLogDebug(wxT("Splitter %i is being resized"), event.GetColumn()); + //wxLogDebug("Splitter %i is being resized", event.GetColumn()); } // ----------------------------------------------------------------------- @@ -913,7 +913,7 @@ void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event ) { wxUnusedVar(event); - wxLogDebug(wxT("Splitter %i resize ended"), event.GetColumn()); + wxLogDebug("Splitter %i resize ended", event.GetColumn()); } // ----------------------------------------------------------------------- @@ -943,26 +943,25 @@ void FormMain::OnLabelTextChange( wxCommandEvent& WXUNUSED(event) ) // ----------------------------------------------------------------------- -static const wxChar* _fs_windowstyle_labels[] = { - wxT("wxSIMPLE_BORDER"), - wxT("wxDOUBLE_BORDER"), - wxT("wxSUNKEN_BORDER"), - wxT("wxRAISED_BORDER"), - wxT("wxNO_BORDER"), - wxT("wxTRANSPARENT_WINDOW"), - wxT("wxTAB_TRAVERSAL"), - wxT("wxWANTS_CHARS"), +static const wxString _fs_windowstyle_labels[] = { + "wxSIMPLE_BORDER", + "wxDOUBLE_BORDER", + "wxSUNKEN_BORDER", + "wxRAISED_BORDER", + "wxNO_BORDER", + "wxTRANSPARENT_WINDOW", + "wxTAB_TRAVERSAL", + "wxWANTS_CHARS", #if wxNO_FULL_REPAINT_ON_RESIZE - wxT("wxNO_FULL_REPAINT_ON_RESIZE"), + "wxNO_FULL_REPAINT_ON_RESIZE", #endif - wxT("wxVSCROLL"), - wxT("wxALWAYS_SHOW_SB"), - wxT("wxCLIP_CHILDREN"), + "wxVSCROLL", + "wxALWAYS_SHOW_SB", + "wxCLIP_CHILDREN", #if wxFULL_REPAINT_ON_RESIZE - wxT("wxFULL_REPAINT_ON_RESIZE"), + "wxFULL_REPAINT_ON_RESIZE", #endif - (const wxChar*) NULL // terminator is always needed -}; + }; static const long _fs_windowstyle_values[] = { wxSIMPLE_BORDER, @@ -984,19 +983,18 @@ static const long _fs_windowstyle_values[] = { #endif }; -static const wxChar* _fs_framestyle_labels[] = { - wxT("wxCAPTION"), - wxT("wxMINIMIZE"), - wxT("wxMAXIMIZE"), - wxT("wxCLOSE_BOX"), - wxT("wxSTAY_ON_TOP"), - wxT("wxSYSTEM_MENU"), - wxT("wxRESIZE_BORDER"), - wxT("wxFRAME_TOOL_WINDOW"), - wxT("wxFRAME_NO_TASKBAR"), - wxT("wxFRAME_FLOAT_ON_PARENT"), - wxT("wxFRAME_SHAPED"), - (const wxChar*) NULL +static const wxString _fs_framestyle_labels[] = { + "wxCAPTION", + "wxMINIMIZE", + "wxMAXIMIZE", + "wxCLOSE_BOX", + "wxSTAY_ON_TOP", + "wxSYSTEM_MENU", + "wxRESIZE_BORDER", + "wxFRAME_TOOL_WINDOW", + "wxFRAME_NO_TASKBAR", + "wxFRAME_FLOAT_ON_PARENT", + "wxFRAME_SHAPED" }; static const long _fs_framestyle_values[] = { @@ -1012,12 +1010,9 @@ static const long _fs_framestyle_values[] = { wxFRAME_FLOAT_ON_PARENT, wxFRAME_SHAPED }; - -// ----------------------------------------------------------------------- - void FormMain::OnTestXRC(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(wxT("Sorry, not yet implemented")); + wxMessageBox("Sorry, not yet implemented"); } void FormMain::OnEnableCommonValues(wxCommandEvent& WXUNUSED(event)) @@ -1026,113 +1021,113 @@ void FormMain::OnEnableCommonValues(wxCommandEvent& WXUNUSED(event)) if ( prop ) prop->EnableCommonValue(); else - wxMessageBox(wxT("First select a property")); + wxMessageBox("First select a property"); } void FormMain::PopulateWithStandardItems () { wxPropertyGridManager* pgman = m_pPropGridManager; - wxPropertyGridPage* pg = pgman->GetPage(wxT("Standard Items")); + wxPropertyGridPage* pg = pgman->GetPage("Standard Items"); // Append is ideal way to add items to wxPropertyGrid. - pg->Append( new wxPropertyCategory(wxT("Appearance"),wxPG_LABEL) ); + pg->Append( new wxPropertyCategory("Appearance",wxPG_LABEL) ); - pg->Append( new wxStringProperty(wxT("Label"),wxPG_LABEL,GetTitle()) ); - pg->Append( new wxFontProperty(wxT("Font"),wxPG_LABEL) ); - pg->SetPropertyHelpString ( wxT("Font"), wxT("Editing this will change font used in the property grid.") ); + pg->Append( new wxStringProperty("Label",wxPG_LABEL,GetTitle()) ); + pg->Append( new wxFontProperty("Font",wxPG_LABEL) ); + pg->SetPropertyHelpString ( "Font", "Editing this will change font used in the property grid." ); - pg->Append( new wxSystemColourProperty(wxT("Margin Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Margin Colour",wxPG_LABEL, pg->GetGrid()->GetMarginColour()) ); - pg->Append( new wxSystemColourProperty(wxT("Cell Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Cell Colour",wxPG_LABEL, pg->GetGrid()->GetCellBackgroundColour()) ); - pg->Append( new wxSystemColourProperty(wxT("Cell Text Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Cell Text Colour",wxPG_LABEL, pg->GetGrid()->GetCellTextColour()) ); - pg->Append( new wxSystemColourProperty(wxT("Line Colour"),wxPG_LABEL, + pg->Append( new wxSystemColourProperty("Line Colour",wxPG_LABEL, pg->GetGrid()->GetLineColour()) ); - pg->Append( new wxFlagsProperty(wxT("Window Styles"),wxPG_LABEL, + pg->Append( new wxFlagsProperty("Window Styles",wxPG_LABEL, m_combinedFlags, GetWindowStyle()) ); - //pg->SetPropertyAttribute(wxT("Window Styles"),wxPG_BOOL_USE_CHECKBOX,true,wxPG_RECURSE); + //pg->SetPropertyAttribute("Window Styles",wxPG_BOOL_USE_CHECKBOX,true,wxPG_RECURSE); - pg->Append( new wxCursorProperty(wxT("Cursor"),wxPG_LABEL) ); + pg->Append( new wxCursorProperty("Cursor",wxPG_LABEL) ); - pg->Append( new wxPropertyCategory(wxT("Position"),wxT("PositionCategory")) ); - pg->SetPropertyHelpString( wxT("PositionCategory"), wxT("Change in items in this category will cause respective changes in frame.") ); + pg->Append( new wxPropertyCategory("Position","PositionCategory") ); + pg->SetPropertyHelpString( "PositionCategory", "Change in items in this category will cause respective changes in frame." ); // Let's demonstrate 'Units' attribute here // Note that we use many attribute constants instead of strings here - // (for instance, wxPG_ATTR_MIN, instead of wxT("min")). + // (for instance, wxPG_ATTR_MIN, instead of "min"). // Using constant may reduce binary size. - pg->Append( new wxIntProperty(wxT("Height"),wxPG_LABEL,480) ); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_MIN, (long)10 ); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_MAX, (long)2048 ); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_UNITS, wxT("Pixels") ); + pg->Append( new wxIntProperty("Height",wxPG_LABEL,480) ); + pg->SetPropertyAttribute("Height", wxPG_ATTR_MIN, (long)10 ); + pg->SetPropertyAttribute("Height", wxPG_ATTR_MAX, (long)2048 ); + pg->SetPropertyAttribute("Height", wxPG_ATTR_UNITS, "Pixels" ); // Set value to unspecified so that Hint attribute will be demonstrated - pg->SetPropertyValueUnspecified(wxT("Height")); - pg->SetPropertyAttribute(wxT("Height"), wxPG_ATTR_HINT, - wxT("Enter new height for window") ); + pg->SetPropertyValueUnspecified("Height"); + pg->SetPropertyAttribute("Height", wxPG_ATTR_HINT, + "Enter new height for window" ); // Difference between hint and help string is that the hint is shown in // an empty value cell, while help string is shown either in the // description text box, as a tool tip, or on the status bar. - pg->SetPropertyHelpString(wxT("Height"), - wxT("This property uses attributes \"Units\" and \"Hint\".") ); + pg->SetPropertyHelpString("Height", + "This property uses attributes \"Units\" and \"Hint\"."); - pg->Append( new wxIntProperty(wxT("Width"),wxPG_LABEL,640) ); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_MIN, (long)10 ); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_MAX, (long)2048 ); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_UNITS, wxT("Pixels") ); + pg->Append( new wxIntProperty("Width",wxPG_LABEL,640) ); + pg->SetPropertyAttribute("Width", wxPG_ATTR_MIN, (long)10 ); + pg->SetPropertyAttribute("Width", wxPG_ATTR_MAX, (long)2048 ); + pg->SetPropertyAttribute("Width", wxPG_ATTR_UNITS, "Pixels" ); - pg->SetPropertyValueUnspecified(wxT("Width")); - pg->SetPropertyAttribute(wxT("Width"), wxPG_ATTR_HINT, - wxT("Enter new width for window") ); - pg->SetPropertyHelpString(wxT("Width"), - wxT("This property uses attributes \"Units\" and \"Hint\".") ); + pg->SetPropertyValueUnspecified("Width"); + pg->SetPropertyAttribute("Width", wxPG_ATTR_HINT, + "Enter new width for window" ); + pg->SetPropertyHelpString("Width", + "This property uses attributes \"Units\" and \"Hint\"."); - pg->Append( new wxIntProperty(wxT("X"),wxPG_LABEL,10) ); - pg->SetPropertyAttribute(wxT("X"), wxPG_ATTR_UNITS, wxT("Pixels") ); - pg->SetPropertyHelpString(wxT("X"), wxT("This property uses \"Units\" attribute.") ); + pg->Append( new wxIntProperty("X",wxPG_LABEL,10) ); + pg->SetPropertyAttribute("X", wxPG_ATTR_UNITS, "Pixels" ); + pg->SetPropertyHelpString("X", "This property uses \"Units\" attribute."); - pg->Append( new wxIntProperty(wxT("Y"),wxPG_LABEL,10) ); - pg->SetPropertyAttribute(wxT("Y"), wxPG_ATTR_UNITS, wxT("Pixels") ); - pg->SetPropertyHelpString(wxT("Y"), wxT("This property uses \"Units\" attribute.") ); + pg->Append( new wxIntProperty("Y",wxPG_LABEL,10) ); + pg->SetPropertyAttribute("Y", wxPG_ATTR_UNITS, "Pixels" ); + pg->SetPropertyHelpString("Y", "This property uses \"Units\" attribute."); - const wxChar* disabledHelpString = wxT("This property is simply disabled. In order to have label disabled as well, ") - wxT("you need to set wxPG_EX_GREY_LABEL_WHEN_DISABLED using SetExtraStyle."); + const wxString disabledHelpString = "This property is simply disabled. In order to have label disabled as well, " + "you need to set wxPG_EX_GREY_LABEL_WHEN_DISABLED using SetExtraStyle."; - pg->Append( new wxPropertyCategory(wxT("Environment"),wxPG_LABEL) ); - pg->Append( new wxStringProperty(wxT("Operating System"),wxPG_LABEL,::wxGetOsDescription()) ); + pg->Append( new wxPropertyCategory("Environment",wxPG_LABEL) ); + pg->Append( new wxStringProperty("Operating System",wxPG_LABEL,::wxGetOsDescription()) ); - pg->Append( new wxStringProperty(wxT("User Id"),wxPG_LABEL,::wxGetUserId()) ); - pg->Append( new wxDirProperty(wxT("User Home"),wxPG_LABEL,::wxGetUserHome()) ); - pg->Append( new wxStringProperty(wxT("User Name"),wxPG_LABEL,::wxGetUserName()) ); + pg->Append( new wxStringProperty("User Id",wxPG_LABEL,::wxGetUserId()) ); + pg->Append( new wxDirProperty("User Home",wxPG_LABEL,::wxGetUserHome()) ); + pg->Append( new wxStringProperty("User Name",wxPG_LABEL,::wxGetUserName()) ); // Disable some of them - pg->DisableProperty( wxT("Operating System") ); - pg->DisableProperty( wxT("User Id") ); - pg->DisableProperty( wxT("User Name") ); + pg->DisableProperty( "Operating System" ); + pg->DisableProperty( "User Id" ); + pg->DisableProperty( "User Name" ); - pg->SetPropertyHelpString( wxT("Operating System"), disabledHelpString ); - pg->SetPropertyHelpString( wxT("User Id"), disabledHelpString ); - pg->SetPropertyHelpString( wxT("User Name"), disabledHelpString ); + pg->SetPropertyHelpString( "Operating System", disabledHelpString ); + pg->SetPropertyHelpString( "User Id", disabledHelpString ); + pg->SetPropertyHelpString( "User Name", disabledHelpString ); - pg->Append( new wxPropertyCategory(wxT("More Examples"),wxPG_LABEL) ); + pg->Append( new wxPropertyCategory("More Examples",wxPG_LABEL) ); - pg->Append( new wxFontDataProperty( wxT("FontDataProperty"), wxPG_LABEL) ); - pg->SetPropertyHelpString( wxT("FontDataProperty"), - wxT("This demonstrates wxFontDataProperty class defined in this sample app. ") - wxT("It is exactly like wxFontProperty from the library, but also has colour sub-property.") + pg->Append( new wxFontDataProperty( "FontDataProperty", wxPG_LABEL) ); + pg->SetPropertyHelpString( "FontDataProperty", + "This demonstrates wxFontDataProperty class defined in this sample app. " + "It is exactly like wxFontProperty from the library, but also has colour sub-property." ); - pg->Append( new wxDirsProperty(wxT("DirsProperty"),wxPG_LABEL) ); - pg->SetPropertyHelpString( wxT("DirsProperty"), - wxT("This demonstrates wxDirsProperty class defined in this sample app. ") - wxT("It is built with WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR macro, ") - wxT("with custom action (dir dialog popup) defined.") + pg->Append( new wxDirsProperty("DirsProperty",wxPG_LABEL) ); + pg->SetPropertyHelpString( "DirsProperty", + "This demonstrates wxDirsProperty class defined in this sample app. " + "It is built with WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR macro, " + "with custom action (dir dialog popup) defined." ); wxArrayDouble arrdbl; @@ -1142,21 +1137,21 @@ void FormMain::PopulateWithStandardItems () arrdbl.Add(0.5); arrdbl.Add(1.0); - pg->Append( new wxArrayDoubleProperty(wxT("ArrayDoubleProperty"),wxPG_LABEL,arrdbl) ); - //pg->SetPropertyAttribute(wxT("ArrayDoubleProperty"),wxPG_FLOAT_PRECISION,(long)2); - pg->SetPropertyHelpString( wxT("ArrayDoubleProperty"), - wxT("This demonstrates wxArrayDoubleProperty class defined in this sample app. ") - wxT("It is an example of a custom list editor property.") + pg->Append( new wxArrayDoubleProperty("ArrayDoubleProperty",wxPG_LABEL,arrdbl) ); + //pg->SetPropertyAttribute("ArrayDoubleProperty",wxPG_FLOAT_PRECISION,(long)2); + pg->SetPropertyHelpString( "ArrayDoubleProperty", + "This demonstrates wxArrayDoubleProperty class defined in this sample app. " + "It is an example of a custom list editor property." ); - pg->Append( new wxLongStringProperty(wxT("Information"),wxPG_LABEL, - wxT("Editing properties will have immediate effect on this window, ") - wxT("and vice versa (at least in most cases, that is).") + pg->Append( new wxLongStringProperty("Information",wxPG_LABEL, + "Editing properties will have immediate effect on this window, " + "and vice versa (at least in most cases, that is)." ) ); - pg->SetPropertyHelpString( wxT("Information"), - wxT("This property is read-only.") ); + pg->SetPropertyHelpString( "Information", + "This property is read-only." ); - pg->SetPropertyReadOnly( wxT("Information"), true ); + pg->SetPropertyReadOnly( "Information", true ); // // Set test information for cells in columns 3 and 4 @@ -1172,8 +1167,8 @@ void FormMain::PopulateWithStandardItems () if ( p->IsCategory() ) continue; - pg->SetPropertyCell( p, 3, wxT("Cell 3"), bmp ); - pg->SetPropertyCell( p, 4, wxT("Cell 4"), wxNullBitmap, *wxWHITE, *wxBLACK ); + pg->SetPropertyCell( p, 3, "Cell 3", bmp ); + pg->SetPropertyCell( p, 4, "Cell 4", wxNullBitmap, *wxWHITE, *wxBLACK ); } } @@ -1182,75 +1177,75 @@ void FormMain::PopulateWithStandardItems () void FormMain::PopulateWithExamples () { wxPropertyGridManager* pgman = m_pPropGridManager; - wxPropertyGridPage* pg = pgman->GetPage(wxT("Examples")); + wxPropertyGridPage* pg = pgman->GetPage("Examples"); wxPGProperty* pid; wxPGProperty* prop; - //pg->Append( new wxPropertyCategory(wxT("Examples (low priority)"),wxT("Examples")) ); - //pg->SetPropertyHelpString ( wxT("Examples"), wxT("This category has example of (almost) every built-in property class.") ); + //pg->Append( new wxPropertyCategory("Examples (low priority)","Examples") ); + //pg->SetPropertyHelpString ( "Examples", "This category has example of (almost) every built-in property class." ); #if wxUSE_SPINBTN - pg->Append( new wxIntProperty ( wxT("SpinCtrl"), wxPG_LABEL, 0 ) ); + pg->Append( new wxIntProperty ( "SpinCtrl", wxPG_LABEL, 0 ) ); - pg->SetPropertyEditor( wxT("SpinCtrl"), wxPGEditor_SpinCtrl ); - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_MIN, (long)-10 ); // Use constants instead of string - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_MAX, (long)16384 ); // for reduced binary size. - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_SPINCTRL_STEP, (long)2 ); - pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_SPINCTRL_MOTION, true ); - //pg->SetPropertyAttribute( wxT("SpinCtrl"), wxPG_ATTR_SPINCTRL_WRAP, true ); + pg->SetPropertyEditor( "SpinCtrl", wxPGEditor_SpinCtrl ); + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_MIN, (long)-10 ); // Use constants instead of string + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_MAX, (long)16384 ); // for reduced binary size. + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_SPINCTRL_STEP, (long)2 ); + pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_SPINCTRL_MOTION, true ); + //pg->SetPropertyAttribute( "SpinCtrl", wxPG_ATTR_SPINCTRL_WRAP, true ); - pg->SetPropertyHelpString( wxT("SpinCtrl"), - wxT("This is regular wxIntProperty, which editor has been ") - wxT("changed to wxPGEditor_SpinCtrl. Note however that ") - wxT("static wxPropertyGrid::RegisterAdditionalEditors() ") - wxT("needs to be called prior to using it.")); + pg->SetPropertyHelpString( "SpinCtrl", + "This is regular wxIntProperty, which editor has been " + "changed to wxPGEditor_SpinCtrl. Note however that " + "static wxPropertyGrid::RegisterAdditionalEditors() " + "needs to be called prior to using it."); #endif // Add bool property - pg->Append( new wxBoolProperty( wxT("BoolProperty"), wxPG_LABEL, false ) ); + pg->Append( new wxBoolProperty( "BoolProperty", wxPG_LABEL, false ) ); // Add bool property with check box - pg->Append( new wxBoolProperty( wxT("BoolProperty with CheckBox"), wxPG_LABEL, false ) ); - pg->SetPropertyAttribute( wxT("BoolProperty with CheckBox"), + pg->Append( new wxBoolProperty( "BoolProperty with CheckBox", wxPG_LABEL, false ) ); + pg->SetPropertyAttribute( "BoolProperty with CheckBox", wxPG_BOOL_USE_CHECKBOX, true ); - pg->SetPropertyHelpString( wxT("BoolProperty with CheckBox"), - wxT("Property attribute wxPG_BOOL_USE_CHECKBOX has been set to true.") ); + pg->SetPropertyHelpString( "BoolProperty with CheckBox", + "Property attribute wxPG_BOOL_USE_CHECKBOX has been set to true." ); - prop = pg->Append( new wxFloatProperty(wxT("FloatProperty"), + prop = pg->Append( new wxFloatProperty("FloatProperty", wxPG_LABEL, 1234500.23) ); prop->SetAttribute(wxPG_ATTR_MIN, -100.12); // A string property that can be edited in a separate editor dialog. - pg->Append( new wxLongStringProperty( wxT("LongStringProperty"), wxT("LongStringProp"), - wxT("This is much longer string than the first one. Edit it by clicking the button.") ) ); + pg->Append( new wxLongStringProperty( "LongStringProperty", "LongStringProp", + "This is much longer string than the first one. Edit it by clicking the button." ) ); // A property that edits a wxArrayString. wxArrayString example_array; - example_array.Add( wxT("String 1")); - example_array.Add( wxT("String 2")); - example_array.Add( wxT("String 3")); - pg->Append( new wxArrayStringProperty( wxT("ArrayStringProperty"), wxPG_LABEL, + example_array.Add( "String 1"); + example_array.Add( "String 2"); + example_array.Add( "String 3"); + pg->Append( new wxArrayStringProperty( "ArrayStringProperty", wxPG_LABEL, example_array) ); // Test adding same category multiple times ( should not actually create a new one ) - //pg->Append( new wxPropertyCategory(wxT("Examples (low priority)"),wxT("Examples")) ); + //pg->Append( new wxPropertyCategory("Examples (low priority)","Examples") ); // A file selector property. Note that argument between name // and initial value is wildcard (format same as in wxFileDialog). - prop = new wxFileProperty( wxT("FileProperty"), wxT("TextFile") ); + prop = new wxFileProperty( "FileProperty", "TextFile" ); pg->Append( prop ); - prop->SetAttribute(wxPG_FILE_WILDCARD,wxT("Text Files (*.txt)|*.txt")); - prop->SetAttribute(wxPG_FILE_DIALOG_TITLE,wxT("Custom File Dialog Title")); + prop->SetAttribute(wxPG_FILE_WILDCARD,"Text Files (*.txt)|*.txt"); + prop->SetAttribute(wxPG_FILE_DIALOG_TITLE,"Custom File Dialog Title"); prop->SetAttribute(wxPG_FILE_SHOW_FULL_PATH,false); #ifdef __WXMSW__ - prop->SetAttribute(wxPG_FILE_SHOW_RELATIVE_PATH,wxT("C:\\Windows")); - pg->SetPropertyValue(prop,wxT("C:\\Windows\\System32\\msvcrt71.dll")); + prop->SetAttribute(wxPG_FILE_SHOW_RELATIVE_PATH,"C:\\Windows"); + pg->SetPropertyValue(prop,"C:\\Windows\\System32\\msvcrt71.dll"); #endif #if wxUSE_IMAGE @@ -1258,58 +1253,56 @@ void FormMain::PopulateWithExamples () // wildcard is missing (it is autogenerated from supported image formats). // If you really need to override it, create property separately, and call // its SetWildcard method. - pg->Append( new wxImageFileProperty( wxT("ImageFile"), wxPG_LABEL ) ); + pg->Append( new wxImageFileProperty( "ImageFile", wxPG_LABEL ) ); #endif - pid = pg->Append( new wxColourProperty(wxT("ColourProperty"),wxPG_LABEL,*wxRED) ); - pg->SetPropertyEditor( wxT("ColourProperty"), wxPGEditor_ComboBox ); - pg->GetProperty(wxT("ColourProperty"))->SetAutoUnspecified(true); - pg->SetPropertyHelpString( wxT("ColourProperty"), - wxT("wxPropertyGrid::SetPropertyEditor method has been used to change ") - wxT("editor of this property to wxPGEditor_ComboBox)")); + pid = pg->Append( new wxColourProperty("ColourProperty",wxPG_LABEL,*wxRED) ); + pg->SetPropertyEditor( "ColourProperty", wxPGEditor_ComboBox ); + pg->GetProperty("ColourProperty")->SetAutoUnspecified(true); + pg->SetPropertyHelpString( "ColourProperty", + "wxPropertyGrid::SetPropertyEditor method has been used to change " + "editor of this property to wxPGEditor_ComboBox)"); - pid = pg->Append( new wxColourProperty(wxT("ColourPropertyWithAlpha"), + pid = pg->Append( new wxColourProperty("ColourPropertyWithAlpha", wxPG_LABEL, wxColour(15, 200, 95, 128)) ); - pg->SetPropertyAttribute(wxT("ColourPropertyWithAlpha"), wxPG_COLOUR_HAS_ALPHA, true); - pg->SetPropertyHelpString(wxT("ColourPropertyWithAlpha"), - wxT("Attribute \"HasAlpha\" is set to true for this property.")); + pg->SetPropertyAttribute("ColourPropertyWithAlpha", wxPG_COLOUR_HAS_ALPHA, true); + pg->SetPropertyHelpString("ColourPropertyWithAlpha", + "Attribute \"HasAlpha\" is set to true for this property."); // // This demonstrates using alternative editor for colour property // to trigger colour dialog directly from button. - pg->Append( new wxColourProperty(wxT("ColourProperty2"),wxPG_LABEL,*wxGREEN) ); + pg->Append( new wxColourProperty("ColourProperty2",wxPG_LABEL,*wxGREEN) ); // // wxEnumProperty does not store strings or even list of strings // ( so that's why they are static in function ). - static const wxChar* enum_prop_labels[] = { wxT("One Item"), - wxT("Another Item"), wxT("One More"), wxT("This Is Last"), NULL }; + static const wxString enum_prop_labels[] = { "One Item", + "Another Item", "One More", "This Is Last" }; // this value array would be optional if values matched string indexes static long enum_prop_values[] = { 40, 80, 120, 160 }; // note that the initial value (the last argument) is the actual value, // not index or anything like that. Thus, our value selects "Another Item". - // - // 0 before value is number of items. If it is 0, like in our example, - // number of items is calculated, and this requires that the string pointer - // array is terminated with NULL. - pg->Append( new wxEnumProperty(wxT("EnumProperty"),wxPG_LABEL, - enum_prop_labels, enum_prop_values, 80 ) ); + pg->Append( new wxEnumProperty("EnumProperty",wxPG_LABEL, + wxArrayString(WXSIZEOF(enum_prop_labels), enum_prop_labels), + wxArrayInt(enum_prop_values, enum_prop_values+ WXSIZEOF(enum_prop_values)), 80 ) ); wxPGChoices soc; // use basic table from our previous example // can also set/add wxArrayStrings and wxArrayInts directly. - soc.Set( enum_prop_labels, enum_prop_values ); + soc.Set(wxArrayString(WXSIZEOF(enum_prop_labels), enum_prop_labels), + wxArrayInt(enum_prop_values, enum_prop_values + WXSIZEOF(enum_prop_values))); // add extra items - soc.Add( wxT("Look, it continues"), 200 ); - soc.Add( wxT("Even More"), 240 ); - soc.Add( wxT("And More"), 280 ); + soc.Add( "Look, it continues", 200 ); + soc.Add( "Even More", 240 ); + soc.Add( "And More", 280 ); soc.Add( wxEmptyString, 300 ); - soc.Add( wxT("True End of the List"), 320 ); + soc.Add( "True End of the List", 320 ); // Test custom colours ([] operator of wxPGChoices returns // references to wxPGChoiceEntry). @@ -1321,85 +1314,85 @@ void FormMain::PopulateWithExamples () soc[3].SetBgCol(*wxLIGHT_GREY); soc[4].SetBitmap(wxArtProvider::GetBitmap(wxART_FOLDER)); - pg->Append( new wxEnumProperty(wxT("EnumProperty 2"), + pg->Append( new wxEnumProperty("EnumProperty 2", wxPG_LABEL, soc, 240) ); - pg->GetProperty(wxT("EnumProperty 2"))->AddChoice(wxT("Testing Extra"), 360); + pg->GetProperty("EnumProperty 2")->AddChoice("Testing Extra", 360); // Here we only display the original 'soc' choices - pg->Append( new wxEnumProperty(wxT("EnumProperty 3"),wxPG_LABEL, + pg->Append( new wxEnumProperty("EnumProperty 3",wxPG_LABEL, soc, 240 ) ); // Test Hint attribute in EnumProperty - pg->GetProperty(wxT("EnumProperty 3"))->SetAttribute(wxPG_ATTR_HINT, wxT("Dummy Hint")); + pg->GetProperty("EnumProperty 3")->SetAttribute(wxPG_ATTR_HINT, "Dummy Hint"); - pg->SetPropertyHelpString(wxT("EnumProperty 3"), - wxT("This property uses \"Hint\" attribute.")); + pg->SetPropertyHelpString("EnumProperty 3", + "This property uses \"Hint\" attribute."); // 'soc' plus one exclusive extra choice "4th only" - pg->Append( new wxEnumProperty(wxT("EnumProperty 4"),wxPG_LABEL, + pg->Append( new wxEnumProperty("EnumProperty 4",wxPG_LABEL, soc, 240 ) ); - pg->GetProperty(wxT("EnumProperty 4"))->AddChoice(wxT("4th only"), 360); + pg->GetProperty("EnumProperty 4")->AddChoice("4th only", 360); - pg->SetPropertyHelpString(wxT("EnumProperty 4"), - wxT("Should have one extra item when compared to EnumProperty 3")); + pg->SetPropertyHelpString("EnumProperty 4", + "Should have one extra item when compared to EnumProperty 3"); // Plus property value bitmap pg->Append( new wxEnumProperty(wxS("EnumProperty With Bitmap"), wxS("EnumProperty 5"), soc, 280) ); pg->SetPropertyHelpString(wxS("EnumProperty 5"), - wxS("Should have bitmap in front of the displayed value")); + "Should have bitmap in front of the displayed value"); wxBitmap bmpVal = wxArtProvider::GetBitmap(wxART_REMOVABLE); - pg->SetPropertyImage(wxS("EnumProperty 5"), bmpVal); + pg->SetPropertyImage("EnumProperty 5", bmpVal); // Password property example. - pg->Append( new wxStringProperty(wxT("Password"),wxPG_LABEL, wxT("password")) ); - pg->SetPropertyAttribute( wxT("Password"), wxPG_STRING_PASSWORD, true ); - pg->SetPropertyHelpString( wxT("Password"), - wxT("Has attribute wxPG_STRING_PASSWORD set to true") ); + pg->Append( new wxStringProperty("Password",wxPG_LABEL, "password") ); + pg->SetPropertyAttribute( "Password", wxPG_STRING_PASSWORD, true ); + pg->SetPropertyHelpString( "Password", + "Has attribute wxPG_STRING_PASSWORD set to true" ); // String editor with dir selector button. Uses wxEmptyString as name, which // is allowed (naturally, in this case property cannot be accessed by name). - pg->Append( new wxDirProperty( wxT("DirProperty"), wxPG_LABEL, ::wxGetUserHome()) ); - pg->SetPropertyAttribute( wxT("DirProperty"), + pg->Append( new wxDirProperty( "DirProperty", wxPG_LABEL, ::wxGetUserHome()) ); + pg->SetPropertyAttribute( "DirProperty", wxPG_DIR_DIALOG_MESSAGE, - wxT("This is a custom dir dialog message") ); + "This is a custom dir dialog message" ); // Add string property - first arg is label, second name, and third initial value - pg->Append( new wxStringProperty ( wxT("StringProperty"), wxPG_LABEL ) ); - pg->SetPropertyMaxLength( wxT("StringProperty"), 6 ); - pg->SetPropertyHelpString( wxT("StringProperty"), - wxT("Max length of this text has been limited to 6, using wxPropertyGrid::SetPropertyMaxLength.") ); + pg->Append( new wxStringProperty ( "StringProperty", wxPG_LABEL ) ); + pg->SetPropertyMaxLength( "StringProperty", 6 ); + pg->SetPropertyHelpString( "StringProperty", + "Max length of this text has been limited to 6, using wxPropertyGrid::SetPropertyMaxLength." ); // Set value after limiting so that it will be applied - pg->SetPropertyValue( wxT("StringProperty"), wxT("some text") ); + pg->SetPropertyValue( "StringProperty", "some text" ); // // Demonstrate "AutoComplete" attribute - pg->Append( new wxStringProperty( wxT("StringProperty AutoComplete"), + pg->Append( new wxStringProperty( "StringProperty AutoComplete", wxPG_LABEL ) ); wxArrayString autoCompleteStrings; - autoCompleteStrings.Add(wxT("One choice")); - autoCompleteStrings.Add(wxT("Another choice")); - autoCompleteStrings.Add(wxT("Another choice, yeah")); - autoCompleteStrings.Add(wxT("Yet another choice")); - autoCompleteStrings.Add(wxT("Yet another choice, bear with me")); - pg->SetPropertyAttribute( wxT("StringProperty AutoComplete"), + autoCompleteStrings.Add("One choice"); + autoCompleteStrings.Add("Another choice"); + autoCompleteStrings.Add("Another choice, yeah"); + autoCompleteStrings.Add("Yet another choice"); + autoCompleteStrings.Add("Yet another choice, bear with me"); + pg->SetPropertyAttribute( "StringProperty AutoComplete", wxPG_ATTR_AUTOCOMPLETE, autoCompleteStrings ); - pg->SetPropertyHelpString( wxT("StringProperty AutoComplete"), - wxT("AutoComplete attribute has been set for this property ") - wxT("(try writing something beginning with 'a', 'o' or 'y').")); + pg->SetPropertyHelpString( "StringProperty AutoComplete", + "AutoComplete attribute has been set for this property " + "(try writing something beginning with 'a', 'o' or 'y')."); // Add string property with arbitrarily wide bitmap in front of it. We // intentionally lower-than-typical row height here so that the ugly // scaling code won't be run. - pg->Append( new wxStringProperty( wxT("StringPropertyWithBitmap"), + pg->Append( new wxStringProperty( "StringPropertyWithBitmap", wxPG_LABEL, - wxT("Test Text")) ); + "Test Text") ); wxBitmap myTestBitmap(60, 15, 32); wxMemoryDC mdc; mdc.SelectObject(myTestBitmap); @@ -1407,80 +1400,80 @@ void FormMain::PopulateWithExamples () mdc.SetPen(*wxBLACK); mdc.DrawLine(0, 0, 60, 15); mdc.SelectObject(wxNullBitmap); - pg->SetPropertyImage( wxT("StringPropertyWithBitmap"), myTestBitmap ); + pg->SetPropertyImage( "StringPropertyWithBitmap", myTestBitmap ); // this value array would be optional if values matched string indexes //long flags_prop_values[] = { wxICONIZE, wxCAPTION, wxMINIMIZE_BOX, wxMAXIMIZE_BOX }; - //pg->Append( wxFlagsProperty(wxT("Example of FlagsProperty"),wxT("FlagsProp"), + //pg->Append( wxFlagsProperty("Example of FlagsProperty","FlagsProp", // flags_prop_labels, flags_prop_values, 0, GetWindowStyle() ) ); // Multi choice dialog. wxArrayString tchoices; - tchoices.Add(wxT("Cabbage")); - tchoices.Add(wxT("Carrot")); - tchoices.Add(wxT("Onion")); - tchoices.Add(wxT("Potato")); - tchoices.Add(wxT("Strawberry")); + tchoices.Add("Cabbage"); + tchoices.Add("Carrot"); + tchoices.Add("Onion"); + tchoices.Add("Potato"); + tchoices.Add("Strawberry"); wxArrayString tchoicesValues; - tchoicesValues.Add(wxT("Carrot")); - tchoicesValues.Add(wxT("Potato")); + tchoicesValues.Add("Carrot"); + tchoicesValues.Add("Potato"); - pg->Append( new wxEnumProperty(wxT("EnumProperty X"),wxPG_LABEL, tchoices ) ); + pg->Append( new wxEnumProperty("EnumProperty X",wxPG_LABEL, tchoices ) ); - pg->Append( new wxMultiChoiceProperty( wxT("MultiChoiceProperty"), wxPG_LABEL, + pg->Append( new wxMultiChoiceProperty( "MultiChoiceProperty", wxPG_LABEL, tchoices, tchoicesValues ) ); - pg->SetPropertyAttribute( wxT("MultiChoiceProperty"), wxPG_ATTR_MULTICHOICE_USERSTRINGMODE, true ); + pg->SetPropertyAttribute( "MultiChoiceProperty", wxPG_ATTR_MULTICHOICE_USERSTRINGMODE, true ); - pg->Append( new wxSizeProperty( wxT("SizeProperty"), wxT("Size"), GetSize() ) ); - pg->Append( new wxPointProperty( wxT("PointProperty"), wxT("Position"), GetPosition() ) ); + pg->Append( new wxSizeProperty( "SizeProperty", "Size", GetSize() ) ); + pg->Append( new wxPointProperty( "PointProperty", "Position", GetPosition() ) ); // UInt samples #if wxUSE_LONGLONG - pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE)))); + pg->Append( new wxUIntProperty( "UIntProperty", wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE)))); #else - pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, 0xFEEEFEEE)); + pg->Append( new wxUIntProperty( "UIntProperty", wxPG_LABEL, 0xFEEEFEEE)); #endif - pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); - pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_BASE, wxPG_BASE_HEX ); - //pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); - //pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_BASE, wxPG_BASE_OCT ); + pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); + pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_BASE, wxPG_BASE_HEX ); + //pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); + //pg->SetPropertyAttribute( "UIntProperty", wxPG_UINT_BASE, wxPG_BASE_OCT ); // // wxEditEnumProperty wxPGChoices eech; - eech.Add(wxT("Choice 1")); - eech.Add(wxT("Choice 2")); - eech.Add(wxT("Choice 3")); - pg->Append( new wxEditEnumProperty(wxT("EditEnumProperty"), + eech.Add("Choice 1"); + eech.Add("Choice 2"); + eech.Add("Choice 3"); + pg->Append( new wxEditEnumProperty("EditEnumProperty", wxPG_LABEL, eech, - wxT("Choice not in the list")) ); + "Choice not in the list") ); // Test Hint attribute in EditEnumProperty - pg->GetProperty(wxT("EditEnumProperty"))->SetAttribute(wxPG_ATTR_HINT, wxT("Dummy Hint")); + pg->GetProperty("EditEnumProperty")->SetAttribute(wxPG_ATTR_HINT, "Dummy Hint"); //wxString v_; //wxTextValidator validator1(wxFILTER_NUMERIC,&v_); - //pg->SetPropertyValidator( wxT("EditEnumProperty"), validator1 ); + //pg->SetPropertyValidator( "EditEnumProperty", validator1 ); #if wxUSE_DATETIME // // wxDateTimeProperty - pg->Append( new wxDateProperty(wxT("DateProperty"), wxPG_LABEL, wxDateTime::Now() ) ); + pg->Append( new wxDateProperty("DateProperty", wxPG_LABEL, wxDateTime::Now() ) ); #if wxUSE_DATEPICKCTRL - pg->SetPropertyAttribute( wxT("DateProperty"), wxPG_DATE_PICKER_STYLE, + pg->SetPropertyAttribute( "DateProperty", wxPG_DATE_PICKER_STYLE, (long)(wxDP_DROPDOWN | wxDP_SHOWCENTURY | wxDP_ALLOWNONE) ); - pg->SetPropertyHelpString( wxT("DateProperty"), - wxT("Attribute wxPG_DATE_PICKER_STYLE has been set to (long)") - wxT("(wxDP_DROPDOWN | wxDP_SHOWCENTURY | wxDP_ALLOWNONE).") ); + pg->SetPropertyHelpString( "DateProperty", + "Attribute wxPG_DATE_PICKER_STYLE has been set to (long)" + "(wxDP_DROPDOWN | wxDP_SHOWCENTURY | wxDP_ALLOWNONE)." ); #endif #endif @@ -1489,61 +1482,61 @@ void FormMain::PopulateWithExamples () // Add Triangle properties as both wxTriangleProperty and // a generic parent property (using wxStringProperty). // - wxPGProperty* topId = pg->Append( new wxStringProperty(wxT("3D Object"), wxPG_LABEL, wxT("")) ); + wxPGProperty* topId = pg->Append( new wxStringProperty("3D Object", wxPG_LABEL, "") ); - pid = pg->AppendIn( topId, new wxStringProperty(wxT("Triangle 1"), wxT("Triangle 1"), wxT("")) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("A"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("B"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("C"), wxPG_LABEL ) ); + pid = pg->AppendIn( topId, new wxStringProperty("Triangle 1", "Triangle 1", "") ); + pg->AppendIn( pid, new wxVectorProperty( "A", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "B", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "C", wxPG_LABEL ) ); - pg->AppendIn( topId, new wxTriangleProperty( wxT("Triangle 2"), wxT("Triangle 2") ) ); + pg->AppendIn( topId, new wxTriangleProperty( "Triangle 2", "Triangle 2" ) ); - pg->SetPropertyHelpString( wxT("3D Object"), - wxT("3D Object is wxStringProperty with value \"\". Two of its children are similar wxStringProperties with ") - wxT("three wxVectorProperty children, and other two are custom wxTriangleProperties.") ); + pg->SetPropertyHelpString( "3D Object", + "3D Object is wxStringProperty with value \"\". Two of its children are similar wxStringProperties with " + "three wxVectorProperty children, and other two are custom wxTriangleProperties." ); - pid = pg->AppendIn( topId, new wxStringProperty(wxT("Triangle 3"), wxT("Triangle 3"), wxT("")) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("A"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("B"), wxPG_LABEL ) ); - pg->AppendIn( pid, new wxVectorProperty( wxT("C"), wxPG_LABEL ) ); + pid = pg->AppendIn( topId, new wxStringProperty("Triangle 3", "Triangle 3", "") ); + pg->AppendIn( pid, new wxVectorProperty( "A", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "B", wxPG_LABEL ) ); + pg->AppendIn( pid, new wxVectorProperty( "C", wxPG_LABEL ) ); - pg->AppendIn( topId, new wxTriangleProperty( wxT("Triangle 4"), wxT("Triangle 4") ) ); + pg->AppendIn( topId, new wxTriangleProperty( "Triangle 4", "Triangle 4" ) ); // // This snippet is a doc sample test // - wxPGProperty* carProp = pg->Append(new wxStringProperty(wxT("Car"), + wxPGProperty* carProp = pg->Append(new wxStringProperty("Car", wxPG_LABEL, - wxT(""))); + "")); - pg->AppendIn(carProp, new wxStringProperty(wxT("Model"), + pg->AppendIn(carProp, new wxStringProperty("Model", wxPG_LABEL, - wxT("Lamborghini Diablo SV"))); + "Lamborghini Diablo SV")); - pg->AppendIn(carProp, new wxIntProperty(wxT("Engine Size (cc)"), + pg->AppendIn(carProp, new wxIntProperty("Engine Size (cc)", wxPG_LABEL, 5707) ); wxPGProperty* speedsProp = pg->AppendIn(carProp, - new wxStringProperty(wxT("Speeds"), + new wxStringProperty("Speeds", wxPG_LABEL, - wxT(""))); + "")); - pg->AppendIn( speedsProp, new wxIntProperty(wxT("Max. Speed (mph)"), + pg->AppendIn( speedsProp, new wxIntProperty("Max. Speed (mph)", wxPG_LABEL,290) ); - pg->AppendIn( speedsProp, new wxFloatProperty(wxT("0-100 mph (sec)"), + pg->AppendIn( speedsProp, new wxFloatProperty("0-100 mph (sec)", wxPG_LABEL,3.9) ); - pg->AppendIn( speedsProp, new wxFloatProperty(wxT("1/4 mile (sec)"), + pg->AppendIn( speedsProp, new wxFloatProperty("1/4 mile (sec)", wxPG_LABEL,8.6) ); // This is how child property can be referred to by name - pg->SetPropertyValue( wxT("Car.Speeds.Max. Speed (mph)"), 300 ); + pg->SetPropertyValue( "Car.Speeds.Max. Speed (mph)", 300 ); - pg->AppendIn(carProp, new wxIntProperty(wxT("Price ($)"), + pg->AppendIn(carProp, new wxIntProperty("Price ($)", wxPG_LABEL, 300000) ); - pg->AppendIn(carProp, new wxBoolProperty(wxT("Convertible"), + pg->AppendIn(carProp, new wxBoolProperty("Convertible", wxPG_LABEL, false) ); @@ -1552,53 +1545,53 @@ void FormMain::PopulateWithExamples () // // Test wxSampleMultiButtonEditor - pg->Append( new wxLongStringProperty(wxT("MultipleButtons"), wxPG_LABEL) ); - pg->SetPropertyEditor(wxT("MultipleButtons"), m_pSampleMultiButtonEditor ); + pg->Append( new wxLongStringProperty("MultipleButtons", wxPG_LABEL) ); + pg->SetPropertyEditor("MultipleButtons", m_pSampleMultiButtonEditor ); // Test SingleChoiceProperty - pg->Append( new SingleChoiceProperty(wxT("SingleChoiceProperty")) ); + pg->Append( new SingleChoiceProperty("SingleChoiceProperty") ); // // Test adding variable height bitmaps in wxPGChoices wxPGChoices bc; - bc.Add(wxT("Wee"), + bc.Add("Wee", wxArtProvider::GetBitmap(wxART_CDROM, wxART_OTHER, wxSize(16, 16))); - bc.Add(wxT("Not so wee"), + bc.Add("Not so wee", wxArtProvider::GetBitmap(wxART_FLOPPY, wxART_OTHER, wxSize(32, 32))); - bc.Add(wxT("Friggin' huge"), + bc.Add("Friggin' huge", wxArtProvider::GetBitmap(wxART_HARDDISK, wxART_OTHER, wxSize(64, 64))); - pg->Append( new wxEnumProperty(wxT("Variable Height Bitmaps"), + pg->Append( new wxEnumProperty("Variable Height Bitmaps", wxPG_LABEL, bc, 0) ); // // Test how non-editable composite strings appear - pid = new wxStringProperty(wxT("wxWidgets Traits"), wxPG_LABEL, wxT("")); + pid = new wxStringProperty("wxWidgets Traits", wxPG_LABEL, ""); pg->SetPropertyReadOnly(pid); // // For testing purposes, combine two methods of adding children // - pid->AppendChild( new wxStringProperty(wxT("Latest Release"), + pid->AppendChild( new wxStringProperty("Latest Release", wxPG_LABEL, - wxT("3.0.2"))); - pid->AppendChild( new wxBoolProperty(wxT("Win API"), + "3.0.2")); + pid->AppendChild( new wxBoolProperty("Win API", wxPG_LABEL, true) ); pg->Append( pid ); - pg->AppendIn(pid, new wxBoolProperty(wxT("QT"), wxPG_LABEL, true) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("Cocoa"), wxPG_LABEL, true) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("BeOS"), wxPG_LABEL, false) ); - pg->AppendIn(pid, new wxStringProperty(wxT("Trunk Version"), wxPG_LABEL, wxT("3.1.0")) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("GTK+"), wxPG_LABEL, true) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("Sky OS"), wxPG_LABEL, false) ); - pg->AppendIn(pid, new wxBoolProperty(wxT("Android"), wxPG_LABEL, false) ); + pg->AppendIn(pid, new wxBoolProperty("QT", wxPG_LABEL, true) ); + pg->AppendIn(pid, new wxBoolProperty("Cocoa", wxPG_LABEL, true) ); + pg->AppendIn(pid, new wxBoolProperty("BeOS", wxPG_LABEL, false) ); + pg->AppendIn(pid, new wxStringProperty("Trunk Version", wxPG_LABEL, "3.1.0") ); + pg->AppendIn(pid, new wxBoolProperty("GTK+", wxPG_LABEL, true) ); + pg->AppendIn(pid, new wxBoolProperty("Sky OS", wxPG_LABEL, false) ); + pg->AppendIn(pid, new wxBoolProperty("Android", wxPG_LABEL, false) ); AddTestProperties(pg); } @@ -1608,7 +1601,7 @@ void FormMain::PopulateWithExamples () void FormMain::PopulateWithLibraryConfig () { wxPropertyGridManager* pgman = m_pPropGridManager; - wxPropertyGridPage* pg = pgman->GetPage(wxT("wxWidgets Library Config")); + wxPropertyGridPage* pg = pgman->GetPage("wxWidgets Library Config"); // Set custom column proportions (here in the sample app we need // to check if the grid has wxPG_SPLITTER_AUTO_CENTER style. You usually @@ -1628,10 +1621,10 @@ void FormMain::PopulateWithLibraryConfig () wxFont italicFont = pgman->GetGrid()->GetCaptionFont(); italicFont.SetStyle(wxFONTSTYLE_ITALIC); - wxString italicFontHelp = wxT("Font of this property's wxPGCell has ") - wxT("been modified. Obtain property's cell ") - wxT("with wxPGProperty::") - wxT("GetOrCreateCell(column)."); + wxString italicFontHelp = "Font of this property's wxPGCell has " + "been modified. Obtain property's cell " + "with wxPGProperty::" + "GetOrCreateCell(column)."; #define ADD_WX_LIB_CONF_GROUP(A) \ cat = pg->AppendIn( pid, new wxPropertyCategory(A) ); \ @@ -1639,21 +1632,21 @@ void FormMain::PopulateWithLibraryConfig () cat->GetCell(0).SetFont(italicFont); \ cat->SetHelpString(italicFontHelp); -#define ADD_WX_LIB_CONF(A) pg->Append( new wxBoolProperty(wxT(#A),wxPG_LABEL,(bool)((A>0)?true:false))); -#define ADD_WX_LIB_CONF_NODEF(A) pg->Append( new wxBoolProperty(wxT(#A),wxPG_LABEL,(bool)false) ); \ - pg->DisableProperty(wxT(#A)); +#define ADD_WX_LIB_CONF(A) pg->Append( new wxBoolProperty(#A,wxPG_LABEL,(bool)((A>0)?true:false))); +#define ADD_WX_LIB_CONF_NODEF(A) pg->Append( new wxBoolProperty(#A,wxPG_LABEL,(bool)false) ); \ + pg->DisableProperty(#A); - pid = pg->Append( new wxPropertyCategory( wxT("wxWidgets Library Configuration") ) ); + pid = pg->Append( new wxPropertyCategory( "wxWidgets Library Configuration" ) ); pg->SetPropertyCell( pid, 0, wxPG_LABEL, bmp ); // Both of following lines would set a label for the second column - pg->SetPropertyCell( pid, 1, wxT("Is Enabled") ); - pid->SetValue(wxT("Is Enabled")); + pg->SetPropertyCell( pid, 1, "Is Enabled" ); + pid->SetValue("Is Enabled"); - ADD_WX_LIB_CONF_GROUP(wxT("Global Settings")) + ADD_WX_LIB_CONF_GROUP("Global Settings") ADD_WX_LIB_CONF( wxUSE_GUI ) - ADD_WX_LIB_CONF_GROUP(wxT("Compatibility Settings")) + ADD_WX_LIB_CONF_GROUP("Compatibility Settings") #if defined(WXWIN_COMPATIBILITY_2_8) ADD_WX_LIB_CONF( WXWIN_COMPATIBILITY_2_8 ) #endif @@ -1671,17 +1664,17 @@ void FormMain::PopulateWithLibraryConfig () ADD_WX_LIB_CONF_NODEF ( wxDIALOG_UNIT_COMPATIBILITY ) #endif - ADD_WX_LIB_CONF_GROUP(wxT("Debugging Settings")) + ADD_WX_LIB_CONF_GROUP("Debugging Settings") ADD_WX_LIB_CONF( wxUSE_DEBUG_CONTEXT ) ADD_WX_LIB_CONF( wxUSE_MEMORY_TRACING ) ADD_WX_LIB_CONF( wxUSE_GLOBAL_MEMORY_OPERATORS ) ADD_WX_LIB_CONF( wxUSE_DEBUG_NEW_ALWAYS ) ADD_WX_LIB_CONF( wxUSE_ON_FATAL_EXCEPTION ) - ADD_WX_LIB_CONF_GROUP(wxT("Unicode Support")) + ADD_WX_LIB_CONF_GROUP("Unicode Support") ADD_WX_LIB_CONF( wxUSE_UNICODE ) - ADD_WX_LIB_CONF_GROUP(wxT("Global Features")) + ADD_WX_LIB_CONF_GROUP("Global Features") ADD_WX_LIB_CONF( wxUSE_EXCEPTIONS ) ADD_WX_LIB_CONF( wxUSE_EXTENDED_RTTI ) ADD_WX_LIB_CONF( wxUSE_STL ) @@ -1694,7 +1687,7 @@ void FormMain::PopulateWithLibraryConfig () ADD_WX_LIB_CONF( wxUSE_STREAMS ) ADD_WX_LIB_CONF( wxUSE_STD_IOSTREAM ) - ADD_WX_LIB_CONF_GROUP(wxT("Non-GUI Features")) + ADD_WX_LIB_CONF_GROUP("Non-GUI Features") ADD_WX_LIB_CONF( wxUSE_LONGLONG ) ADD_WX_LIB_CONF( wxUSE_FILE ) ADD_WX_LIB_CONF( wxUSE_FFILE ) @@ -1790,15 +1783,15 @@ void wxMyPropertyGridPage::OnPropertySelect( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); wxUnusedVar(p); - wxLogDebug(wxT("wxMyPropertyGridPage::OnPropertySelect('%s' is %s"), + wxLogDebug("wxMyPropertyGridPage::OnPropertySelect('%s' is %s", p->GetName().c_str(), - IsPropertySelected(p)? wxT("selected"): wxT("unselected")); + IsPropertySelected(p)? "selected": "unselected"); } void wxMyPropertyGridPage::OnPropertyChange( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); - wxLogVerbose(wxT("wxMyPropertyGridPage::OnPropertyChange('%s', to value '%s')"), + wxLogVerbose("wxMyPropertyGridPage::OnPropertyChange('%s', to value '%s')", p->GetName().c_str(), p->GetDisplayedString().c_str()); } @@ -1806,14 +1799,14 @@ void wxMyPropertyGridPage::OnPropertyChange( wxPropertyGridEvent& event ) void wxMyPropertyGridPage::OnPropertyChanging( wxPropertyGridEvent& event ) { wxPGProperty* p = event.GetProperty(); - wxLogVerbose(wxT("wxMyPropertyGridPage::OnPropertyChanging('%s', to value '%s')"), + wxLogVerbose("wxMyPropertyGridPage::OnPropertyChanging('%s', to value '%s')", p->GetName().c_str(), event.GetValue().GetString().c_str()); } void wxMyPropertyGridPage::OnPageChange( wxPropertyGridEvent& WXUNUSED(event) ) { - wxLogDebug(wxT("wxMyPropertyGridPage::OnPageChange()")); + wxLogDebug("wxMyPropertyGridPage::OnPageChange()"); } @@ -1823,7 +1816,7 @@ public: void OnKeyEvent( wxKeyEvent& event ) { - wxMessageBox(wxString::Format(wxT("%i"),event.GetKeyCode())); + wxMessageBox(wxString::Format("%i",event.GetKeyCode())); event.Skip(); } private: @@ -1857,10 +1850,10 @@ void FormMain::FinalizePanel( bool wasCreated ) { // Button for tab traversal testing m_topSizer->Add( new wxButton(m_panel, wxID_ANY, - wxT("Should be able to move here with Tab")), + "Should be able to move here with Tab"), wxSizerFlags(0).Expand()); m_topSizer->Add( new wxButton(m_panel, ID_SHOWPOPUP, - wxT("Show Popup")), + "Show Popup"), wxSizerFlags(0).Expand()); m_panel->SetSizer( m_topSizer ); @@ -1879,20 +1872,20 @@ void FormMain::FinalizePanel( bool wasCreated ) void FormMain::PopulateGrid() { wxPropertyGridManager* pgman = m_pPropGridManager; - pgman->AddPage(wxT("Standard Items")); + pgman->AddPage("Standard Items"); PopulateWithStandardItems(); - pgman->AddPage(wxT("wxWidgets Library Config")); + pgman->AddPage("wxWidgets Library Config"); PopulateWithLibraryConfig(); wxPropertyGridPage* myPage = new wxMyPropertyGridPage(); - myPage->Append( new wxIntProperty ( wxT("IntProperty"), wxPG_LABEL, 12345678 ) ); + myPage->Append( new wxIntProperty ( "IntProperty", wxPG_LABEL, 12345678 ) ); // Use wxMyPropertyGridPage (see above) to test the // custom wxPropertyGridPage feature. - pgman->AddPage(wxT("Examples"),wxNullBitmap,myPage); + pgman->AddPage("Examples",wxNullBitmap,myPage); PopulateWithExamples(); } @@ -1932,8 +1925,8 @@ void FormMain::CreateGrid( int style, int extraStyle ) // // This shows how to combine two static choice descriptors - m_combinedFlags.Add( _fs_windowstyle_labels, _fs_windowstyle_values ); - m_combinedFlags.Add( _fs_framestyle_labels, _fs_framestyle_values ); + m_combinedFlags.Add( WXSIZEOF(_fs_windowstyle_labels), _fs_windowstyle_labels, _fs_windowstyle_values ); + m_combinedFlags.Add( WXSIZEOF(_fs_framestyle_labels), _fs_framestyle_labels, _fs_framestyle_values ); wxPropertyGridManager* pgman = m_pPropGridManager = new wxPropertyGridManager(m_panel, @@ -1957,7 +1950,7 @@ void FormMain::CreateGrid( int style, int extraStyle ) // // Set somewhat different unspecified value appearance wxPGCell cell; - cell.SetText(wxT("Unspecified")); + cell.SetText("Unspecified"); cell.SetFgCol(*wxLIGHT_GREY); m_propGrid->SetUnspecifiedValueAppearance(cell); @@ -2033,116 +2026,116 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size wxMenu *menuTools2 = new wxMenu; wxMenu *menuHelp = new wxMenu; - menuHelp->Append(ID_ABOUT, wxT("&About"), wxT("Show about dialog") ); + menuHelp->Append(ID_ABOUT, "&About", "Show about dialog" ); - menuTools1->Append(ID_APPENDPROP, wxT("Append New Property") ); - menuTools1->Append(ID_APPENDCAT, wxT("Append New Category\tCtrl-S") ); + menuTools1->Append(ID_APPENDPROP, "Append New Property" ); + menuTools1->Append(ID_APPENDCAT, "Append New Category\tCtrl-S" ); menuTools1->AppendSeparator(); - menuTools1->Append(ID_INSERTPROP, wxT("Insert New Property\tCtrl-I") ); - menuTools1->Append(ID_INSERTCAT, wxT("Insert New Category\tCtrl-W") ); + menuTools1->Append(ID_INSERTPROP, "Insert New Property\tCtrl-I" ); + menuTools1->Append(ID_INSERTCAT, "Insert New Category\tCtrl-W" ); menuTools1->AppendSeparator(); - menuTools1->Append(ID_DELETE, wxT("Delete Selected") ); - menuTools1->Append(ID_DELETER, wxT("Delete Random") ); - menuTools1->Append(ID_DELETEALL, wxT("Delete All") ); + menuTools1->Append(ID_DELETE, "Delete Selected" ); + menuTools1->Append(ID_DELETER, "Delete Random" ); + menuTools1->Append(ID_DELETEALL, "Delete All" ); menuTools1->AppendSeparator(); - menuTools1->Append(ID_SETBGCOLOUR, wxT("Set Bg Colour") ); - menuTools1->Append(ID_SETBGCOLOURRECUR, wxT("Set Bg Colour (Recursively)") ); - menuTools1->Append(ID_UNSPECIFY, wxT("Set Value to Unspecified")); + menuTools1->Append(ID_SETBGCOLOUR, "Set Bg Colour" ); + menuTools1->Append(ID_SETBGCOLOURRECUR, "Set Bg Colour (Recursively)" ); + menuTools1->Append(ID_UNSPECIFY, "Set Value to Unspecified"); menuTools1->AppendSeparator(); - m_itemEnable = menuTools1->Append(ID_ENABLE, wxT("Enable"), - wxT("Toggles item's enabled state.") ); + m_itemEnable = menuTools1->Append(ID_ENABLE, "Enable", + "Toggles item's enabled state." ); m_itemEnable->Enable( false ); - menuTools1->Append(ID_HIDE, wxT("Hide"), wxT("Hides a property") ); - menuTools1->Append(ID_SETREADONLY, wxT("Set as Read-Only"), - wxT("Set property as read-only") ); + menuTools1->Append(ID_HIDE, "Hide", "Hides a property" ); + menuTools1->Append(ID_SETREADONLY, "Set as Read-Only", + "Set property as read-only" ); - menuTools2->Append(ID_ITERATE1, wxT("Iterate Over Properties") ); - menuTools2->Append(ID_ITERATE2, wxT("Iterate Over Visible Items") ); - menuTools2->Append(ID_ITERATE3, wxT("Reverse Iterate Over Properties") ); - menuTools2->Append(ID_ITERATE4, wxT("Iterate Over Categories") ); + menuTools2->Append(ID_ITERATE1, "Iterate Over Properties" ); + menuTools2->Append(ID_ITERATE2, "Iterate Over Visible Items" ); + menuTools2->Append(ID_ITERATE3, "Reverse Iterate Over Properties" ); + menuTools2->Append(ID_ITERATE4, "Iterate Over Categories" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_ONEXTENDEDKEYNAV, wxT("Extend Keyboard Navigation"), - wxT("This will set Enter to navigate to next property, ") - wxT("and allows arrow keys to navigate even when in ") - wxT("editor control.")); + menuTools2->Append(ID_ONEXTENDEDKEYNAV, "Extend Keyboard Navigation", + "This will set Enter to navigate to next property, " + "and allows arrow keys to navigate even when in " + "editor control."); menuTools2->AppendSeparator(); - menuTools2->Append(ID_SETPROPERTYVALUE, wxT("Set Property Value") ); - menuTools2->Append(ID_CLEARMODIF, wxT("Clear Modified Status"), wxT("Clears wxPG_MODIFIED flag from all properties.") ); + menuTools2->Append(ID_SETPROPERTYVALUE, "Set Property Value" ); + menuTools2->Append(ID_CLEARMODIF, "Clear Modified Status", "Clears wxPG_MODIFIED flag from all properties." ); menuTools2->AppendSeparator(); - m_itemFreeze = menuTools2->AppendCheckItem(ID_FREEZE, wxT("Freeze"), - wxT("Disables painting, auto-sorting, etc.") ); + m_itemFreeze = menuTools2->AppendCheckItem(ID_FREEZE, "Freeze", + "Disables painting, auto-sorting, etc." ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_DUMPLIST, wxT("Display Values as wxVariant List"), wxT("Tests GetAllValues method and wxVariant conversion.") ); + menuTools2->Append(ID_DUMPLIST, "Display Values as wxVariant List", "Tests GetAllValues method and wxVariant conversion." ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_GETVALUES, wxT("Get Property Values"), wxT("Stores all property values.") ); - menuTools2->Append(ID_SETVALUES, wxT("Set Property Values"), wxT("Reverts property values to those last stored.") ); - menuTools2->Append(ID_SETVALUES2, wxT("Set Property Values 2"), wxT("Adds property values that should not initially be as items (so new items are created).") ); + menuTools2->Append(ID_GETVALUES, "Get Property Values", "Stores all property values." ); + menuTools2->Append(ID_SETVALUES, "Set Property Values", "Reverts property values to those last stored." ); + menuTools2->Append(ID_SETVALUES2, "Set Property Values 2", "Adds property values that should not initially be as items (so new items are created)." ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_SAVESTATE, wxT("Save Editable State") ); - menuTools2->Append(ID_RESTORESTATE, wxT("Restore Editable State") ); + menuTools2->Append(ID_SAVESTATE, "Save Editable State" ); + menuTools2->Append(ID_RESTORESTATE, "Restore Editable State" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_ENABLECOMMONVALUES, wxT("Enable Common Value"), - wxT("Enable values that are common to all properties, for selected property.")); + menuTools2->Append(ID_ENABLECOMMONVALUES, "Enable Common Value", + "Enable values that are common to all properties, for selected property."); menuTools2->AppendSeparator(); - menuTools2->Append(ID_COLLAPSE, wxT("Collapse Selected") ); - menuTools2->Append(ID_COLLAPSEALL, wxT("Collapse All") ); + menuTools2->Append(ID_COLLAPSE, "Collapse Selected" ); + menuTools2->Append(ID_COLLAPSEALL, "Collapse All" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_INSERTPAGE, wxT("Add Page") ); - menuTools2->Append(ID_REMOVEPAGE, wxT("Remove Page") ); + menuTools2->Append(ID_INSERTPAGE, "Add Page" ); + menuTools2->Append(ID_REMOVEPAGE, "Remove Page" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_FITCOLUMNS, wxT("Fit Columns") ); + menuTools2->Append(ID_FITCOLUMNS, "Fit Columns" ); m_itemVetoDragging = menuTools2->AppendCheckItem(ID_VETOCOLDRAG, - wxT("Veto Column Dragging")); + "Veto Column Dragging"); menuTools2->AppendSeparator(); - menuTools2->Append(ID_CHANGEFLAGSITEMS, wxT("Change Children of FlagsProp") ); + menuTools2->Append(ID_CHANGEFLAGSITEMS, "Change Children of FlagsProp" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_TESTINSERTCHOICE, wxT("Test InsertPropertyChoice") ); - menuTools2->Append(ID_TESTDELETECHOICE, wxT("Test DeletePropertyChoice") ); + menuTools2->Append(ID_TESTINSERTCHOICE, "Test InsertPropertyChoice" ); + menuTools2->Append(ID_TESTDELETECHOICE, "Test DeletePropertyChoice" ); menuTools2->AppendSeparator(); - menuTools2->Append(ID_SETSPINCTRLEDITOR, wxT("Use SpinCtrl Editor") ); - menuTools2->Append(ID_TESTREPLACE, wxT("Test ReplaceProperty") ); + menuTools2->Append(ID_SETSPINCTRLEDITOR, "Use SpinCtrl Editor" ); + menuTools2->Append(ID_TESTREPLACE, "Test ReplaceProperty" ); - menuTry->Append(ID_SELECTSTYLE, wxT("Set Window Style"), - wxT("Select window style flags used by the grid.")); - menuTry->AppendCheckItem(ID_ENABLELABELEDITING, wxT("Enable label editing"), - wxT("This calls wxPropertyGrid::MakeColumnEditable(0)")); + menuTry->Append(ID_SELECTSTYLE, "Set Window Style", + "Select window style flags used by the grid."); + menuTry->AppendCheckItem(ID_ENABLELABELEDITING, "Enable label editing", + "This calls wxPropertyGrid::MakeColumnEditable(0)"); #if wxUSE_HEADERCTRL menuTry->AppendCheckItem(ID_SHOWHEADER, - wxT("Enable header"), - wxT("This calls wxPropertyGridManager::ShowHeader()")); + "Enable header", + "This calls wxPropertyGridManager::ShowHeader()"); #endif // wxUSE_HEADERCTRL menuTry->AppendSeparator(); - menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard Colour Scheme") ); - menuTry->AppendRadioItem( ID_COLOURSCHEME2, wxT("White Colour Scheme") ); - menuTry->AppendRadioItem( ID_COLOURSCHEME3, wxT(".NET Colour Scheme") ); - menuTry->AppendRadioItem( ID_COLOURSCHEME4, wxT("Cream Colour Scheme") ); + menuTry->AppendRadioItem( ID_COLOURSCHEME1, "Standard Colour Scheme" ); + menuTry->AppendRadioItem( ID_COLOURSCHEME2, "White Colour Scheme" ); + menuTry->AppendRadioItem( ID_COLOURSCHEME3, ".NET Colour Scheme" ); + menuTry->AppendRadioItem( ID_COLOURSCHEME4, "Cream Colour Scheme" ); menuTry->AppendSeparator(); - m_itemCatColours = menuTry->AppendCheckItem(ID_CATCOLOURS, wxT("Category Specific Colours"), - wxT("Switches between category-specific cell colours and default scheme (actually done using SetPropertyTextColour and SetPropertyBackgroundColour).") ); + m_itemCatColours = menuTry->AppendCheckItem(ID_CATCOLOURS, "Category Specific Colours", + "Switches between category-specific cell colours and default scheme (actually done using SetPropertyTextColour and SetPropertyBackgroundColour)." ); menuTry->AppendSeparator(); - menuTry->AppendCheckItem(ID_STATICLAYOUT, wxT("Static Layout"), - wxT("Switches between user-modifiable and static layouts.") ); - menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, wxT("Render Boolean values as checkboxes"), - wxT("Renders Boolean values as checkboxes")); - menuTry->Append(ID_SETCOLUMNS, wxT("Set Number of Columns") ); + menuTry->AppendCheckItem(ID_STATICLAYOUT, "Static Layout", + "Switches between user-modifiable and static layouts." ); + menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, "Render Boolean values as checkboxes", + "Renders Boolean values as checkboxes"); + menuTry->Append(ID_SETCOLUMNS, "Set Number of Columns" ); menuTry->AppendSeparator(); - menuTry->Append(ID_TESTXRC, wxT("Display XRC sample") ); + menuTry->Append(ID_TESTXRC, "Display XRC sample" ); - menuFile->Append(ID_RUNMINIMAL, wxT("Run Minimal Sample") ); + menuFile->Append(ID_RUNMINIMAL, "Run Minimal Sample" ); menuFile->AppendSeparator(); - menuFile->Append(ID_RUNTESTFULL, wxT("Run Tests (full)") ); - menuFile->Append(ID_RUNTESTPARTIAL, wxT("Run Tests (fast)") ); + menuFile->Append(ID_RUNTESTFULL, "Run Tests (full)" ); + menuFile->Append(ID_RUNTESTPARTIAL, "Run Tests (fast)" ); menuFile->AppendSeparator(); - menuFile->Append(ID_QUIT, wxT("E&xit\tAlt-X"), wxT("Quit this program") ); + menuFile->Append(ID_QUIT, "E&xit\tAlt-X", "Quit this program" ); // Now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, wxT("&File") ); - menuBar->Append(menuTry, wxT("&Try These!") ); - menuBar->Append(menuTools1, wxT("&Basic") ); - menuBar->Append(menuTools2, wxT("&Advanced") ); - menuBar->Append(menuHelp, wxT("&Help") ); + menuBar->Append(menuFile, "&File" ); + menuBar->Append(menuTry, "&Try These!" ); + menuBar->Append(menuTools1, "&Basic" ); + menuBar->Append(menuTools2, "&Advanced" ); + menuBar->Append(menuHelp, "&Help" ); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -2157,7 +2150,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size #if wxUSE_LOGWINDOW // Create log window - m_logWindow = new wxLogWindow(this, wxT("Log Messages"), false); + m_logWindow = new wxLogWindow(this, "Log Messages", false); m_logWindow->GetFrame()->Move(GetPosition().x + GetSize().x + 10, GetPosition().y); m_logWindow->Show(); @@ -2193,7 +2186,7 @@ void GenerateUniquePropertyLabel( wxPropertyGridManager* pg, wxString& baselabel for (;;) { count++; - newlabel.Printf(wxT("%s%i"),baselabel.c_str(),count); + newlabel.Printf("%s%i",baselabel.c_str(),count); if ( !pg->GetPropertyByLabel( newlabel ) ) break; } } @@ -2212,17 +2205,17 @@ void FormMain::OnInsertPropClick( wxCommandEvent& WXUNUSED(event) ) if ( !m_pPropGridManager->GetGrid()->GetRoot()->GetChildCount() ) { - wxMessageBox(wxT("No items to relate - first add some with Append.")); + wxMessageBox("No items to relate - first add some with Append."); return; } wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property - new one will be inserted right before that.")); + wxMessageBox("First select a property - new one will be inserted right before that."); return; } - if ( propLabel.Len() < 1 ) propLabel = wxT("Property"); + if ( propLabel.Len() < 1 ) propLabel = "Property"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2238,7 +2231,7 @@ void FormMain::OnAppendPropClick( wxCommandEvent& WXUNUSED(event) ) { wxString propLabel; - if ( propLabel.Len() < 1 ) propLabel = wxT("Property"); + if ( propLabel.Len() < 1 ) propLabel = "Property"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2260,7 +2253,7 @@ void FormMain::OnAppendCatClick( wxCommandEvent& WXUNUSED(event) ) { wxString propLabel; - if ( propLabel.Len() < 1 ) propLabel = wxT("Category"); + if ( propLabel.Len() < 1 ) propLabel = "Category"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2278,18 +2271,18 @@ void FormMain::OnInsertCatClick( wxCommandEvent& WXUNUSED(event) ) if ( !m_pPropGridManager->GetGrid()->GetRoot()->GetChildCount() ) { - wxMessageBox(wxT("No items to relate - first add some with Append.")); + wxMessageBox("No items to relate - first add some with Append."); return; } wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property - new one will be inserted right before that.")); + wxMessageBox("First select a property - new one will be inserted right before that."); return; } - if ( propLabel.Len() < 1 ) propLabel = wxT("Category"); + if ( propLabel.Len() < 1 ) propLabel = "Category"; GenerateUniquePropertyLabel( m_pPropGridManager, propLabel ); @@ -2305,7 +2298,7 @@ void FormMain::OnDelPropClick( wxCommandEvent& WXUNUSED(event) ) wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } @@ -2340,7 +2333,7 @@ void FormMain::OnDelPropRClick( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnContextMenu( wxContextMenuEvent& event ) { - wxLogDebug(wxT("FormMain::OnContextMenu(%i,%i)"), + wxLogDebug("FormMain::OnContextMenu(%i,%i)", event.GetPosition().x,event.GetPosition().y); wxUnusedVar(event); @@ -2354,7 +2347,7 @@ void FormMain::OnCloseClick( wxCommandEvent& WXUNUSED(event) ) { /*#ifdef __WXDEBUG__ m_pPropGridManager->GetGrid()->DumpAllocatedChoiceSets(); - wxLogDebug(wxT("\\-> Don't worry, this is perfectly normal in this sample.")); + wxLogDebug("\\-> Don't worry, this is perfectly normal in this sample."); #endif*/ Close(false); @@ -2366,10 +2359,10 @@ int IterateMessage( wxPGProperty* prop ) { wxString s; - s.Printf( wxT("\"%s\" class = %s, valuetype = %s"), prop->GetLabel().c_str(), + s.Printf( "\"%s\" class = %s, valuetype = %s", prop->GetLabel().c_str(), prop->GetClassInfo()->GetClassName(), prop->GetValueType().c_str() ); - return wxMessageBox( s, wxT("Iterating... (press CANCEL to end)"), wxOK|wxCANCEL ); + return wxMessageBox( s, "Iterating... (press CANCEL to end)", wxOK|wxCANCEL ); } // ----------------------------------------------------------------------- @@ -2492,14 +2485,14 @@ void FormMain::OnFitColumnsClick( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnChangeFlagsPropItemsClick( wxCommandEvent& WXUNUSED(event) ) { - wxPGProperty* p = m_pPropGridManager->GetPropertyByName(wxT("Window Styles")); + wxPGProperty* p = m_pPropGridManager->GetPropertyByName("Window Styles"); wxPGChoices newChoices; - newChoices.Add(wxT("Fast"),0x1); - newChoices.Add(wxT("Powerful"),0x2); - newChoices.Add(wxT("Safe"),0x4); - newChoices.Add(wxT("Sleek"),0x8); + newChoices.Add("Fast",0x1); + newChoices.Add("Powerful",0x2); + newChoices.Add("Safe",0x4); + newChoices.Add("Sleek",0x8); p->SetChoices(newChoices); } @@ -2511,19 +2504,19 @@ void FormMain::OnEnableDisable( wxCommandEvent& ) wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } if ( m_pPropGridManager->IsPropertyEnabled( id ) ) { m_pPropGridManager->DisableProperty ( id ); - m_itemEnable->SetItemLabel( wxT("Enable") ); + m_itemEnable->SetItemLabel( "Enable" ); } else { m_pPropGridManager->EnableProperty ( id ); - m_itemEnable->SetItemLabel( wxT("Disable") ); + m_itemEnable->SetItemLabel( "Disable" ); } } @@ -2534,7 +2527,7 @@ void FormMain::OnSetReadOnly( wxCommandEvent& WXUNUSED(event) ) wxPGProperty* p = m_pPropGridManager->GetGrid()->GetSelection(); if ( !p ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } m_pPropGridManager->SetPropertyReadOnly(p); @@ -2547,7 +2540,7 @@ void FormMain::OnHide( wxCommandEvent& WXUNUSED(event) ) wxPGProperty* id = m_pPropGridManager->GetGrid()->GetSelection(); if ( !id ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } @@ -2570,11 +2563,11 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event ) wxPGProperty* prop = pg->GetSelection(); if ( !prop ) { - wxMessageBox(wxT("First select a property.")); + wxMessageBox("First select a property."); return; } - wxColour col = ::wxGetColourFromUser(this, *wxWHITE, wxT("Choose colour")); + wxColour col = ::wxGetColourFromUser(this, *wxWHITE, "Choose colour"); if ( col.IsOk() ) { @@ -2587,7 +2580,7 @@ FormMain::OnSetBackgroundColour( wxCommandEvent& event ) void FormMain::OnInsertPage( wxCommandEvent& WXUNUSED(event) ) { - m_pPropGridManager->AddPage(wxT("New Page")); + m_pPropGridManager->AddPage("New Page"); } // ----------------------------------------------------------------------- @@ -2602,7 +2595,7 @@ void FormMain::OnRemovePage( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnSaveState( wxCommandEvent& WXUNUSED(event) ) { m_savedState = m_pPropGridManager->SaveEditableState(); - wxLogDebug(wxT("Saved editable state string: \"%s\""), m_savedState.c_str()); + wxLogDebug("Saved editable state string: \"%s\"", m_savedState.c_str()); } // ----------------------------------------------------------------------- @@ -2621,7 +2614,7 @@ void FormMain::OnSetSpinCtrlEditorClick( wxCommandEvent& WXUNUSED(event) ) if ( pgId ) m_pPropGridManager->SetPropertyEditor( pgId, wxPGEditor_SpinCtrl ); else - wxMessageBox(wxT("First select a property")); + wxMessageBox("First select a property"); #endif } @@ -2633,17 +2626,17 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) ) if ( pgId ) { wxPGChoices choices; - choices.Add(wxT("Flag 0"),0x0001); - choices.Add(wxT("Flag 1"),0x0002); - choices.Add(wxT("Flag 2"),0x0004); - choices.Add(wxT("Flag 3"),0x0008); + choices.Add("Flag 0",0x0001); + choices.Add("Flag 1",0x0002); + choices.Add("Flag 2",0x0004); + choices.Add("Flag 3",0x0008); const long maxVal = 0x000F; // Look for unused property name - wxString propName = wxT("ReplaceFlagsProperty"); + wxString propName = "ReplaceFlagsProperty"; int idx = 0; while ( m_pPropGridManager->GetPropertyByName(propName) ) { - propName = wxString::Format(wxT("ReplaceFlagsProperty %i"), ++idx); + propName = wxString::Format("ReplaceFlagsProperty %i", ++idx); } // Replace property and select new one // with random value in range [1..maxVal] @@ -2657,7 +2650,7 @@ void FormMain::OnTestReplaceClick( wxCommandEvent& WXUNUSED(event) ) m_pPropGridManager->SelectProperty(newId); } else - wxMessageBox(wxT("First select a property")); + wxMessageBox("First select a property"); } // ----------------------------------------------------------------------- @@ -2707,7 +2700,7 @@ void FormMain::OnShowHeader( wxCommandEvent& event ) m_pPropGridManager->ShowHeader(show); if ( show ) { - m_pPropGridManager->SetColumnTitle(2, wxT("Units")); + m_pPropGridManager->SetColumnTitle(2, "Units"); } } #endif // wxUSE_HEADERCTRL @@ -2717,28 +2710,28 @@ void FormMain::OnShowHeader( wxCommandEvent& event ) void FormMain::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( wxT("wxPropertyGrid Sample") + msg.Printf( "wxPropertyGrid Sample" #if wxUSE_UNICODE #if defined(wxUSE_UNICODE_UTF8) && wxUSE_UNICODE_UTF8 - wxT(" ") + " " #else - wxT(" ") + " " #endif #else - wxT(" ") + " " #endif #ifdef __WXDEBUG__ - wxT(" ") + " " #else - wxT(" ") + " " #endif - wxT("\n\n") - wxT("Programmed by %s\n\n") - wxT("Using %s\n\n"), - wxT("Jaakko Salli"), wxVERSION_STRING + "\n\n" + "Programmed by %s\n\n" + "Using %s\n\n", + "Jaakko Salli", wxVERSION_STRING ); - wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, "About", wxOK | wxICON_INFORMATION, this); } // ----------------------------------------------------------------------- @@ -2823,28 +2816,28 @@ void FormMain::OnCatColours( wxCommandEvent& event ) if ( event.IsChecked() ) { // Set custom colours. - pg->SetPropertyTextColour( wxT("Appearance"), wxColour(255,0,0), wxPG_DONT_RECURSE ); - pg->SetPropertyBackgroundColour( wxT("Appearance"), wxColour(255,255,183) ); - pg->SetPropertyTextColour( wxT("Appearance"), wxColour(255,0,183) ); - pg->SetPropertyTextColour( wxT("PositionCategory"), wxColour(0,255,0), wxPG_DONT_RECURSE ); - pg->SetPropertyBackgroundColour( wxT("PositionCategory"), wxColour(255,226,190) ); - pg->SetPropertyTextColour( wxT("PositionCategory"), wxColour(255,0,190) ); - pg->SetPropertyTextColour( wxT("Environment"), wxColour(0,0,255), wxPG_DONT_RECURSE ); - pg->SetPropertyBackgroundColour( wxT("Environment"), wxColour(208,240,175) ); - pg->SetPropertyTextColour( wxT("Environment"), wxColour(255,255,255) ); - pg->SetPropertyBackgroundColour( wxT("More Examples"), wxColour(172,237,255) ); - pg->SetPropertyTextColour( wxT("More Examples"), wxColour(172,0,255) ); + pg->SetPropertyTextColour( "Appearance", wxColour(255,0,0), wxPG_DONT_RECURSE ); + pg->SetPropertyBackgroundColour( "Appearance", wxColour(255,255,183) ); + pg->SetPropertyTextColour( "Appearance", wxColour(255,0,183) ); + pg->SetPropertyTextColour( "PositionCategory", wxColour(0,255,0), wxPG_DONT_RECURSE ); + pg->SetPropertyBackgroundColour( "PositionCategory", wxColour(255,226,190) ); + pg->SetPropertyTextColour( "PositionCategory", wxColour(255,0,190) ); + pg->SetPropertyTextColour( "Environment", wxColour(0,0,255), wxPG_DONT_RECURSE ); + pg->SetPropertyBackgroundColour( "Environment", wxColour(208,240,175) ); + pg->SetPropertyTextColour( "Environment", wxColour(255,255,255) ); + pg->SetPropertyBackgroundColour( "More Examples", wxColour(172,237,255) ); + pg->SetPropertyTextColour( "More Examples", wxColour(172,0,255) ); } else { // Revert to original. - pg->SetPropertyColoursToDefault( wxT("Appearance") ); - pg->SetPropertyColoursToDefault( wxT("Appearance"), wxPG_RECURSE ); - pg->SetPropertyColoursToDefault( wxT("PositionCategory") ); - pg->SetPropertyColoursToDefault( wxT("PositionCategory"), wxPG_RECURSE ); - pg->SetPropertyColoursToDefault( wxT("Environment") ); - pg->SetPropertyColoursToDefault( wxT("Environment"), wxPG_RECURSE ); - pg->SetPropertyColoursToDefault( wxT("More Examples"), wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "Appearance" ); + pg->SetPropertyColoursToDefault( "Appearance", wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "PositionCategory" ); + pg->SetPropertyColoursToDefault( "PositionCategory", wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "Environment" ); + pg->SetPropertyColoursToDefault( "Environment", wxPG_RECURSE ); + pg->SetPropertyColoursToDefault( "More Examples", wxPG_RECURSE ); } m_pPropGridManager->Thaw(); m_pPropGridManager->Refresh(); @@ -2853,7 +2846,7 @@ void FormMain::OnCatColours( wxCommandEvent& event ) // ----------------------------------------------------------------------- #define ADD_FLAG(FLAG) \ - chs.Add(wxT(#FLAG)); \ + chs.Add(#FLAG); \ vls.Add(FLAG); \ if ( (flags & FLAG) == FLAG ) sel.Add(ind); \ ind++; @@ -2880,8 +2873,8 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) ) ADD_FLAG(wxPG_TOOLBAR) ADD_FLAG(wxPG_DESCRIPTION) ADD_FLAG(wxPG_NO_INTERNAL_BORDER) - wxMultiChoiceDialog dlg( this, wxT("Select window styles to use"), - wxT("wxPropertyGrid Window Style"), chs ); + wxMultiChoiceDialog dlg( this, "Select window styles to use", + "wxPropertyGrid Window Style", chs ); dlg.SetSelections(sel); if ( dlg.ShowModal() == wxID_CANCEL ) return; @@ -2913,8 +2906,8 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) ) ADD_FLAG(wxPG_EX_NO_TOOLBAR_DIVIDER) ADD_FLAG(wxPG_EX_TOOLBAR_SEPARATOR) ADD_FLAG(wxPG_EX_ALWAYS_ALLOW_FOCUS) - wxMultiChoiceDialog dlg( this, wxT("Select extra window styles to use"), - wxT("wxPropertyGrid Extra Style"), chs ); + wxMultiChoiceDialog dlg( this, "Select extra window styles to use", + "wxPropertyGrid Extra Style", chs ); dlg.SetSelections(sel); if ( dlg.ShowModal() == wxID_CANCEL ) return; @@ -2936,8 +2929,8 @@ void FormMain::OnSelectStyle( wxCommandEvent& WXUNUSED(event) ) void FormMain::OnSetColumns( wxCommandEvent& WXUNUSED(event) ) { - long colCount = ::wxGetNumberFromUser(wxT("Enter number of columns (2-20)."),wxT("Columns:"), - wxT("Change Columns"),m_pPropGridManager->GetColumnCount(), + long colCount = ::wxGetNumberFromUser("Enter number of columns (2-20).","Columns:", + "Change Columns",m_pPropGridManager->GetColumnCount(), 2,20); if ( colCount >= 2 ) @@ -2955,7 +2948,7 @@ void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) ) if ( selected ) { - wxString value = ::wxGetTextFromUser( wxT("Enter new value:") ); + wxString value = ::wxGetTextFromUser( "Enter new value:" ); pg->SetPropertyValue( selected, value ); } } @@ -2974,11 +2967,11 @@ void FormMain::OnInsertChoice( wxCommandEvent& WXUNUSED(event) ) if ( choices.IsOk() ) { int pos = choices.GetCount() / 2; - selected->InsertChoice(wxT("New Choice"), pos); + selected->InsertChoice("New Choice", pos); } else { - ::wxMessageBox(wxT("First select a property with some choices.")); + ::wxMessageBox("First select a property with some choices."); } } @@ -3000,7 +2993,7 @@ void FormMain::OnDeleteChoice( wxCommandEvent& WXUNUSED(event) ) } else { - ::wxMessageBox(wxT("First select a property with some choices.")); + ::wxMessageBox("First select a property with some choices."); } } @@ -3029,26 +3022,26 @@ void FormMain::OnMisc ( wxCommandEvent& event ) } else if ( id == ID_GETVALUES ) { - m_storedValues = m_pPropGridManager->GetGrid()->GetPropertyValues(wxT("Test"), + m_storedValues = m_pPropGridManager->GetGrid()->GetPropertyValues("Test", m_pPropGridManager->GetGrid()->GetRoot(), wxPG_KEEP_STRUCTURE|wxPG_INC_ATTRIBUTES); } else if ( id == ID_SETVALUES ) { - if ( m_storedValues.IsType(wxT("list")) ) + if ( m_storedValues.IsType("list") ) { m_pPropGridManager->GetGrid()->SetPropertyValues(m_storedValues); } else - wxMessageBox(wxT("First use Get Property Values.")); + wxMessageBox("First use Get Property Values."); } else if ( id == ID_SETVALUES2 ) { wxVariant list; list.NullList(); - list.Append( wxVariant((long)1234,wxT("VariantLong")) ); - list.Append( wxVariant(true,wxT("VariantBool")) ); - list.Append( wxVariant(wxT("Test Text"),wxT("VariantString")) ); + list.Append( wxVariant((long)1234,"VariantLong") ); + list.Append( wxVariant(true,"VariantBool") ); + list.Append( wxVariant("Test Text","VariantString") ); m_pPropGridManager->GetGrid()->SetPropertyValues(list); } else if ( id == ID_COLLAPSE ) @@ -3123,7 +3116,7 @@ bool cxApplication::OnInit() //wxLocale Locale; //Locale.Init(wxLANGUAGE_FINNISH); - FormMain* frame = Form1 = new FormMain( wxT("wxPropertyGrid Sample"), wxPoint(0,0), wxSize(300,500) ); + FormMain* frame = Form1 = new FormMain( "wxPropertyGrid Sample", wxPoint(0,0), wxSize(300,500) ); frame->Show(true); // @@ -3132,7 +3125,7 @@ bool cxApplication::OnInit() if ( app.argc > 1 ) { wxString s = app.argv[1]; - if ( s == wxT("--run-tests") ) + if ( s == "--run-tests" ) { // // Run tests @@ -3158,11 +3151,11 @@ void FormMain::OnIdle( wxIdleEvent& event ) if ( cur_focus != last_focus ) { - const wxChar* class_name = wxT(""); + const wxChar* class_name = ""; if ( cur_focus ) class_name = cur_focus->GetClassInfo()->GetClassName(); last_focus = cur_focus; - wxLogDebug( wxT("FOCUSED: %s %X"), + wxLogDebug( "FOCUSED: %s %X", class_name, (unsigned int)cur_focus); } @@ -3269,20 +3262,20 @@ struct PropertyGridPopup : wxPopupWindow m_grid = new wxPropertyGrid(m_panel, ID_POPUPGRID, wxDefaultPosition, wxSize(400,400), wxPG_SPLITTER_AUTO_CENTER); m_grid->SetColumnCount(3); - wxPGProperty *prop=m_grid->Append(new wxStringProperty(wxT("test_name"), wxPG_LABEL, wxT("test_value"))); - m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, wxT("type")); - wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name1"), wxPG_LABEL, wxT("sub_value1"))); + wxPGProperty *prop=m_grid->Append(new wxStringProperty("test_name", wxPG_LABEL, "test_value")); + m_grid->SetPropertyAttribute(prop, wxPG_ATTR_UNITS, "type"); + wxPGProperty *prop1 = m_grid->AppendIn(prop, new wxStringProperty("sub_name1", wxPG_LABEL, "sub_value1")); - m_grid->AppendIn(prop1, new wxSystemColourProperty(wxT("Cell Colour"),wxPG_LABEL, m_grid->GetGrid()->GetCellBackgroundColour())); - wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty(wxT("sub_name2"), wxPG_LABEL, wxT("sub_value2"))); - m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name21"), wxPG_LABEL, wxT("sub_value21"))); + m_grid->AppendIn(prop1, new wxSystemColourProperty("Cell Colour",wxPG_LABEL, m_grid->GetGrid()->GetCellBackgroundColour())); + wxPGProperty *prop2 = m_grid->AppendIn(prop, new wxStringProperty("sub_name2", wxPG_LABEL, "sub_value2")); + m_grid->AppendIn(prop2, new wxStringProperty("sub_name21", wxPG_LABEL, "sub_value21")); wxArrayDouble arrdbl; arrdbl.Add(-1.0); arrdbl.Add(-0.5); arrdbl.Add(0.0); arrdbl.Add(0.5); arrdbl.Add(1.0); - m_grid->AppendIn(prop, new wxArrayDoubleProperty(wxT("ArrayDoubleProperty"),wxPG_LABEL,arrdbl) ); - m_grid->AppendIn(prop, new wxFontProperty(wxT("Font"),wxPG_LABEL)); - m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name22"), wxPG_LABEL, wxT("sub_value22"))); - m_grid->AppendIn(prop2, new wxStringProperty(wxT("sub_name23"), wxPG_LABEL, wxT("sub_value23"))); + m_grid->AppendIn(prop, new wxArrayDoubleProperty("ArrayDoubleProperty",wxPG_LABEL,arrdbl) ); + m_grid->AppendIn(prop, new wxFontProperty("Font",wxPG_LABEL)); + m_grid->AppendIn(prop2, new wxStringProperty("sub_name22", wxPG_LABEL, "sub_value22")); + m_grid->AppendIn(prop2, new wxStringProperty("sub_name23", wxPG_LABEL, "sub_value23")); prop2->SetExpanded(false); ::SetMinSize(m_grid); @@ -3297,13 +3290,13 @@ struct PropertyGridPopup : wxPopupWindow void OnCollapse(wxPropertyGridEvent& WXUNUSED(event)) { - wxLogMessage(wxT("OnCollapse")); + wxLogMessage("OnCollapse"); Fit(); } void OnExpand(wxPropertyGridEvent& WXUNUSED(event)) { - wxLogMessage(wxT("OnExpand")); + wxLogMessage("OnExpand"); Fit(); } diff --git a/samples/propgrid/propgrid_minimal.cpp b/samples/propgrid/propgrid_minimal.cpp index 355ad7a19a..a1328443b7 100644 --- a/samples/propgrid/propgrid_minimal.cpp +++ b/samples/propgrid/propgrid_minimal.cpp @@ -38,12 +38,12 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) wxEND_EVENT_TABLE() MyFrame::MyFrame(wxWindow* parent) - : wxFrame(parent, wxID_ANY, wxT("PropertyGrid Test")) + : wxFrame(parent, wxID_ANY, "PropertyGrid Test") { wxMenu *Menu = new wxMenu; - Menu->Append(ID_ACTION, wxT("Action")); + Menu->Append(ID_ACTION, "Action"); wxMenuBar *MenuBar = new wxMenuBar(); - MenuBar->Append(Menu, wxT("Action")); + MenuBar->Append(Menu, "Action"); SetMenuBar(MenuBar); wxPropertyGrid *pg = new wxPropertyGrid(this,wxID_ANY,wxDefaultPosition,wxSize(400,400), @@ -51,9 +51,9 @@ MyFrame::MyFrame(wxWindow* parent) wxPG_BOLD_MODIFIED ); m_pg = pg; - pg->Append( new wxStringProperty(wxT("String Property"), wxPG_LABEL) ); - pg->Append( new wxIntProperty(wxT("Int Property"), wxPG_LABEL) ); - pg->Append( new wxBoolProperty(wxT("Bool Property"), wxPG_LABEL) ); + pg->Append( new wxStringProperty("String Property", wxPG_LABEL) ); + pg->Append( new wxIntProperty("Int Property", wxPG_LABEL) ); + pg->Append( new wxBoolProperty("Bool Property", wxPG_LABEL) ); SetSize(400, 600); } @@ -64,12 +64,12 @@ void MyFrame::OnPropertyGridChange(wxPropertyGridEvent &event) if ( p ) { - wxLogVerbose(wxT("OnPropertyGridChange(%s, value=%s)"), + wxLogVerbose("OnPropertyGridChange(%s, value=%s)", p->GetName().c_str(), p->GetValueAsString().c_str()); } else { - wxLogVerbose(wxT("OnPropertyGridChange(NULL)")); + wxLogVerbose("OnPropertyGridChange(NULL)"); } } @@ -77,7 +77,7 @@ void MyFrame::OnPropertyGridChanging(wxPropertyGridEvent &event) { wxPGProperty* p = event.GetProperty(); - wxLogVerbose(wxT("OnPropertyGridChanging(%s)"), p->GetName().c_str()); + wxLogVerbose("OnPropertyGridChanging(%s)", p->GetName().c_str()); } void MyFrame::OnAction(wxCommandEvent &) diff --git a/samples/propgrid/sampleprops.cpp b/samples/propgrid/sampleprops.cpp index 788b414767..9a3b7a1b41 100644 --- a/samples/propgrid/sampleprops.cpp +++ b/samples/propgrid/sampleprops.cpp @@ -69,7 +69,7 @@ wxFontDataProperty::wxFontDataProperty( const wxString& label, const wxString& n m_value_wxFontData << fontData; // Add extra children. - AddPrivateChild( new wxColourProperty(wxT("Colour"), wxPG_LABEL, + AddPrivateChild( new wxColourProperty("Colour", wxPG_LABEL, fontData.GetColour() ) ); } @@ -77,9 +77,9 @@ wxFontDataProperty::~wxFontDataProperty () { } void wxFontDataProperty::OnSetValue() { - if ( !m_value.IsType(wxT("wxFontData")) ) + if ( !m_value.IsType("wxFontData") ) { - if ( m_value.IsType(wxT("wxFont")) ) + if ( m_value.IsType("wxFont") ) { wxFont font; font << m_value; @@ -101,7 +101,7 @@ void wxFontDataProperty::OnSetValue() } else { - wxFAIL_MSG(wxT("Value to wxFontDataProperty must be either wxFontData or wxFont")); + wxFAIL_MSG("Value to wxFontDataProperty must be either wxFontData or wxFont"); } } else @@ -201,8 +201,8 @@ wxSizeProperty::wxSizeProperty( const wxString& label, const wxString& name, const wxSize& value) : wxPGProperty(label,name) { SetValueI(value); - AddPrivateChild( new wxIntProperty(wxT("Width"),wxPG_LABEL,value.x) ); - AddPrivateChild( new wxIntProperty(wxT("Height"),wxPG_LABEL,value.y) ); + AddPrivateChild( new wxIntProperty("Width",wxPG_LABEL,value.x) ); + AddPrivateChild( new wxIntProperty("Height",wxPG_LABEL,value.y) ); } wxSizeProperty::~wxSizeProperty() { } @@ -241,8 +241,8 @@ wxPointProperty::wxPointProperty( const wxString& label, const wxString& name, const wxPoint& value) : wxPGProperty(label,name) { SetValueI(value); - AddPrivateChild( new wxIntProperty(wxT("X"),wxPG_LABEL,value.x) ); - AddPrivateChild( new wxIntProperty(wxT("Y"),wxPG_LABEL,value.y) ); + AddPrivateChild( new wxIntProperty("X",wxPG_LABEL,value.x) ); + AddPrivateChild( new wxIntProperty("Y",wxPG_LABEL,value.y) ); } wxPointProperty::~wxPointProperty() { } @@ -277,7 +277,7 @@ wxVariant wxPointProperty::ChildChanged( wxVariant& thisValue, // ----------------------------------------------------------------------- WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(wxDirsProperty, ',', - wxT("Browse")) + "Browse") #if wxUSE_VALIDATORS @@ -292,7 +292,7 @@ wxValidator* wxDirsProperty::DoGetValidator() const bool wxDirsProperty::OnCustomStringEdit( wxWindow* parent, wxString& value ) { wxDirDialog dlg(parent, - wxT("Select a directory to be added to the list:"), + "Select a directory to be added to the list:", value, 0); @@ -474,7 +474,7 @@ bool operator == (const wxArrayDouble& a, const wxArrayDouble& b) // Can't do direct equality comparison with floating point numbers. if ( fabs(a[i] - b[i]) > 0.0000000001 ) { - //wxLogDebug(wxT("%f != %f"),a[i],b[i]); + //wxLogDebug("%f != %f",a[i],b[i]); return false; } } @@ -498,10 +498,10 @@ wxArrayDoubleProperty::wxArrayDoubleProperty (const wxString& label, // // Need to figure out delimiter needed for this locale // (i.e. can't use comma when comma acts as decimal point in float). - wxChar use_delimiter = wxT(','); + wxChar use_delimiter = ','; - if (wxString::Format(wxT("%.2f"),12.34).Find(use_delimiter) >= 0) - use_delimiter = wxT(';'); + if (wxString::Format("%.2f",12.34).Find(use_delimiter) >= 0) + use_delimiter = ';'; m_delimiter = use_delimiter; @@ -540,7 +540,7 @@ wxString wxArrayDoubleProperty::ValueToString( wxVariant& value, void wxArrayDoubleProperty::GenerateValueAsString( wxString& target, int prec, bool removeZeroes ) const { - wxChar between[3] = wxT(", "); + wxString between = ", "; size_t i; between[0] = m_delimiter; @@ -657,7 +657,7 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const wxArrayString incChars(numValidator.GetIncludes()); // Accept also a delimiter and space character incChars.Add(m_delimiter); - incChars.Add(wxT(" ")); + incChars.Add(" "); validator->SetIncludes(incChars); @@ -670,9 +670,9 @@ wxValidator* wxArrayDoubleProperty::DoGetValidator() const bool wxArrayDoubleProperty::ValidateValue(wxVariant& value, wxPGValidationInfo& validationInfo) const { - if (!value.IsType(wxT("wxArrayDouble"))) + if (!value.IsType("wxArrayDouble")) { - validationInfo.SetFailureMessage(wxT("At least one element is not a valid floating-point number.")); + validationInfo.SetFailureMessage("At least one element is not a valid floating-point number."); return false; } diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index 3a48785286..5f6cd552c5 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -45,13 +45,13 @@ public: : wxColourProperty(label, name, value) { wxPGChoices colours; - colours.Add(wxT("White")); - colours.Add(wxT("Black")); - colours.Add(wxT("Red")); - colours.Add(wxT("Green")); - colours.Add(wxT("Blue")); - colours.Add(wxT("Custom")); - colours.Add(wxT("None")); + colours.Add("White"); + colours.Add("Black"); + colours.Add("Red"); + colours.Add("Green"); + colours.Add("Blue"); + colours.Add("Custom"); + colours.Add("None"); m_choices = colours; SetIndex(0); wxVariant variant; @@ -106,24 +106,24 @@ public: void FormMain::AddTestProperties( wxPropertyGridPage* pg ) { - pg->Append( new MyColourProperty(wxT("CustomColourProperty"), wxPG_LABEL, *wxGREEN) ); - pg->GetProperty(wxT("CustomColourProperty"))->SetAutoUnspecified(true); - pg->SetPropertyEditor( wxT("CustomColourProperty"), wxPGEditor_ComboBox ); + pg->Append( new MyColourProperty("CustomColourProperty", wxPG_LABEL, *wxGREEN) ); + pg->GetProperty("CustomColourProperty")->SetAutoUnspecified(true); + pg->SetPropertyEditor( "CustomColourProperty", wxPGEditor_ComboBox ); - pg->SetPropertyHelpString(wxT("CustomColourProperty"), - wxT("This is a MyColourProperty from the sample app. ") - wxT("It is built by subclassing wxColourProperty.")); + pg->SetPropertyHelpString("CustomColourProperty", + "This is a MyColourProperty from the sample app. " + "It is built by subclassing wxColourProperty."); } // ----------------------------------------------------------------------- void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) ) { - wxVariant values = m_pPropGridManager->GetPropertyValues(wxT("list"), wxNullProperty, wxPG_INC_ATTRIBUTES); - wxString text = wxT("This only tests that wxVariant related routines do not crash."); + wxVariant values = m_pPropGridManager->GetPropertyValues("list", wxNullProperty, wxPG_INC_ATTRIBUTES); + wxString text = "This only tests that wxVariant related routines do not crash."; wxString t; - wxDialog* dlg = new wxDialog(this,wxID_ANY,wxT("wxVariant Test"), + wxDialog* dlg = new wxDialog(this,wxID_ANY,"wxVariant Test", wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER); unsigned int i; @@ -134,26 +134,26 @@ void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) ) wxString strValue = v.GetString(); #if wxCHECK_VERSION(2,8,0) - if ( v.GetName().EndsWith(wxT("@attr")) ) + if ( v.GetName().EndsWith("@attr") ) #else - if ( v.GetName().Right(5) == wxT("@attr") ) + if ( v.GetName().Right(5) == "@attr" ) #endif { - text += wxString::Format(wxT("Attributes:\n")); + text += wxString::Format("Attributes:\n"); unsigned int n; for ( n = 0; n < (unsigned int)v.GetCount(); n++ ) { wxVariant& a = v[n]; - t.Printf(wxT(" attribute %i: name=\"%s\" (type=\"%s\" value=\"%s\")\n"),(int)n, + t.Printf(" attribute %i: name=\"%s\" (type=\"%s\" value=\"%s\")\n",(int)n, a.GetName().c_str(),a.GetType().c_str(),a.GetString().c_str()); text += t; } } else { - t.Printf(wxT("%i: name=\"%s\" type=\"%s\" value=\"%s\"\n"),(int)i, + t.Printf("%i: name=\"%s\" type=\"%s\" value=\"%s\"\n",(int)i, v.GetName().c_str(),v.GetType().c_str(),strValue.c_str()); text += t; } @@ -169,7 +169,7 @@ void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) ) rowsizer->Add( ed, wxSizerFlags(1).Expand().Border(wxALL, spacing)); topsizer->Add( rowsizer, wxSizerFlags(1).Expand()); rowsizer = new wxBoxSizer( wxHORIZONTAL ); - rowsizer->Add( new wxButton(dlg,wxID_OK,wxT("Ok")), + rowsizer->Add( new wxButton(dlg,wxID_OK,"Ok"), wxSizerFlags(0).CentreHorizontal().CentreVertical().Border(wxBOTTOM|wxLEFT|wxRIGHT, spacing)); topsizer->Add( rowsizer, wxSizerFlags().Right() ); @@ -197,8 +197,8 @@ public: m_preWarnings = wxPGGlobalVars->m_warnings; #endif - if ( name != wxT("none") ) - Msg(name+wxT("\n")); + if ( name != "none" ) + Msg(name+"\n"); } ~TestRunner() @@ -207,7 +207,7 @@ public: int warningsOccurred = wxPGGlobalVars->m_warnings - m_preWarnings; if ( warningsOccurred ) { - wxString s = wxString::Format(wxT("%i warnings occurred during test '%s'"), warningsOccurred, m_name.c_str()); + wxString s = wxString::Format("%i warnings occurred during test '%s'", warningsOccurred, m_name.c_str()); m_errorMessages->push_back(s); Msg(s); } @@ -219,7 +219,7 @@ public: if ( m_ed ) { m_ed->AppendText(text); - m_ed->AppendText(wxT("\n")); + m_ed->AppendText("\n"); } wxLogDebug(text); } @@ -236,14 +236,14 @@ protected: #define RT_START_TEST(TESTNAME) \ - TestRunner tr(wxT(#TESTNAME), pgman, ed, &errorMessages); + TestRunner tr(#TESTNAME, pgman, ed, &errorMessages); #define RT_MSG(S) \ tr.Msg(S); #define RT_FAILURE() \ { \ - wxString s1 = wxString::Format(wxT("Test failure in tests.cpp, line %i."),__LINE__-1); \ + wxString s1 = wxString::Format("Test failure in tests.cpp, line %i.",__LINE__-1); \ errorMessages.push_back(s1); \ wxLogDebug(s1); \ failures++; \ @@ -255,10 +255,10 @@ protected: #define RT_FAILURE_MSG(MSG) \ { \ - wxString s1 = wxString::Format(wxT("Test failure in tests.cpp, line %i."),__LINE__-1); \ + wxString s1 = wxString::Format("Test failure in tests.cpp, line %i.",__LINE__-1); \ errorMessages.push_back(s1); \ wxLogDebug(s1); \ - wxString s2 = wxString::Format(wxT("Message: %s"),MSG.c_str()); \ + wxString s2 = wxString::Format("Message: %s",MSG.c_str()); \ errorMessages.push_back(s2); \ wxLogDebug(s2); \ failures++; \ @@ -270,7 +270,7 @@ protected: unsigned int h2_ = PROPS->GetActualVirtualHeight(); \ if ( h1_ != h2_ ) \ { \ - wxString s_ = wxString::Format(wxT("VirtualHeight = %i, should be %i (%s)"), h1_, h2_, EXTRATEXT.c_str()); \ + wxString s_ = wxString::Format("VirtualHeight = %i, should be %i (%s)", h1_, h2_, EXTRATEXT.c_str()); \ RT_FAILURE_MSG(s_); \ _failed_ = true; \ } \ @@ -342,7 +342,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxArrayString errorMessages; wxDialog* dlg = NULL; - dlg = new wxDialog(this,wxID_ANY,wxT("wxPropertyGrid Regression Tests"), + dlg = new wxDialog(this,wxID_ANY,"wxPropertyGrid Regression Tests", wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER); // multi-line text editor dialog @@ -355,7 +355,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) rowsizer->Add( ed, wxSizerFlags(1).Expand().Border(wxALL, spacing)); topsizer->Add( rowsizer, wxSizerFlags(1).Expand()); rowsizer = new wxBoxSizer( wxHORIZONTAL ); - rowsizer->Add( new wxButton(dlg,wxID_OK,wxT("Ok")), + rowsizer->Add( new wxButton(dlg,wxID_OK,"Ok"), wxSizerFlags(0).CentreHorizontal().CentreVertical().Border(wxBOTTOM|wxLEFT|wxRIGHT, spacing)); topsizer->Add( rowsizer, wxSizerFlags().Right() ); @@ -382,13 +382,13 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( p->IsCategory() ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is a category (non-private child property expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is a category (non-private child property expected)",p->GetLabel().c_str())) else if ( p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is a private child (non-private child property expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property expected)",p->GetLabel().c_str())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_PROPERTIES) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_PROPERTIES) -> %i entries", count)); count = 0; for ( it = pgman->GetVIterator(wxPG_ITERATE_CATEGORIES); @@ -397,11 +397,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( !p->IsCategory() ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is not a category (only category was expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is not a category (only category was expected)",p->GetLabel().c_str())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_CATEGORIES) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_CATEGORIES) -> %i entries", count)); count = 0; for ( it = pgman->GetVIterator(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_CATEGORIES); @@ -410,11 +410,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' is a private child (non-private child property or category expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' is a private child (non-private child property or category expected)",p->GetLabel().c_str())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_CATEGORIES) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_PROPERTIES|wxPG_ITERATE_CATEGORIES) -> %i entries", count)); count = 0; for ( it = pgman->GetVIterator(wxPG_ITERATE_VISIBLE); @@ -423,13 +423,13 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxPGProperty* p = it.GetProperty(); if ( (p->GetParent() != p->GetParentState()->DoGetRoot() && !p->GetParent()->IsExpanded()) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' had collapsed parent (only visible properties expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' had collapsed parent (only visible properties expected)",p->GetLabel().c_str())) else if ( p->HasFlag(wxPG_PROP_HIDDEN) ) - RT_FAILURE_MSG(wxString::Format(wxT("'%s' was hidden (only visible properties expected)"),p->GetLabel().c_str())) + RT_FAILURE_MSG(wxString::Format("'%s' was hidden (only visible properties expected)",p->GetLabel().c_str())) count++; } - RT_MSG(wxString::Format(wxT("GetVIterator(wxPG_ITERATE_VISIBLE) -> %i entries"), count)); + RT_MSG(wxString::Format("GetVIterator(wxPG_ITERATE_VISIBLE) -> %i entries", count)); } if ( fullTest ) @@ -476,7 +476,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) for ( it2 = array.rbegin(); it2 != array.rend(); ++it2 ) { wxPGProperty* p = (wxPGProperty*)*it2; - RT_MSG(wxString::Format(wxT("Deleting '%s' ('%s')"),p->GetLabel().c_str(),p->GetName().c_str())); + RT_MSG(wxString::Format("Deleting '%s' ('%s')",p->GetLabel().c_str(),p->GetName().c_str())); pgman->DeleteProperty(p); } @@ -521,7 +521,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxAny any; #if wxUSE_DATETIME - prop = pgman->GetProperty(wxT("DateProperty")); + prop = pgman->GetProperty("DateProperty"); wxDateTime testTime = wxDateTime::Now(); any = testTime; prop->SetValue(any); @@ -529,7 +529,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_FAILURE(); #endif - prop = pgman->GetProperty(wxT("IntProperty")); + prop = pgman->GetProperty("IntProperty"); int testInt = 25537983; any = testInt; prop->SetValue(any); @@ -540,15 +540,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_FAILURE(); #endif - prop = pgman->GetProperty(wxT("StringProperty")); - wxString testString = wxT("asd934jfyn3"); + prop = pgman->GetProperty("StringProperty"); + wxString testString = "asd934jfyn3"; any = testString; prop->SetValue(any); if ( prop->GetValue().GetAny().As() != testString ) RT_FAILURE(); // Test with a type generated with IMPLEMENT_VARIANT_OBJECT() - prop = pgman->GetProperty(wxT("ColourProperty")); + prop = pgman->GetProperty("ColourProperty"); wxColour testCol = *wxCYAN; any = testCol; prop->SetValue(any); @@ -557,7 +557,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // Test with a type with custom wxVariantData defined by // wxPG headers. - prop = pgman->GetProperty(wxT("Position")); + prop = pgman->GetProperty("Position"); wxPoint testPoint(199, 199); any = testPoint; prop->SetValue(any); @@ -580,7 +580,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { wxVariant& v = values[j]; - t.Printf(wxT("%i: name=\"%s\" type=\"%s\"\n"),(int)j, + t.Printf("%i: name=\"%s\" type=\"%s\"\n",(int)j, v.GetName().c_str(),v.GetType().c_str()); text += t; @@ -592,21 +592,21 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(SetPropertyValue_and_GetPropertyValue) - // In this section, mixed up usage of wxT("propname") and "propname" + // In this section, mixed up usage of "propname" and "propname" // in wxPropertyGridInterface functions is intentional. // Purpose is to test wxPGPropArgCls ctors. //pg = (wxPropertyGrid*) NULL; wxArrayString test_arrstr_1; - test_arrstr_1.Add(wxT("Apple")); - test_arrstr_1.Add(wxT("Orange")); - test_arrstr_1.Add(wxT("Lemon")); + test_arrstr_1.Add("Apple"); + test_arrstr_1.Add("Orange"); + test_arrstr_1.Add("Lemon"); wxArrayString test_arrstr_2; - test_arrstr_2.Add(wxT("Potato")); - test_arrstr_2.Add(wxT("Cabbage")); - test_arrstr_2.Add(wxT("Cucumber")); + test_arrstr_2.Add("Potato"); + test_arrstr_2.Add("Cabbage"); + test_arrstr_2.Add("Cucumber"); wxArrayInt test_arrint_1; test_arrint_1.Add(1); @@ -632,117 +632,117 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) #define FLAG_TEST_SET1 (wxCAPTION|wxCLOSE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER) #define FLAG_TEST_SET2 (wxSTAY_ON_TOP|wxCAPTION|wxICONIZE|wxSYSTEM_MENU) - pgman->SetPropertyValue(wxT("StringProperty"),wxT("Text1")); - pgman->SetPropertyValue(wxT("IntProperty"),1024); - pgman->SetPropertyValue(wxT("FloatProperty"),1024.0000000001); - pgman->SetPropertyValue(wxT("BoolProperty"),false); - pgman->SetPropertyValue(wxT("EnumProperty"),120); - pgman->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_1); + pgman->SetPropertyValue("StringProperty","Text1"); + pgman->SetPropertyValue("IntProperty",1024); + pgman->SetPropertyValue("FloatProperty",1024.0000000001); + pgman->SetPropertyValue("BoolProperty",false); + pgman->SetPropertyValue("EnumProperty",120); + pgman->SetPropertyValue("ArrayStringProperty",test_arrstr_1); wxColour emptyCol; - pgman->SetPropertyValue(wxT("ColourProperty"),emptyCol); - pgman->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxBLACK); - pgman->SetPropertyValue(wxT("Size"),WXVARIANT(wxSize(150,150))); - pgman->SetPropertyValue(wxT("Position"),WXVARIANT(wxPoint(150,150))); - pgman->SetPropertyValue(wxT("MultiChoiceProperty"),test_arrint_1); + pgman->SetPropertyValue("ColourProperty",emptyCol); + pgman->SetPropertyValue("ColourProperty",(wxObject*)wxBLACK); + pgman->SetPropertyValue("Size",WXVARIANT(wxSize(150,150))); + pgman->SetPropertyValue("Position",WXVARIANT(wxPoint(150,150))); + pgman->SetPropertyValue("MultiChoiceProperty",test_arrint_1); #if wxUSE_DATETIME - pgman->SetPropertyValue(wxT("DateProperty"),dt1); + pgman->SetPropertyValue("DateProperty",dt1); #endif pgman->SelectPage(2); pg = pgman->GetGrid(); - if ( pg->GetPropertyValueAsString(wxT("StringProperty")) != wxT("Text1") ) + if ( pg->GetPropertyValueAsString("StringProperty") != "Text1" ) RT_FAILURE(); - if ( pg->GetPropertyValueAsInt(wxT("IntProperty")) != 1024 ) + if ( pg->GetPropertyValueAsInt("IntProperty") != 1024 ) RT_FAILURE(); - if ( pg->GetPropertyValueAsDouble(wxT("FloatProperty")) != 1024.0000000001 ) + if ( pg->GetPropertyValueAsDouble("FloatProperty") != 1024.0000000001 ) RT_FAILURE(); - if ( pg->GetPropertyValueAsBool(wxT("BoolProperty")) != false ) + if ( pg->GetPropertyValueAsBool("BoolProperty") != false ) RT_FAILURE(); - if ( pg->GetPropertyValueAsLong(wxT("EnumProperty")) != 120 ) + if ( pg->GetPropertyValueAsLong("EnumProperty") != 120 ) RT_FAILURE(); - if ( pg->GetPropertyValueAsArrayString(wxT("ArrayStringProperty")) != test_arrstr_1 ) + if ( pg->GetPropertyValueAsArrayString("ArrayStringProperty") != test_arrstr_1 ) RT_FAILURE(); wxColour col; - col << pgman->GetPropertyValue(wxT("ColourProperty")); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != *wxBLACK ) RT_FAILURE(); - wxVariant varSize(pg->GetPropertyValue(wxT("Size"))); + wxVariant varSize(pg->GetPropertyValue("Size")); if ( wxSizeRefFromVariant(varSize) != wxSize(150,150) ) RT_FAILURE(); - wxVariant varPos(pg->GetPropertyValue(wxT("Position"))); + wxVariant varPos(pg->GetPropertyValue("Position")); if ( wxPointRefFromVariant(varPos) != wxPoint(150,150) ) RT_FAILURE(); - if ( !(pg->GetPropertyValueAsArrayInt(wxT("MultiChoiceProperty")) == test_arrint_1) ) + if ( !(pg->GetPropertyValueAsArrayInt("MultiChoiceProperty") == test_arrint_1) ) RT_FAILURE(); #if wxUSE_DATETIME - if ( !(pg->GetPropertyValueAsDateTime(wxT("DateProperty")) == dt1) ) + if ( !(pg->GetPropertyValueAsDateTime("DateProperty") == dt1) ) RT_FAILURE(); #endif #if wxUSE_LONGLONG && defined(wxLongLong_t) - pgman->SetPropertyValue(wxT("IntProperty"),wxLL(10000000000)); - if ( pg->GetPropertyValueAsLongLong(wxT("IntProperty")) != wxLL(10000000000) ) + pgman->SetPropertyValue("IntProperty",wxLL(10000000000)); + if ( pg->GetPropertyValueAsLongLong("IntProperty") != wxLL(10000000000) ) RT_FAILURE(); #else - pgman->SetPropertyValue(wxT("IntProperty"),1000000000); - if ( pg->GetPropertyValueAsLong(wxT("IntProperty")) != 1000000000 ) + pgman->SetPropertyValue("IntProperty",1000000000); + if ( pg->GetPropertyValueAsLong("IntProperty") != 1000000000 ) RT_FAILURE(); #endif - pg->SetPropertyValue(wxT("StringProperty"),wxT("Text2")); - pg->SetPropertyValue(wxT("IntProperty"),512); - pg->SetPropertyValue(wxT("FloatProperty"),512.0); - pg->SetPropertyValue(wxT("BoolProperty"),true); - pg->SetPropertyValue(wxT("EnumProperty"),80); - pg->SetPropertyValue(wxT("ArrayStringProperty"),test_arrstr_2); - pg->SetPropertyValue(wxT("ColourProperty"),(wxObject*)wxWHITE); - pg->SetPropertyValue(wxT("Size"),WXVARIANT(wxSize(300,300))); - pg->SetPropertyValue(wxT("Position"),WXVARIANT(wxPoint(300,300))); - pg->SetPropertyValue(wxT("MultiChoiceProperty"),test_arrint_2); + pg->SetPropertyValue("StringProperty","Text2"); + pg->SetPropertyValue("IntProperty",512); + pg->SetPropertyValue("FloatProperty",512.0); + pg->SetPropertyValue("BoolProperty",true); + pg->SetPropertyValue("EnumProperty",80); + pg->SetPropertyValue("ArrayStringProperty",test_arrstr_2); + pg->SetPropertyValue("ColourProperty",(wxObject*)wxWHITE); + pg->SetPropertyValue("Size",WXVARIANT(wxSize(300,300))); + pg->SetPropertyValue("Position",WXVARIANT(wxPoint(300,300))); + pg->SetPropertyValue("MultiChoiceProperty",test_arrint_2); #if wxUSE_DATETIME - pg->SetPropertyValue(wxT("DateProperty"),dt2); + pg->SetPropertyValue("DateProperty",dt2); #endif //pg = (wxPropertyGrid*) NULL; pgman->SelectPage(0); - if ( pgman->GetPropertyValueAsString(wxT("StringProperty")) != wxT("Text2") ) + if ( pgman->GetPropertyValueAsString("StringProperty") != "Text2" ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsInt(wxT("IntProperty")) != 512 ) + if ( pgman->GetPropertyValueAsInt("IntProperty") != 512 ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsDouble(wxT("FloatProperty")) != 512.0 ) + if ( pgman->GetPropertyValueAsDouble("FloatProperty") != 512.0 ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsBool(wxT("BoolProperty")) != true ) + if ( pgman->GetPropertyValueAsBool("BoolProperty") != true ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsLong(wxT("EnumProperty")) != 80 ) + if ( pgman->GetPropertyValueAsLong("EnumProperty") != 80 ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsArrayString(wxT("ArrayStringProperty")) != test_arrstr_2 ) + if ( pgman->GetPropertyValueAsArrayString("ArrayStringProperty") != test_arrstr_2 ) RT_FAILURE(); - col << pgman->GetPropertyValue(wxT("ColourProperty")); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != *wxWHITE ) RT_FAILURE(); - varSize = pgman->GetPropertyValue(wxT("Size")); + varSize = pgman->GetPropertyValue("Size"); if ( wxSizeRefFromVariant(varSize) != wxSize(300,300) ) RT_FAILURE(); - varPos = pgman->GetPropertyValue(wxT("Position")); + varPos = pgman->GetPropertyValue("Position"); if ( wxPointRefFromVariant(varPos) != wxPoint(300,300) ) RT_FAILURE(); - if ( !(pgman->GetPropertyValueAsArrayInt(wxT("MultiChoiceProperty")) == test_arrint_2) ) + if ( !(pgman->GetPropertyValueAsArrayInt("MultiChoiceProperty") == test_arrint_2) ) RT_FAILURE(); #if wxUSE_DATETIME - if ( !(pgman->GetPropertyValueAsDateTime(wxT("DateProperty")) == dt2) ) + if ( !(pgman->GetPropertyValueAsDateTime("DateProperty") == dt2) ) RT_FAILURE(); #endif #if wxUSE_LONGLONG && defined(wxLongLong_t) - pgman->SetPropertyValue(wxT("IntProperty"),wxLL(-80000000000)); - if ( pgman->GetPropertyValueAsLongLong(wxT("IntProperty")) != wxLL(-80000000000) ) + pgman->SetPropertyValue("IntProperty",wxLL(-80000000000)); + if ( pgman->GetPropertyValueAsLongLong("IntProperty") != wxLL(-80000000000) ) RT_FAILURE(); #else - pgman->SetPropertyValue(wxT("IntProperty"),-1000000000); - if ( pgman->GetPropertyValueAsLong(wxT("IntProperty")) != -1000000000 ) + pgman->SetPropertyValue("IntProperty",-1000000000); + if ( pgman->GetPropertyValueAsLong("IntProperty") != -1000000000 ) RT_FAILURE(); #endif @@ -751,46 +751,46 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // // This updates children as well - wxString nvs = wxT("Lamborghini Diablo XYZ; 5707; [100; 3.9; 8.6] 3000002; Convertible"); + wxString nvs = "Lamborghini Diablo XYZ; 5707; [100; 3.9; 8.6] 3000002; Convertible"; pgman->SetPropertyValue("Car", nvs); - if ( pgman->GetPropertyValueAsString(wxT("Car.Model")) != wxT("Lamborghini Diablo XYZ") ) + if ( pgman->GetPropertyValueAsString("Car.Model") != "Lamborghini Diablo XYZ" ) { RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Model=%s"), pgman->GetPropertyValueAsString(wxS("Car.Model")).c_str())); } - if ( pgman->GetPropertyValueAsInt(wxT("Car.Speeds.Max. Speed (mph)")) != 100 ) + if ( pgman->GetPropertyValueAsInt("Car.Speeds.Max. Speed (mph)") != 100 ) { - RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Speeds.Max. Speed (mph)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Speeds.Max. Speed (mph)")).c_str())); + RT_FAILURE_MSG(wxString::Format("Did not match: Car.Speeds.Max. Speed (mph)=%s", pgman->GetPropertyValueAsString(wxS("Car.Speeds.Max. Speed (mph)")).c_str())); } - if ( pgman->GetPropertyValueAsInt(wxT("Car.Price ($)")) != 3000002 ) + if ( pgman->GetPropertyValueAsInt("Car.Price ($)") != 3000002 ) { RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Price ($)=%s"), pgman->GetPropertyValueAsString(wxS("Car.Price ($)")).c_str())); } - if ( !pgman->GetPropertyValueAsBool(wxT("Car.Convertible")) ) + if ( !pgman->GetPropertyValueAsBool("Car.Convertible") ) { - RT_FAILURE_MSG(wxString::Format(wxS("Did not match: Car.Convertible=%s"), pgman->GetPropertyValueAsString(wxS("Car.Convertible")).c_str())); + RT_FAILURE_MSG(wxString::Format("Did not match: Car.Convertible=%s", pgman->GetPropertyValueAsString(wxS("Car.Convertible")).c_str())); } // SetPropertyValueString for special cases such as wxColour - pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("(123,4,255)")); - col << pgman->GetPropertyValue(wxT("ColourProperty")); + pgman->SetPropertyValueString("ColourProperty", "(123,4,255)"); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != wxColour(123, 4, 255) ) RT_FAILURE(); - pgman->SetPropertyValueString(wxT("ColourProperty"), wxT("#FE860B")); - col << pgman->GetPropertyValue(wxT("ColourProperty")); + pgman->SetPropertyValueString("ColourProperty", "#FE860B"); + col << pgman->GetPropertyValue("ColourProperty"); if ( col != wxColour(254, 134, 11) ) RT_FAILURE(); - pgman->SetPropertyValueString(wxT("ColourPropertyWithAlpha"), - wxT("(10, 20, 30, 128)")); - col << pgman->GetPropertyValue(wxT("ColourPropertyWithAlpha")); + pgman->SetPropertyValueString("ColourPropertyWithAlpha", + "(10, 20, 30, 128)"); + col << pgman->GetPropertyValue("ColourPropertyWithAlpha"); if ( col != wxColour(10, 20, 30, 128) ) RT_FAILURE(); - if ( pgman->GetPropertyValueAsString(wxT("ColourPropertyWithAlpha")) - != wxT("(10,20,30,128)") ) + if ( pgman->GetPropertyValueAsString("ColourPropertyWithAlpha") + != "(10,20,30,128)" ) RT_FAILURE(); } @@ -798,18 +798,18 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(SetPropertyValueUnspecified) // Null variant setter tests - pgman->SetPropertyValueUnspecified(wxT("StringProperty")); - pgman->SetPropertyValueUnspecified(wxT("IntProperty")); - pgman->SetPropertyValueUnspecified(wxT("FloatProperty")); - pgman->SetPropertyValueUnspecified(wxT("BoolProperty")); - pgman->SetPropertyValueUnspecified(wxT("EnumProperty")); - pgman->SetPropertyValueUnspecified(wxT("ArrayStringProperty")); - pgman->SetPropertyValueUnspecified(wxT("ColourProperty")); - pgman->SetPropertyValueUnspecified(wxT("Size")); - pgman->SetPropertyValueUnspecified(wxT("Position")); - pgman->SetPropertyValueUnspecified(wxT("MultiChoiceProperty")); + pgman->SetPropertyValueUnspecified("StringProperty"); + pgman->SetPropertyValueUnspecified("IntProperty"); + pgman->SetPropertyValueUnspecified("FloatProperty"); + pgman->SetPropertyValueUnspecified("BoolProperty"); + pgman->SetPropertyValueUnspecified("EnumProperty"); + pgman->SetPropertyValueUnspecified("ArrayStringProperty"); + pgman->SetPropertyValueUnspecified("ColourProperty"); + pgman->SetPropertyValueUnspecified("Size"); + pgman->SetPropertyValueUnspecified("Position"); + pgman->SetPropertyValueUnspecified("MultiChoiceProperty"); #if wxUSE_DATETIME - pgman->SetPropertyValueUnspecified(wxT("DateProperty")); + pgman->SetPropertyValueUnspecified("DateProperty"); #endif } @@ -823,10 +823,10 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pg = pgman->GetGrid(); - wxPGProperty* prop1 = pg->GetProperty(wxT("Label")); - wxPGProperty* prop2 = pg->GetProperty(wxT("Cell Text Colour")); - wxPGProperty* prop3 = pg->GetProperty(wxT("Height")); - wxPGProperty* catProp = pg->GetProperty(wxT("Appearance")); + wxPGProperty* prop1 = pg->GetProperty("Label"); + wxPGProperty* prop2 = pg->GetProperty("Cell Text Colour"); + wxPGProperty* prop3 = pg->GetProperty("Height"); + wxPGProperty* catProp = pg->GetProperty("Appearance"); RT_ASSERT( prop1 && prop2 && prop3 ); @@ -882,7 +882,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pg->MakeColumnEditable(2, true); pg->MakeColumnEditable(0, false); pg->MakeColumnEditable(2, false); - pg->SelectProperty(wxT("Height")); + pg->SelectProperty("Height"); pg->BeginLabelEdit(0); pg->BeginLabelEdit(0); pg->EndLabelEdit(0); @@ -896,15 +896,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(Attributes) - wxPGProperty* prop = pgman->GetProperty(wxT("StringProperty")); - prop->SetAttribute(wxT("Dummy Attribute"), (long)15); + wxPGProperty* prop = pgman->GetProperty("StringProperty"); + prop->SetAttribute("Dummy Attribute", (long)15); - if ( prop->GetAttribute(wxT("Dummy Attribute")).GetLong() != 15 ) + if ( prop->GetAttribute("Dummy Attribute").GetLong() != 15 ) RT_FAILURE(); - prop->SetAttribute(wxT("Dummy Attribute"), wxVariant()); + prop->SetAttribute("Dummy Attribute", wxVariant()); - if ( !prop->GetAttribute(wxT("Dummy Attribute")).IsNull() ) + if ( !prop->GetAttribute("Dummy Attribute").IsNull() ) RT_FAILURE(); } @@ -913,20 +913,20 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(DoubleToString) // Locale-specific decimal separator - wxString sep = wxString::Format(wxT("%g"), 1.1)[1]; + wxString sep = wxString::Format("%g", 1.1)[1]; wxString s; if ( wxPropertyGrid::DoubleToString(s, 123.123, 2, true) != - wxString::Format(wxT("123%s12"), sep.c_str()) ) + wxString::Format("123%s12", sep.c_str()) ) RT_FAILURE(); if ( wxPropertyGrid::DoubleToString(s, -123.123, 4, false) != - wxString::Format(wxT("-123%s1230"), sep.c_str()) ) + wxString::Format("-123%s1230", sep.c_str()) ) RT_FAILURE(); if ( wxPropertyGrid::DoubleToString(s, -0.02, 1, false) != - wxString::Format(wxT("0%s0"), sep) ) + wxString::Format("0%s0", sep) ) RT_FAILURE(); - if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != wxT("0") ) + if ( wxPropertyGrid::DoubleToString(s, -0.000123, 3, true) != "0" ) RT_FAILURE(); } #endif @@ -943,11 +943,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(GetPropertyValues) page1 = pgman->GetPage(0); - pg1_values = page1->GetPropertyValues(wxT("Page1"),NULL,wxPG_KEEP_STRUCTURE); + pg1_values = page1->GetPropertyValues("Page1",NULL,wxPG_KEEP_STRUCTURE); page2 = pgman->GetPage(1); - pg2_values = page2->GetPropertyValues(wxT("Page2"),NULL,wxPG_KEEP_STRUCTURE); + pg2_values = page2->GetPropertyValues("Page2",NULL,wxPG_KEEP_STRUCTURE); page3 = pgman->GetPage(2); - pg3_values = page3->GetPropertyValues(wxT("Page3"),NULL,wxPG_KEEP_STRUCTURE); + pg3_values = page3->GetPropertyValues("Page3",NULL,wxPG_KEEP_STRUCTURE); } { @@ -980,7 +980,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) page->Collapse( p ); - t.Printf(wxT("Collapsing: %s\n"),page->GetPropertyLabel(p).c_str()); + t.Printf("Collapsing: %s\n",page->GetPropertyLabel(p).c_str()); ed->AppendText(t); } } @@ -1021,7 +1021,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) page->Expand( p ); - t.Printf(wxT("Expand: %s\n"),page->GetPropertyLabel(p).c_str()); + t.Printf("Expand: %s\n",page->GetPropertyLabel(p).c_str()); ed->AppendText(t); } } @@ -1030,14 +1030,14 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(Choice_Manipulation) - wxPGProperty* enumProp = pgman->GetProperty(wxT("EnumProperty")); + wxPGProperty* enumProp = pgman->GetProperty("EnumProperty"); pgman->SelectPage(2); pgman->SelectProperty(enumProp); wxASSERT(pgman->GetGrid()->GetSelection() == enumProp); const wxPGChoices& choices = enumProp->GetChoices(); - int ind = enumProp->InsertChoice(wxT("New Choice"), choices.GetCount()/2); + int ind = enumProp->InsertChoice("New Choice", choices.GetCount()/2); enumProp->DeleteChoice(ind); // Recreate the original grid @@ -1084,7 +1084,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(EnsureVisible) - pgman->EnsureVisible(wxT("Cell Colour")); + pgman->EnsureVisible("Cell Colour"); } { @@ -1093,17 +1093,17 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p; wxPGProperty* origParent = - pgman->GetProperty(wxT("Window Styles"))->GetParent(); + pgman->GetProperty("Window Styles")->GetParent(); // For testing purposes, let's set some custom cell colours - p = pgman->GetProperty(wxT("Window Styles")); + p = pgman->GetProperty("Window Styles"); p->SetCell(2, wxPGCell("style")); - p = pgman->RemoveProperty(wxT("Window Styles")); + p = pgman->RemoveProperty("Window Styles"); pgman->Refresh(); pgman->Update(); pgman->AppendIn(origParent, p); - wxASSERT( p->GetCell(2).GetText() == wxT("style")); + wxASSERT( p->GetCell(2).GetText() == "style"); pgman->Refresh(); pgman->Update(); } @@ -1115,40 +1115,40 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) // Make sure indexes are as supposed - p = pgman->GetProperty(wxT("User Name")); + p = pgman->GetProperty("User Name"); if ( p->GetIndexInParent() != 3 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Id")); + p = pgman->GetProperty("User Id"); if ( p->GetIndexInParent() != 2 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Home")); + p = pgman->GetProperty("User Home"); if ( p->GetIndexInParent() != 1 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("Operating System")); + p = pgman->GetProperty("Operating System"); if ( p->GetIndexInParent() != 0 ) RT_FAILURE(); pgman->GetGrid()->SetSortFunction(MyPropertySortFunction); - pgman->GetGrid()->SortChildren(wxT("Environment")); + pgman->GetGrid()->SortChildren("Environment"); // Make sure indexes have been reversed - p = pgman->GetProperty(wxT("User Name")); + p = pgman->GetProperty("User Name"); if ( p->GetIndexInParent() != 0 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Id")); + p = pgman->GetProperty("User Id"); if ( p->GetIndexInParent() != 1 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("User Home")); + p = pgman->GetProperty("User Home"); if ( p->GetIndexInParent() != 2 ) RT_FAILURE(); - p = pgman->GetProperty(wxT("Operating System")); + p = pgman->GetProperty("Operating System"); if ( p->GetIndexInParent() != 3 ) RT_FAILURE(); } @@ -1166,7 +1166,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_START_TEST(Clear) // Manager clear - pgman->SelectProperty(wxT("Label")); + pgman->SelectProperty("Label"); pgman->Clear(); if ( pgman->GetPageCount() ) @@ -1180,7 +1180,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman = m_pPropGridManager; // Grid clear - pgman->SelectProperty(wxT("Label")); + pgman->SelectProperty("Label"); pgman->GetGrid()->Clear(); if ( pgman->GetGrid()->GetRoot()->GetChildCount() ) @@ -1209,7 +1209,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman->SetSplitterPosition(trySplitterPos); if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos ) - RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); + RT_FAILURE_MSG(wxString::Format("Splitter position was %i (should have been %i)",(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); m_topSizer->Add( m_pPropGridManager, wxSizerFlags(1).Expand()); FinalizePanel(); @@ -1221,7 +1221,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) SetSize(sz); if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos ) - RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); + RT_FAILURE_MSG(wxString::Format("Splitter position was %i (should have been %i)",(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos)); SetSize(origSz); @@ -1246,7 +1246,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr1[i]; page->HideProperty(p, true); - wxString s = wxString::Format(wxT("HideProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel().c_str()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1262,7 +1262,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr2[i]; page->HideProperty(p, false); - wxString s = wxString::Format(wxT("ShowProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel().c_str()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1280,7 +1280,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr1[i]; page->HideProperty(p, true); - wxString s = wxString::Format(wxT("HideProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel().c_str()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1296,7 +1296,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr2[i]; page->HideProperty(p, false); - wxString s = wxString::Format(wxT("ShowProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel().c_str()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1315,7 +1315,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr1[i]; page->HideProperty(p, true); - wxString s = wxString::Format(wxT("HideProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("HideProperty(%i, %s)", (int)i, p->GetLabel().c_str()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1331,7 +1331,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPGProperty* p = arr2[i]; page->HideProperty(p, false); - wxString s = wxString::Format(wxT("ShowProperty(%i, %s)"), (int)i, p->GetLabel().c_str()); + wxString s = wxString::Format("ShowProperty(%i, %s)", (int)i, p->GetLabel().c_str()); RT_VALIDATE_VIRTUAL_HEIGHT(page, s) if ( _failed_ ) break; @@ -1592,7 +1592,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman = m_pPropGridManager; for ( i=3; i<12; i+=2 ) { - RT_MSG(wxString::Format(wxT("%i columns"),(int)i)); + RT_MSG(wxString::Format("%i columns",(int)i)); pgman->SetColumnCount(i); Refresh(); Update(); @@ -1610,7 +1610,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) for ( i=4; i<16; i++ ) { int flag = 1<m_warnings); + s = wxString::Format("All tests were successful, but there were %i warnings!", wxPGGlobalVars->m_warnings); #endif RT_MSG(s) for ( i=0; iRefresh(); - wxLogStatus(this, wxT("Successfully loaded the renderer \"%s\"."), + wxLogStatus(this, "Successfully loaded the renderer \"%s\".", name.c_str()); } } diff --git a/samples/ribbon/ribbondemo.cpp b/samples/ribbon/ribbondemo.cpp index 9f74eac9c6..3ea2150c5a 100644 --- a/samples/ribbon/ribbondemo.cpp +++ b/samples/ribbon/ribbondemo.cpp @@ -651,7 +651,7 @@ void MyFrame::OnPrimaryColourSelect(wxRibbonGalleryEvent& evt) { wxString name; wxColour colour = GetGalleryColour(evt.GetGallery(), evt.GetGalleryItem(), &name); - AddText(wxT("Colour \"") + name + wxT("\" selected as primary.")); + AddText("Colour \"" + name + "\" selected as primary."); wxColour secondary, tertiary; m_ribbon->GetArtProvider()->GetColourScheme(NULL, &secondary, &tertiary); m_ribbon->GetArtProvider()->SetColourScheme(colour, secondary, tertiary); @@ -663,7 +663,7 @@ void MyFrame::OnSecondaryColourSelect(wxRibbonGalleryEvent& evt) { wxString name; wxColour colour = GetGalleryColour(evt.GetGallery(), evt.GetGalleryItem(), &name); - AddText(wxT("Colour \"") + name + wxT("\" selected as secondary.")); + AddText("Colour \"" + name + "\" selected as secondary."); wxColour primary, tertiary; m_ribbon->GetArtProvider()->GetColourScheme(&primary, NULL, &tertiary); m_ribbon->GetArtProvider()->SetColourScheme(primary, colour, tertiary); diff --git a/samples/stc/edit.cpp b/samples/stc/edit.cpp index 7d9b970ea1..7e7f412ec2 100644 --- a/samples/stc/edit.cpp +++ b/samples/stc/edit.cpp @@ -149,9 +149,9 @@ Edit::Edit (wxWindow *parent, wxWindowID id, StyleSetFont (wxSTC_STYLE_DEFAULT, font); StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK); StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE); - StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY")); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); - StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); + StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY")); InitializePrefs (DEFAULT_LANGUAGE); // set visibility @@ -160,19 +160,19 @@ Edit::Edit (wxWindow *parent, wxWindowID id, SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1); // markers - MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("WHITE")); - MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("WHITE")); - MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, "BLACK", "WHITE"); + MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, "BLACK", "WHITE"); + MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK"); + MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, "BLACK", "BLACK"); // annotations AnnotationSetVisible(wxSTC_ANNOTATION_BOXED); // miscellaneous - m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, wxT("_999999")); + m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, "_999999"); m_FoldingMargin = 16; CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key SetLayoutCache (wxSTC_CACHE_PAGE); @@ -501,8 +501,8 @@ wxString Edit::DeterminePrefs (const wxString &filename) { while (!filepattern.empty()) { wxString cur = filepattern.BeforeFirst (';'); if ((cur == filename) || - (cur == (filename.BeforeLast ('.') + wxT(".*"))) || - (cur == (wxT("*.") + filename.AfterLast ('.')))) { + (cur == (filename.BeforeLast ('.') + ".*")) || + (cur == ("*." + filename.AfterLast ('.')))) { return curInfo->name; } filepattern = filepattern.AfterFirst (';'); @@ -536,7 +536,7 @@ bool Edit::InitializePrefs (const wxString &name) { // set margin for line numbers SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER); - StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour ("DARK GREY")); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); SetMarginWidth (m_LineNrID, 0); // start out not visible @@ -554,8 +554,8 @@ bool Edit::InitializePrefs (const wxString &name) { } // set common styles - StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY"))); - StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour ("DARK GREY")); + StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour ("DARK GREY")); // initialize settings if (g_CommonPrefs.syntaxEnable) { @@ -567,10 +567,10 @@ bool Edit::InitializePrefs (const wxString &name) { .Family(wxFONTFAMILY_MODERN) .FaceName(curType.fontname)); StyleSetFont (Nr, font); - if (curType.foreground) { + if (curType.foreground.length()) { StyleSetForeground (Nr, wxColour (curType.foreground)); } - if (curType.background) { + if (curType.background.length()) { StyleSetBackground (Nr, wxColour (curType.background)); } StyleSetBold (Nr, (curType.fontstyle & mySTC_STYLE_BOLD) > 0); @@ -600,21 +600,21 @@ bool Edit::InitializePrefs (const wxString &name) { if (g_CommonPrefs.foldEnable) { SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0); SetMarginSensitive (m_FoldingID, curInfo->folds != 0); - SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.comment"), - (curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.compact"), - (curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.preprocessor"), - (curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.html"), - (curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.html.preprocessor"), - (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.comment.python"), - (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0")); - SetProperty (wxT("fold.quotes.python"), - (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0")); + SetProperty ("fold", curInfo->folds != 0? "1": "0"); + SetProperty ("fold.comment", + (curInfo->folds & mySTC_FOLD_COMMENT) > 0? "1": "0"); + SetProperty ("fold.compact", + (curInfo->folds & mySTC_FOLD_COMPACT) > 0? "1": "0"); + SetProperty ("fold.preprocessor", + (curInfo->folds & mySTC_FOLD_PREPROC) > 0? "1": "0"); + SetProperty ("fold.html", + (curInfo->folds & mySTC_FOLD_HTML) > 0? "1": "0"); + SetProperty ("fold.html.preprocessor", + (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? "1": "0"); + SetProperty ("fold.comment.python", + (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? "1": "0"); + SetProperty ("fold.quotes.python", + (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? "1": "0"); } SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED); @@ -646,8 +646,8 @@ bool Edit::LoadFile () #if wxUSE_FILEDLG // get filename if (!m_filename) { - wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, - wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); + wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString, + "Any file (*)|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); if (dlg.ShowModal() != wxID_OK) return false; m_filename = dlg.GetPath(); } @@ -683,7 +683,7 @@ bool Edit::SaveFile () // get filename if (!m_filename) { - wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), + wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) return false; m_filename = dlg.GetPath(); @@ -757,14 +757,14 @@ EditProperties::EditProperties (Edit *edit, textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetLexer()); + text = wxString::Format ("%d", edit->GetLexer()); textinfo->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); wxString EOLtype = wxEmptyString; switch (edit->GetEOLMode()) { - case wxSTC_EOL_CR: {EOLtype = wxT("CR (Unix)"); break; } - case wxSTC_EOL_CRLF: {EOLtype = wxT("CRLF (Windows)"); break; } - case wxSTC_EOL_LF: {EOLtype = wxT("CR (Macintosh)"); break; } + case wxSTC_EOL_CR: {EOLtype = "CR (Unix)"; break; } + case wxSTC_EOL_CRLF: {EOLtype = "CRLF (Windows)"; break; } + case wxSTC_EOL_LF: {EOLtype = "CR (Macintosh)"; break; } } textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), @@ -774,7 +774,7 @@ EditProperties::EditProperties (Edit *edit, // text info box wxStaticBoxSizer *textinfos = new wxStaticBoxSizer ( - new wxStaticBox (this, wxID_ANY, _("Informations")), + new wxStaticBox (this, wxID_ANY, _("Information")), wxVERTICAL); textinfos->Add (textinfo, 0, wxEXPAND); textinfos->Add (0, 6); @@ -784,25 +784,25 @@ EditProperties::EditProperties (Edit *edit, statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetLineCount()); + text = wxString::Format ("%d", edit->GetLineCount()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetTextLength()); + text = wxString::Format ("%d", edit->GetTextLength()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetCurrentLine()); + text = wxString::Format ("%d", edit->GetCurrentLine()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (wxT("%d"), edit->GetCurrentPos()); + text = wxString::Format ("%d", edit->GetCurrentPos()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); @@ -836,7 +836,7 @@ EditProperties::EditProperties (Edit *edit, // EditPrint //---------------------------------------------------------------------------- -EditPrint::EditPrint (Edit *edit, const wxChar *title) +EditPrint::EditPrint (Edit *edit, const wxString& title) : wxPrintout(title) , m_edit(edit) { diff --git a/samples/stc/edit.h b/samples/stc/edit.h index 10f4e39c56..908990e757 100644 --- a/samples/stc/edit.h +++ b/samples/stc/edit.h @@ -162,7 +162,7 @@ class EditPrint: public wxPrintout { public: //! constructor - EditPrint (Edit *edit, const wxChar *title = wxT("")); + EditPrint (Edit *edit, const wxString& title = ""); //! event handlers bool OnPrintPage (int page) wxOVERRIDE; diff --git a/samples/stc/prefs.cpp b/samples/stc/prefs.cpp index 0e98bcf95a..e2f6bb88f9 100644 --- a/samples/stc/prefs.cpp +++ b/samples/stc/prefs.cpp @@ -218,159 +218,159 @@ const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs); //! style types const StyleInfo g_StylePrefs [] = { // mySTC_TYPE_DEFAULT - {wxT("Default"), - wxT("BLACK"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Default", + "BLACK", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD1 - {wxT("Keyword1"), - wxT("BLUE"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_BOLD, 0}, + {"Keyword1", + "BLUE", "WHITE", + "", 10, mySTC_STYLE_BOLD, 0}, // mySTC_TYPE_WORD2 - {wxT("Keyword2"), - wxT("MIDNIGHT BLUE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword2", + "MIDNIGHT BLUE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD3 - {wxT("Keyword3"), - wxT("CORNFLOWER BLUE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword3", + "CORNFLOWER BLUE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD4 - {wxT("Keyword4"), - wxT("CYAN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword4", + "CYAN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD5 - {wxT("Keyword5"), - wxT("DARK GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword5", + "DARK GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_WORD6 - {wxT("Keyword6"), - wxT("GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Keyword6", + "GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT - {wxT("Comment"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Comment", + "FOREST GREEN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT_DOC - {wxT("Comment (Doc)"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Comment (Doc)", + "FOREST GREEN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT_LINE - {wxT("Comment line"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Comment line", + "FOREST GREEN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMENT_SPECIAL - {wxT("Special comment"), - wxT("FOREST GREEN"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_ITALIC, 0}, + {"Special comment", + "FOREST GREEN", "WHITE", + "", 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_CHARACTER - {wxT("Character"), - wxT("KHAKI"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Character", + "KHAKI", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_CHARACTER_EOL - {wxT("Character (EOL)"), - wxT("KHAKI"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Character (EOL)", + "KHAKI", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_STRING - {wxT("String"), - wxT("BROWN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"String", + "BROWN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_STRING_EOL - {wxT("String (EOL)"), - wxT("BROWN"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"String (EOL)", + "BROWN", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_DELIMITER - {wxT("Delimiter"), - wxT("ORANGE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Delimiter", + "ORANGE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_PUNCTUATION - {wxT("Punctuation"), - wxT("ORANGE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Punctuation", + "ORANGE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_OPERATOR - {wxT("Operator"), - wxT("BLACK"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_BOLD, 0}, + {"Operator", + "BLACK", "WHITE", + "", 10, mySTC_STYLE_BOLD, 0}, // mySTC_TYPE_BRACE - {wxT("Label"), - wxT("VIOLET"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Label", + "VIOLET", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_COMMAND - {wxT("Command"), - wxT("BLUE"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Command", + "BLUE", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_IDENTIFIER - {wxT("Identifier"), - wxT("BLACK"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Identifier", + "BLACK", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_LABEL - {wxT("Label"), - wxT("VIOLET"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Label", + "VIOLET", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_NUMBER - {wxT("Number"), - wxT("SIENNA"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Number", + "SIENNA", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_PARAMETER - {wxT("Parameter"), - wxT("VIOLET"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_ITALIC, 0}, + {"Parameter", + "VIOLET", "WHITE", + "", 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_REGEX - {wxT("Regular expression"), - wxT("ORCHID"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Regular expression", + "ORCHID", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_UUID - {wxT("UUID"), - wxT("ORCHID"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"UUID", + "ORCHID", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_VALUE - {wxT("Value"), - wxT("ORCHID"), wxT("WHITE"), - wxT(""), 10, mySTC_STYLE_ITALIC, 0}, + {"Value", + "ORCHID", "WHITE", + "", 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_PREPROCESSOR - {wxT("Preprocessor"), - wxT("GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Preprocessor", + "GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_SCRIPT - {wxT("Script"), - wxT("DARK GREY"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Script", + "DARK GREY", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_ERROR - {wxT("Error"), - wxT("RED"), wxT("WHITE"), - wxT(""), 10, 0, 0}, + {"Error", + "RED", "WHITE", + "", 10, 0, 0}, // mySTC_TYPE_UNDEFINED - {wxT("Undefined"), - wxT("ORANGE"), wxT("WHITE"), - wxT(""), 10, 0, 0} + {"Undefined", + "ORANGE", "WHITE", + "", 10, 0, 0} }; diff --git a/samples/stc/prefs.h b/samples/stc/prefs.h index 74db4de9ce..5c8fd7e472 100644 --- a/samples/stc/prefs.h +++ b/samples/stc/prefs.h @@ -136,10 +136,10 @@ extern const int g_LanguagePrefsSize; //---------------------------------------------------------------------------- // StyleInfo struct StyleInfo { - const wxChar *name; - const wxChar *foreground; - const wxChar *background; - const wxChar *fontname; + const wxString name; + const wxString foreground; + const wxString background; + const wxString fontname; int fontsize; int fontstyle; int lettercase; diff --git a/samples/stc/stctest.cpp b/samples/stc/stctest.cpp index e60c04cd97..122626f4fe 100644 --- a/samples/stc/stctest.cpp +++ b/samples/stc/stctest.cpp @@ -54,19 +54,19 @@ // declarations //============================================================================ -#define APP_NAME wxT("STC-Test") -#define APP_DESCR _("See http://wxguide.sourceforge.net/") +#define APP_NAME "STC-Test" +#define APP_DESCR "See http://wxguide.sourceforge.net/" -#define APP_MAINT wxT("Otto Wyss") -#define APP_VENDOR wxT("wxWidgets") -#define APP_COPYRIGTH wxT("(C) 2003 Otto Wyss") -#define APP_LICENCE wxT("wxWidgets") +#define APP_MAINT "Otto Wyss" +#define APP_VENDOR "wxWidgets" +#define APP_COPYRIGTH "(C) 2003 Otto Wyss" +#define APP_LICENCE "wxWidgets" -#define APP_VERSION wxT("0.1.alpha") +#define APP_VERSION "0.1.alpha" #define APP_BUILD __DATE__ -#define APP_WEBSITE wxT("http://www.wxWidgets.org") -#define APP_MAIL wxT("mailto://???") +#define APP_WEBSITE "http://www.wxWidgets.org" +#define APP_MAIL "mailto://???" #define NONAME _("") @@ -214,7 +214,7 @@ bool App::OnInit () { SetVendorName (APP_VENDOR); g_appname = new wxString (); g_appname->Append (APP_VENDOR); - g_appname->Append (wxT("-")); + g_appname->Append ("-"); g_appname->Append (APP_NAME); #if wxUSE_PRINTING_ARCHITECTURE @@ -301,7 +301,7 @@ AppFrame::AppFrame (const wxString &title) // set icon and background SetTitle (*g_appname); - SetBackgroundColour (wxT("WHITE")); + SetBackgroundColour ("WHITE"); // create menu m_menuBar = new wxMenuBar; @@ -311,7 +311,7 @@ AppFrame::AppFrame (const wxString &title) m_edit = new Edit (this, wxID_ANY); m_edit->SetFocus(); - FileOpen (wxT("stctest.cpp")); + FileOpen ("stctest.cpp"); } AppFrame::~AppFrame () { @@ -341,7 +341,7 @@ void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) { if (!m_edit) return; #if wxUSE_FILEDLG wxString fname; - wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), + wxFileDialog dlg (this, "Open file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); if (dlg.ShowModal() != wxID_OK) return; fname = dlg.GetPath (); @@ -363,7 +363,7 @@ void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) { if (!m_edit) return; #if wxUSE_FILEDLG wxString filename = wxEmptyString; - wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); + wxFileDialog dlg (this, "Save file", wxEmptyString, wxEmptyString, "Any file (*)|*", wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) return; filename = dlg.GetPath(); m_edit->SaveFile (filename); @@ -466,8 +466,8 @@ void AppFrame::OnContextMenu(wxContextMenuEvent& evt) } wxMenu menu; - menu.Append(wxID_ABOUT, wxT("&About")); - menu.Append(wxID_EXIT, wxT("E&xit")); + menu.Append(wxID_ABOUT, "&About"); + menu.Append(wxID_EXIT, "E&xit"); PopupMenu(&menu, point); } @@ -733,23 +733,23 @@ public: { SetLexerXml(); - SetProperty(wxT("fold"), wxT("1")); - SetProperty(wxT("fold.comment"), wxT("1")); - SetProperty(wxT("fold.compact"), wxT("1")); - SetProperty(wxT("fold.preprocessor"), wxT("1")); - SetProperty(wxT("fold.html"), wxT("1")); - SetProperty(wxT("fold.html.preprocessor"), wxT("1")); + SetProperty("fold", "1"); + SetProperty("fold.comment", "1"); + SetProperty("fold.compact", "1"); + SetProperty("fold.preprocessor", "1"); + SetProperty("fold.html", "1"); + SetProperty("fold.html.preprocessor", "1"); SetMarginType(margin_id_lineno, wxSTC_MARGIN_NUMBER); SetMarginWidth(margin_id_lineno, 32); - MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, wxT("WHITE"), wxT("BLACK")); - MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, wxT("WHITE"), wxT("BLACK")); + MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_BOXPLUS, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_BOXMINUS, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_VLINE, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_BOXPLUSCONNECTED, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_BOXMINUSCONNECTED, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_TCORNER, "WHITE", "BLACK"); + MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_LCORNER, "WHITE", "BLACK"); SetMarginMask(margin_id_fold, wxSTC_MASK_FOLDERS); SetMarginWidth(margin_id_fold, 32); @@ -780,7 +780,7 @@ public: StyleSetForeground(wxSTC_H_DOUBLESTRING, *wxBLACK); StyleSetForeground(wxSTC_H_SINGLESTRING, *wxBLACK); StyleSetForeground(wxSTC_H_OTHER, *wxBLUE); - StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find(wxT("GREY"))); + StyleSetForeground(wxSTC_H_COMMENT, wxTheColourDatabase->Find("GREY")); StyleSetForeground(wxSTC_H_ENTITY, *wxRED); StyleSetBold(wxSTC_H_ENTITY, true); StyleSetForeground(wxSTC_H_TAGEND, *wxBLUE); @@ -814,7 +814,7 @@ void MinimalEditor::OnMarginClick(wxStyledTextEvent &event) void MinimalEditor::OnText(wxStyledTextEvent& event) { - wxLogDebug(wxT("Modified")); + wxLogDebug("Modified"); event.Skip(); } diff --git a/samples/text/text.cpp b/samples/text/text.cpp index c95c949498..fc20d792a0 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -898,7 +898,7 @@ void MyTextCtrl::OnText(wxCommandEvent& event) const wxChar *data = (const wxChar *)(win->GetClientData()); if ( data ) { - wxLogMessage(wxT("Text %s in control \"%s\""), changeVerb, data); + wxLogMessage("Text %s in control \"%s\"", changeVerb, data); } else { @@ -1022,7 +1022,7 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) (unsigned int) sel.length()); const wxString text = GetLineText(line); - wxLogMessage(wxT("Current line: \"%s\"; length = %lu"), + wxLogMessage("Current line: \"%s\"; length = %lu", text.c_str(), text.length()); } break; @@ -1212,7 +1212,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) "very very very long line to test " "wxHSCROLL style\n" "\nAnd here is a link in quotation marks to " - wxT("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""), + "test wxTE_AUTO_URL: \"http://www.wxwidgets.org\"", wxPoint(450, 10), wxSize(200, 230), wxTE_RICH | wxTE_MULTILINE | wxTE_AUTO_URL); m_textrich->SetStyle(0, 10, *wxRED); diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 0b442bf8c3..ac7bc3daad 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -605,7 +605,7 @@ MyFrame::MyFrame(wxFrame* parent, toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, "Toggle &2nd radio button\tCtrl-2"); toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, "Toggle &3rd radio button\tCtrl-3"); toolMenu->AppendSeparator(); - toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, wxT("Change tooltip of \"New\"")); + toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, "Change tooltip of \"New\""); toolMenu->AppendSeparator(); toolMenu->Append(IDM_TOOLBAR_INC_TOOL_SPACING, "Increase spacing\tCtrl-+"); toolMenu->Append(IDM_TOOLBAR_DEC_TOOL_SPACING, "Decrease spacing\tCtrl--"); diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index 4543073660..230a6da343 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -1298,12 +1298,12 @@ void MyTreeCtrl::DoResetBrokenStateImages(const wxTreeItemId& idParent, DoResetBrokenStateImages(idParent, cookie, state); } -void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event) +void MyTreeCtrl::LogEvent(const wxString& name, const wxTreeEvent& event) { wxTreeItemId item = event.GetItem(); wxString text; if ( item.IsOk() ) - text << wxT('"') << GetItemText(item).c_str() << wxT('"'); + text << '"' << GetItemText(item).c_str() << '"'; else text = "invalid item"; wxLogMessage("%s(%s)", name, text.c_str()); @@ -1313,7 +1313,7 @@ void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event) #define TREE_EVENT_HANDLER(name) \ void MyTreeCtrl::name(wxTreeEvent& event) \ { \ - LogEvent(wxT(#name), event); \ + LogEvent(#name, event); \ event.Skip(); \ } @@ -1606,7 +1606,7 @@ void MyTreeCtrl::OnItemStateClick(wxTreeEvent& event) wxTreeItemId itemId = event.GetItem(); DoToggleState(itemId); - wxLogMessage(wxT("Item \"%s\" state changed to %d"), + wxLogMessage("Item \"%s\" state changed to %d", GetItemText(itemId), GetItemState(itemId)); } @@ -1619,8 +1619,8 @@ void MyTreeCtrl::OnItemMenu(wxTreeEvent& event) wxPoint clientpt = event.GetPoint(); wxPoint screenpt = ClientToScreen(clientpt); - wxLogMessage(wxT("OnItemMenu for item \"%s\" at screen coords (%i, %i)"), - item ? item->GetDesc() : wxString(wxS("unknown")), screenpt.x, screenpt.y); + wxLogMessage("OnItemMenu for item \"%s\" at screen coords (%i, %i)", + item ? item->GetDesc() : wxString("unknown"), screenpt.x, screenpt.y); ShowMenu(itemId, clientpt); event.Skip(); @@ -1665,7 +1665,7 @@ void MyTreeCtrl::OnItemRClick(wxTreeEvent& event) MyTreeItemData *item = (MyTreeItemData *)GetItemData(itemId); - wxLogMessage(wxT("Item \"%s\" right clicked"), item ? item->GetDesc() : wxString(wxS("unknown"))); + wxLogMessage("Item \"%s\" right clicked", item ? item->GetDesc() : wxString("unknown")); event.Skip(); } diff --git a/samples/treectrl/treetest.h b/samples/treectrl/treetest.h index 971b745cc1..c615a483bc 100644 --- a/samples/treectrl/treetest.h +++ b/samples/treectrl/treetest.h @@ -147,7 +147,7 @@ private: void DoResetBrokenStateImages(const wxTreeItemId& idParent, wxTreeItemIdValue cookie, int state); - void LogEvent(const wxChar *name, const wxTreeEvent& event); + void LogEvent(const wxString& name, const wxTreeEvent& event); int m_imageSize; // current size of images bool m_reverseSort; // flag for OnCompareItems diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index a703c0ca89..42894c6fcf 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -1051,15 +1051,15 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) ) wxFont* sysFont = new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)); var1 = wxVariant(sysFont); - textCtrl << wxT("var1 = (wxfont)\""); + textCtrl << "var1 = (wxfont)\""; wxFont* font = wxGetVariantCast(var1,wxFont); if (font) { - textCtrl << font->GetNativeFontInfoDesc() << wxT("\"\n"); + textCtrl << font->GetNativeFontInfoDesc() << "\"\n"; } else { - textCtrl << wxT("(null)\"\n"); + textCtrl << "(null)\"\n"; } delete sysFont; diff --git a/samples/widgets/activityindicator.cpp b/samples/widgets/activityindicator.cpp index 78e43bf6c6..b0f2354cab 100644 --- a/samples/widgets/activityindicator.cpp +++ b/samples/widgets/activityindicator.cpp @@ -109,7 +109,7 @@ wxEND_EVENT_TABLE() // ============================================================================ IMPLEMENT_WIDGETS_PAGE(ActivityIndicatorWidgetsPage, - wxT("ActivityIndicator"), NATIVE_CTRLS); + "ActivityIndicator", NATIVE_CTRLS); void ActivityIndicatorWidgetsPage::CreateContent() { diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index f73feb8978..8d33ca70ac 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -242,7 +242,7 @@ wxEND_EVENT_TABLE() #define NATIVE_OR_GENERIC_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, wxT("BitmapCombobox"), +IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, "BitmapCombobox", NATIVE_OR_GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -298,39 +298,39 @@ void BitmapComboBoxWidgetsPage::CreateContent() wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); // left pane - style box - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); // should be in sync with ComboKind_XXX values static const wxString kinds[] = { - wxT("default"), - wxT("simple"), - wxT("drop down"), + "default", + "simple", + "drop down", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "Combobox &kind:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, "&Sort items"); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, "&Read only"); - wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, "&Reset"); sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3); sizerLeft->Add(sizerStyle, wxSizerFlags().Expand()); sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); // left pane - other options box - box = new wxStaticBox(this, wxID_ANY, wxT("Demo options")); + box = new wxStaticBox(this, wxID_ANY, "Demo options"); wxSizer *sizerOptions = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithSmallTextAndLabel(wxT("Control &height:"), + sizerRow = CreateSizerWithSmallTextAndLabel("Control &height:", BitmapComboBoxPage_ChangeHeight, &m_textChangeHeight); m_textChangeHeight->SetSize(20, wxDefaultCoord); @@ -340,42 +340,42 @@ void BitmapComboBoxWidgetsPage::CreateContent() // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change wxBitmapComboBox contents")); + "&Change wxBitmapComboBox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #if wxUSE_IMAGE - btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, wxT("Add &widget icons")); + btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, "Add &widget icons"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, wxT("Insert image from &file")); + btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, "Insert image from &file"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, wxT("&Set image from file")); + btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, "&Set image from file"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #endif - btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, wxT("A&ppend a few strings with images")); + btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, "A&ppend a few strings with images"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, wxT("Append a &few strings")); + btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, "Append a &few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_AddMany, wxT("Append &many strings")); + btn = new wxButton(this, BitmapComboBoxPage_AddMany, "Append &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BitmapComboBoxPage_Delete, - wxT("&Delete this item"), + "&Delete this item", BitmapComboBoxPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_Clear, wxT("&Clear")); + btn = new wxButton(this, BitmapComboBoxPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #if wxUSE_IMAGE @@ -432,7 +432,7 @@ void BitmapComboBoxWidgetsPage::CreateCombo() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( wxT("unknown combo kind") ); + wxFAIL_MSG( "unknown combo kind" ); // fall through case ComboKind_Default: @@ -512,7 +512,7 @@ void BitmapComboBoxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(wxT("Not implemented in wxGTK")); + wxLogMessage("Not implemented in wxGTK"); #endif } } @@ -551,7 +551,7 @@ void BitmapComboBoxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format("test item %u", ++s_item)); } int sel = m_combobox->GetSelection(); @@ -595,15 +595,15 @@ void BitmapComboBoxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(wxT("item #%u"), n)); + m_combobox->Append(wxString::Format("item #%u", n)); } } void BitmapComboBoxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(wxT("First")); - m_combobox->Append(wxT("another one")); - m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); + m_combobox->Append("First"); + m_combobox->Append("another one"); + m_combobox->Append("and the last (very very very very very very very very very very long) one"); } void BitmapComboBoxWidgetsPage::OnButtonAddSeveralWithImages(wxCommandEvent& WXUNUSED(event)) @@ -640,10 +640,10 @@ void BitmapComboBoxWidgetsPage::RescaleImage(wxImage& image, int w, int h) if ( isFirstScale && m_combobox->GetCount() > 0 ) { - wxMessageBox( wxT("wxBitmapComboBox normally only supports images of one size. ") - wxT("However, for demonstration purposes, loaded bitmaps are scaled to fit ") - wxT("using wxImage::Rescale."), - wxT("Notice"), + wxMessageBox( "wxBitmapComboBox normally only supports images of one size. " + "However, for demonstration purposes, loaded bitmaps are scaled to fit " + "using wxImage::Rescale.", + "Notice", wxOK, this ); @@ -658,32 +658,32 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag { wxFileName fn; fn.AssignCwd(); - fn.AppendDir(wxT("icons")); + fn.AppendDir("icons"); wxSetCursor(*wxHOURGLASS_CURSOR); if ( !wxDir::Exists(fn.GetFullPath()) || - !wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) ) + !wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") ) { // Try ../../samples/widgets/icons fn.RemoveLastDir(); fn.RemoveLastDir(); - fn.AppendDir(wxT("icons")); + fn.AppendDir("icons"); if ( !wxDir::Exists(fn.GetFullPath()) || - !wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) ) + !wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") ) { // Try ../../../samples/widgets/icons fn.AssignCwd(); fn.RemoveLastDir(); fn.RemoveLastDir(); fn.RemoveLastDir(); - fn.AppendDir(wxT("samples")); - fn.AppendDir(wxT("widgets")); - fn.AppendDir(wxT("icons")); + fn.AppendDir("samples"); + fn.AppendDir("widgets"); + fn.AppendDir("icons"); if ( !wxDir::Exists(fn.GetFullPath()) || - !wxDir::GetAllFiles(fn.GetFullPath(),strings,wxT("*.xpm")) ) + !wxDir::GetAllFiles(fn.GetFullPath(),strings,"*.xpm") ) { - wxLogWarning(wxT("Could not load widget icons.")); + wxLogWarning("Could not load widget icons."); wxSetCursor(*wxSTANDARD_CURSOR); return; } @@ -703,7 +703,7 @@ void BitmapComboBoxWidgetsPage::LoadWidgetImages( wxArrayString* strings, wxImag wxString name = fn.GetName(); // Handle few exceptions - if ( name == wxT("bmpbtn") ) + if ( name == "bmpbtn" ) { strings->RemoveAt(i); i--; @@ -802,26 +802,26 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - wxT("event and combobox values should be the same") ); + "event and combobox values should be the same" ); if (event.GetEventType() == wxEVT_TEXT_ENTER) { - wxLogMessage(wxT("BitmapCombobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage("BitmapCombobox enter pressed (now '%s')", s.c_str()); } else { - wxLogMessage(wxT("BitmapCombobox text changed (now '%s')"), s.c_str()); + wxLogMessage("BitmapCombobox text changed (now '%s')", s.c_str()); } } void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); - wxLogMessage(wxT("BitmapCombobox item %ld selected"), sel); + wxLogMessage("BitmapCombobox item %ld selected", sel); - wxLogMessage(wxT("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage("BitmapCombobox GetValue(): %s", m_combobox->GetValue().c_str() ); } void BitmapComboBoxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -876,7 +876,7 @@ wxBitmap BitmapComboBoxWidgetsPage::LoadBitmap(const wxString& WXUNUSED(filepath wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr) { - wxString filepath = wxLoadFileSelector(wxT("image"), + wxString filepath = wxLoadFileSelector("image", wxEmptyString, wxEmptyString, this); @@ -897,7 +897,7 @@ wxBitmap BitmapComboBoxWidgetsPage::QueryBitmap(wxString* pStr) if (bitmap.IsOk()) { - wxLogDebug(wxT("%i, %i"),bitmap.GetWidth(), bitmap.GetHeight()); + wxLogDebug("%i, %i",bitmap.GetWidth(), bitmap.GetHeight()); } ::wxSetCursor( *wxSTANDARD_CURSOR ); @@ -936,12 +936,12 @@ wxBitmap BitmapComboBoxWidgetsPage::CreateBitmap(const wxColour& colour) void BitmapComboBoxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox dropped down")); + wxLogMessage("Combobox dropped down"); } void BitmapComboBoxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox closed up")); + wxLogMessage("Combobox closed up"); } #endif // wxUSE_BITMAPCOMBOBOX diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 54bb5db6e5..1275372a6d 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -197,7 +197,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, wxT("Button"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, "Button", FAMILY_CTRLS ); ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -236,21 +236,21 @@ void ButtonWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only"); m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap"); - m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly")); - m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Require a&uth")); + m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly"); + m_chkAuthNeeded = CreateCheckBoxAndAddToSizer(sizerLeft, "Require a&uth"); #if wxUSE_COMMANDLINKBUTTON - m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Use command &link button")); + m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, "Use command &link button"); #endif #if wxUSE_MARKUP m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup"); #endif // wxUSE_MARKUP - m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default")); + m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, "&Default"); m_chkUseBitmapClass = CreateCheckBoxAndAddToSizer(sizerLeft, "Use wxBitmapButton"); @@ -286,22 +286,22 @@ void ButtonWidgetsPage::CreateContent() // should be in sync with enums Button[HV]Align! static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; static const wxString valign[] = { - wxT("top"), - wxT("centre"), - wxT("bottom"), + "top", + "centre", + "bottom", }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); @@ -310,26 +310,26 @@ void ButtonWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, ButtonPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ButtonPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel, - wxT("Change label"), + "Change label", wxID_ANY, &m_textLabel); - m_textLabel->SetValue(wxT("&Press me!")); + m_textLabel->SetValue("&Press me!"); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); #if wxUSE_COMMANDLINKBUTTON m_sizerNote = CreateSizerWithTextAndButton(ButtonPage_ChangeNote, - wxT("Change note"), + "Change note", wxID_ANY, &m_textNote); - m_textNote->SetValue(wxT("Writes down button clicks in the log.")); + m_textNote->SetValue("Writes down button clicks in the log."); sizerMiddle->Add(m_sizerNote, 0, wxALL | wxGROW, 5); #endif @@ -415,7 +415,7 @@ void ButtonWidgetsPage::CreateButton() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ButtonHAlign_Centre: @@ -433,7 +433,7 @@ void ButtonWidgetsPage::CreateButton() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ButtonVAlign_Centre: @@ -456,22 +456,22 @@ void ButtonWidgetsPage::CreateButton() if ( m_chkUseBitmapClass->GetValue() ) { bbtn = new wxBitmapButton(this, ButtonPage_Button, - CreateBitmap(wxT("normal")), + CreateBitmap("normal"), wxDefaultPosition, wxDefaultSize, flags); } else { bbtn = new wxButton(this, ButtonPage_Button); - bbtn->SetBitmapLabel(CreateBitmap(wxT("normal"))); + bbtn->SetBitmapLabel(CreateBitmap("normal")); } if ( m_chkUsePressed->GetValue() ) - bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed"))); + bbtn->SetBitmapPressed(CreateBitmap("pushed")); if ( m_chkUseFocused->GetValue() ) - bbtn->SetBitmapFocus(CreateBitmap(wxT("focused"))); + bbtn->SetBitmapFocus(CreateBitmap("focused")); if ( m_chkUseCurrent->GetValue() ) - bbtn->SetBitmapCurrent(CreateBitmap(wxT("hover"))); + bbtn->SetBitmapCurrent(CreateBitmap("hover")); if ( m_chkUseDisabled->GetValue() ) - bbtn->SetBitmapDisabled(CreateBitmap(wxT("disabled"))); + bbtn->SetBitmapDisabled(CreateBitmap("disabled")); m_button = bbtn; #if wxUSE_COMMANDLINKBUTTON m_cmdLnkButton = NULL; @@ -611,7 +611,7 @@ void ButtonWidgetsPage::OnButtonChangeNote(wxCommandEvent& WXUNUSED(event)) void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Test button clicked.")); + wxLogMessage("Test button clicked."); } // ---------------------------------------------------------------------------- @@ -626,8 +626,8 @@ wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label) dc.SetBackground(*wxCYAN_BRUSH); dc.Clear(); dc.SetTextForeground(*wxBLACK); - dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n") - wxT("(") + label + wxT(" state)"), + dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n" + "(" + label + " state)", wxArtProvider::GetBitmap(wxART_INFORMATION), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 09b21b6238..09893f3029 100644 --- a/samples/widgets/checkbox.cpp +++ b/samples/widgets/checkbox.cpp @@ -155,7 +155,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, wxT("CheckBox"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(CheckBoxWidgetsPage, "CheckBox", FAMILY_CTRLS ); CheckBoxWidgetsPage::CheckBoxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -168,14 +168,14 @@ void CheckBoxWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); m_chkRight = CreateCheckBoxAndAddToSizer ( sizerLeft, - wxT("&Right aligned"), + "&Right aligned", CheckboxPage_ChkRight ); @@ -183,39 +183,39 @@ void CheckBoxWidgetsPage::CreateContent() static const wxString kinds[] = { - wxT("usual &2-state checkbox"), - wxT("&3rd state settable by program"), - wxT("&user-settable 3rd state"), + "usual &2-state checkbox", + "&3rd state settable by program", + "&user-settable 3rd state", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("&Kind"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "&Kind", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1); sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, CheckboxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, CheckboxPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); sizerMiddle->Add(CreateSizerWithTextAndButton(CheckboxPage_ChangeLabel, - wxT("Change label"), + "Change label", wxID_ANY, &m_textLabel), 0, wxALL | wxGROW, 5); - sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, wxT("&Check it")), + sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, "&Check it"), 0, wxALL | wxGROW, 5); - sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, wxT("&Uncheck it")), + sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, "&Uncheck it"), 0, wxALL | wxGROW, 5); sizerMiddle->Add(new wxButton(this, CheckboxPage_PartCheck, - wxT("Put in &3rd state")), + "Put in &3rd state"), 0, wxALL | wxGROW, 5); // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, wxT("&Check me!")); + m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, "&Check me!"); sizerRight->Add(0, 0, 1, wxCENTRE); sizerRight->Add(m_checkbox, 1, wxCENTRE); sizerRight->Add(0, 0, 1, wxCENTRE); @@ -258,7 +258,7 @@ void CheckBoxWidgetsPage::CreateCheckbox() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case CheckboxKind_2State: @@ -307,8 +307,8 @@ void CheckBoxWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) void CheckBoxWidgetsPage::OnCheckBox(wxCommandEvent& event) { - wxLogMessage(wxT("Test checkbox %schecked (value = %d)."), - event.IsChecked() ? wxT("") : wxT("un"), + wxLogMessage("Test checkbox %schecked (value = %d).", + event.IsChecked() ? "" : "un", (int)m_checkbox->Get3StateValue()); } diff --git a/samples/widgets/choice.cpp b/samples/widgets/choice.cpp index 32153588fd..04005a1749 100644 --- a/samples/widgets/choice.cpp +++ b/samples/widgets/choice.cpp @@ -178,7 +178,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"), +IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, "Choice", FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -207,53 +207,53 @@ void ChoiceWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - wxT("&Set choice parameters")); + "&Set choice parameters"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, "&Sort items"); - wxButton *btn = new wxButton(this, ChoicePage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ChoicePage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change choice contents")); + "&Change choice contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Add, wxT("&Add this string")); - m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, wxT("test item 0")); + btn = new wxButton(this, ChoicePage_Add, "&Add this string"); + m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, "test item 0"); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddSeveral, wxT("&Insert a few strings")); + btn = new wxButton(this, ChoicePage_AddSeveral, "&Insert a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddMany, wxT("Add &many strings")); + btn = new wxButton(this, ChoicePage_AddMany, "Add &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Change, wxT("C&hange current")); + btn = new wxButton(this, ChoicePage_Change, "C&hange current"); m_textChange = new wxTextCtrl(this, ChoicePage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Delete, wxT("&Delete this item")); + btn = new wxButton(this, ChoicePage_Delete, "&Delete this item"); m_textDelete = new wxTextCtrl(this, ChoicePage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ChoicePage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_Clear, wxT("&Clear")); + btn = new wxButton(this, ChoicePage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ChoicePage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -367,7 +367,7 @@ void ChoiceWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_choice->Append(s); @@ -379,7 +379,7 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) wxArrayString strings; for ( unsigned int n = 0; n < 1000; n++ ) { - strings.Add(wxString::Format(wxT("item #%u"), n)); + strings.Add(wxString::Format("item #%u", n)); } m_choice->Append(strings); } @@ -387,9 +387,9 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) void ChoiceWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(wxT("First")); - items.Add(wxT("another one")); - items.Add(wxT("and the last (very very very very very very very very very very long) one")); + items.Add("First"); + items.Add("another one"); + items.Add("and the last (very very very very very very very very very very long) one"); m_choice->Insert(items, 0); } @@ -424,9 +424,9 @@ void ChoiceWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event) void ChoiceWidgetsPage::OnChoice(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); - wxLogMessage(wxT("Choice item %ld selected"), sel); + wxLogMessage("Choice item %ld selected", sel); } void ChoiceWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/widgets/clrpicker.cpp b/samples/widgets/clrpicker.cpp index 1c428a0db4..132c3b339c 100644 --- a/samples/widgets/clrpicker.cpp +++ b/samples/widgets/clrpicker.cpp @@ -125,7 +125,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, wxT("ColourPicker"), +IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, "ColourPicker", PICKER_CTRLS | FAMILY_CTRLS); ColourPickerWidgetsPage::ColourPickerWidgetsPage(WidgetsBookCtrl *book, @@ -139,13 +139,13 @@ void ColourPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style")); - m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl")); - m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label")); - m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, wxT("With opacity")); + wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, "&ColourPicker style"); + m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, "With textctrl"); + m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, "With label"); + m_chkColourShowAlpha = CreateCheckBoxAndAddToSizer(clrbox, "With opacity"); boxleft->Add(clrbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -217,7 +217,7 @@ void ColourPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void ColourPickerWidgetsPage::OnColourChange(wxColourPickerEvent& event) { - wxLogMessage(wxT("The colour changed to '%s' !"), + wxLogMessage("The colour changed to '%s' !", event.GetColour().GetAsString(wxC2S_CSS_SYNTAX).c_str()); } diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index e0f0312334..f978711047 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -234,7 +234,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, wxT("Combobox"), +IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, "Combobox", FAMILY_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -266,26 +266,26 @@ void ComboboxWidgetsPage::CreateContent() // should be in sync with ComboKind_XXX values static const wxString kinds[] = { - wxT("default"), - wxT("simple"), - wxT("drop down"), + "default", + "simple", + "drop down", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "Combobox &kind:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); wxSizer *sizerLeftTop = new wxStaticBoxSizer(wxVERTICAL, this, "&Set style"); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("&Read only")); - m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, wxT("Process &Enter")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeftTop, "&Sort items"); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeftTop, "&Read only"); + m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeftTop, "Process &Enter"); sizerLeftTop->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeftTop->Add(m_radioKind, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, ComboPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ComboPage_Reset, "&Reset"); sizerLeftTop->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // lower left pane @@ -303,20 +303,20 @@ void ComboboxWidgetsPage::CreateContent() // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change combobox contents")); + "&Change combobox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow; sizerRow = CreateSizerWithTextAndButton(ComboPage_SetCurrent, - wxT("Current &selection"), + "Current &selection", ComboPage_CurText, &m_textCur); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); wxTextCtrl *text; - sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"), + sizerRow = CreateSizerWithTextAndLabel("Insertion Point", ComboPage_InsertionPointText, &text); text->SetEditable(false); @@ -324,54 +324,54 @@ void ComboboxWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Insert, - wxT("&Insert this string"), + "&Insert this string", ComboPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Add, - wxT("&Add this string"), + "&Add this string", ComboPage_AddText, &m_textAdd); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_SetFirst, - wxT("Change &1st string"), + "Change &1st string", ComboPage_SetFirstText, &m_textSetFirst); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_AddSeveral, wxT("&Append a few strings")); + btn = new wxButton(this, ComboPage_AddSeveral, "&Append a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_AddMany, wxT("Append &many strings")); + btn = new wxButton(this, ComboPage_AddMany, "Append &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Change, - wxT("C&hange current"), + "C&hange current", ComboPage_ChangeText, &m_textChange); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Delete, - wxT("&Delete this item"), + "&Delete this item", ComboPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ComboPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_Clear, wxT("&Clear")); + btn = new wxButton(this, ComboPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_SetValue, - wxT("SetValue"), + "SetValue", ComboPage_SetValueText, &m_textSetValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ComboPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); @@ -430,7 +430,7 @@ void ComboboxWidgetsPage::CreateCombo() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( wxT("unknown combo kind") ); + wxFAIL_MSG( "unknown combo kind" ); // fall through case ComboKind_Default: @@ -533,7 +533,7 @@ void ComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format("test item %u", ++s_item)); } if (m_combobox->GetSelection() >= 0) @@ -548,7 +548,7 @@ void ComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_combobox->Append(s); @@ -570,7 +570,7 @@ void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(wxT("item #%u"), n)); + m_combobox->Append(wxString::Format("item #%u", n)); } } @@ -585,15 +585,15 @@ void ComboboxWidgetsPage::OnButtonSetCurrent(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(wxT("First")); - m_combobox->Append(wxT("another one")); - m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); + m_combobox->Append("First"); + m_combobox->Append("another one"); + m_combobox->Append("and the last (very very very very very very very very very very long) one"); } void ComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) ); + event.SetText( wxString::Format("%ld", m_combobox->GetInsertionPoint()) ); } void ComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) @@ -658,15 +658,15 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - wxT("event and combobox values should be the same") ); + "event and combobox values should be the same" ); if (event.GetEventType() == wxEVT_TEXT_ENTER) { - wxLogMessage(wxT("Combobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage("Combobox enter pressed (now '%s')", s.c_str()); } else { - wxLogMessage(wxT("Combobox text changed (now '%s')"), s.c_str()); + wxLogMessage("Combobox text changed (now '%s')", s.c_str()); } } @@ -679,13 +679,13 @@ void ComboboxWidgetsPage::OnComboTextPasted(wxClipboardTextEvent& event) void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - const wxString selstr = wxString::Format(wxT("%ld"), sel); + const wxString selstr = wxString::Format("%ld", sel); m_textDelete->SetValue(selstr); m_textCur->SetValue(selstr); - wxLogMessage(wxT("Combobox item %ld selected"), sel); + wxLogMessage("Combobox item %ld selected", sel); - wxLogMessage(wxT("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage("Combobox GetValue(): %s", m_combobox->GetValue().c_str() ); if ( event.GetString() != m_combobox->GetValue() ) { @@ -701,12 +701,12 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnDropdown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox dropped down")); + wxLogMessage("Combobox dropped down"); } void ComboboxWidgetsPage::OnCloseup(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox closed up")); + wxLogMessage("Combobox closed up"); } void ComboboxWidgetsPage::OnPopup(wxCommandEvent &WXUNUSED(event)) diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index 88dd3c8bea..9815f40919 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -134,7 +134,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, wxT("DatePicker"), +IMPLEMENT_WIDGETS_PAGE(DatePickerWidgetsPage, "DatePicker", FAMILY_CTRLS | PICKER_CTRLS ); diff --git a/samples/widgets/dirctrl.cpp b/samples/widgets/dirctrl.cpp index 5944a62ff0..7a2c60f717 100644 --- a/samples/widgets/dirctrl.cpp +++ b/samples/widgets/dirctrl.cpp @@ -61,16 +61,16 @@ enum static const wxString stdPaths[] = { - wxT("&none"), - wxT("&config"), - wxT("&data"), - wxT("&documents"), - wxT("&local data"), - wxT("&plugins"), - wxT("&resources"), - wxT("&user config"), - wxT("&user data"), - wxT("&user local data") + "&none", + "&config", + "&data", + "&documents", + "&local data", + "&plugins", + "&resources", + "&user config", + "&user data", + "&user local data" }; enum @@ -164,7 +164,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(DirCtrlWidgetsPage, wxT("DirCtrl"), +IMPLEMENT_WIDGETS_PAGE(DirCtrlWidgetsPage, "DirCtrl", GENERIC_CTRLS ); @@ -180,39 +180,39 @@ void DirCtrlWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Dir control details")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Dir control details"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - sizerLeft->Add( CreateSizerWithTextAndButton( DirCtrlPage_SetPath , wxT("Set &path"), wxID_ANY, &m_path ), + sizerLeft->Add( CreateSizerWithTextAndButton( DirCtrlPage_SetPath , "Set &path", wxID_ANY, &m_path ), 0, wxALL | wxALIGN_RIGHT , 5 ); wxSizer *sizerUseFlags = - new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Flags")); - m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_DIR_ONLY")); - m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_3D_INTERNAL")); - m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SELECT_FIRST")); - m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SHOW_FILTERS")); - m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_EDIT_LABELS")); - m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_MULTIPLE")); + new wxStaticBoxSizer(wxVERTICAL, this, "&Flags"); + m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_DIR_ONLY"); + m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_3D_INTERNAL"); + m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_SELECT_FIRST"); + m_chkFilters = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_SHOW_FILTERS"); + m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_EDIT_LABELS"); + m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, "wxDIRCTRL_MULTIPLE"); sizerLeft->Add(sizerUseFlags, wxSizerFlags().Expand().Border()); wxSizer *sizerFilters = - new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Filters")); - m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format(wxT("all files (%s)|%s"), + new wxStaticBoxSizer(wxVERTICAL, this, "&Filters"); + m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format("all files (%s)|%s", wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr)); - m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("C++ files (*.cpp; *.h)|*.cpp;*.h")); - m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("PNG images (*.png)|*.png")); + m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, "C++ files (*.cpp; *.h)|*.cpp;*.h"); + m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, "PNG images (*.png)|*.png"); sizerLeft->Add(sizerFilters, wxSizerFlags().Expand().Border()); - wxButton *btn = new wxButton(this, DirCtrlPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, DirCtrlPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // keep consistency between enum and labels of radiobox wxCOMPILE_TIME_ASSERT( stdPathMax == WXSIZEOF(stdPaths), EnumForRadioBoxMismatch); // middle pane - m_radioStdPath = new wxRadioBox(this, wxID_ANY, wxT("Standard path"), + m_radioStdPath = new wxRadioBox(this, wxID_ANY, "Standard path", wxDefaultPosition, wxDefaultSize, WXSIZEOF(stdPaths), stdPaths, 1); @@ -275,7 +275,7 @@ void DirCtrlWidgetsPage::CreateDirCtrl() if (m_fltr[i]->IsChecked()) { if (!filter.IsEmpty()) - filter += wxT("|"); + filter += "|"; filter += m_fltr[i]->GetLabel(); } } @@ -317,7 +317,7 @@ void DirCtrlWidgetsPage::OnRadioBox(wxCommandEvent& WXUNUSED(event)) { wxString path; - wxTheApp->SetAppName(wxT("widgets")); + wxTheApp->SetAppName("widgets"); wxStandardPathsBase& stdp = wxStandardPaths::Get(); switch ( m_radioStdPath->GetSelection() ) diff --git a/samples/widgets/dirpicker.cpp b/samples/widgets/dirpicker.cpp index 003f3b51ad..84f71fc064 100644 --- a/samples/widgets/dirpicker.cpp +++ b/samples/widgets/dirpicker.cpp @@ -133,7 +133,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, wxT("DirPicker"), +IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, "DirPicker", PICKER_CTRLS | FAMILY_CTRLS); DirPickerWidgetsPage::DirPickerWidgetsPage(WidgetsBookCtrl *book, @@ -147,10 +147,10 @@ void DirPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&DirPicker style")); - m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, wxT("With textctrl")); - m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, wxT("Dir must exist")); - m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, wxT("Change working dir")); + wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, "&DirPicker style"); + m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, "With textctrl"); + m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, "Dir must exist"); + m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, "Change working dir"); m_chkSmall = CreateCheckBoxAndAddToSizer(dirbox, "&Small version"); boxleft->Add(dirbox, 0, wxALL|wxGROW, 5); @@ -164,7 +164,7 @@ void DirPickerWidgetsPage::CreateContent() boxleft->AddSpacer(10); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -206,7 +206,7 @@ void DirPickerWidgetsPage::CreatePicker() style |= wxDIRP_SMALL; m_dirPicker = new wxDirPickerCtrl(this, PickerPage_Dir, - wxGetHomeDir(), wxT("Hello!"), + wxGetHomeDir(), "Hello!", wxDefaultPosition, wxDefaultSize, style); } @@ -246,7 +246,7 @@ void DirPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void DirPickerWidgetsPage::OnDirChange(wxFileDirPickerEvent& event) { - wxLogMessage(wxT("The directory changed to '%s' ! The current working directory is '%s'"), + wxLogMessage("The directory changed to '%s' ! The current working directory is '%s'", event.GetPath().c_str(), wxGetCwd().c_str()); } diff --git a/samples/widgets/editlbox.cpp b/samples/widgets/editlbox.cpp index 383fb981aa..bcd45d9eaf 100644 --- a/samples/widgets/editlbox.cpp +++ b/samples/widgets/editlbox.cpp @@ -115,7 +115,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, wxT("EditableListbox"), GENERIC_CTRLS); +IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, "EditableListbox", GENERIC_CTRLS); EditableListboxWidgetsPage::EditableListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -134,15 +134,15 @@ void EditableListboxWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - wxT("&Set listbox parameters")); + "&Set listbox parameters"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow new items")); - m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow editing items")); - m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow deleting items")); - m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Block user reordering")); + m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow new items"); + m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow editing items"); + m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, "Allow deleting items"); + m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, "Block user reordering"); - wxButton *btn = new wxButton(this, EditableListboxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, EditableListboxPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // right pane diff --git a/samples/widgets/filectrl.cpp b/samples/widgets/filectrl.cpp index 9790fd78dd..1ec56bd8ff 100644 --- a/samples/widgets/filectrl.cpp +++ b/samples/widgets/filectrl.cpp @@ -145,7 +145,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE( FileCtrlWidgetsPage, wxT( "FileCtrl" ), +IMPLEMENT_WIDGETS_PAGE( FileCtrlWidgetsPage, "FileCtrl", FAMILY_CTRLS ); FileCtrlWidgetsPage::FileCtrlWidgetsPage( WidgetsBookCtrl *book, @@ -161,37 +161,37 @@ void FileCtrlWidgetsPage::CreateContent() // left pane wxSizer *sizerLeft = new wxBoxSizer( wxVERTICAL ); - static const wxString mode[] = { wxT( "open" ), wxT( "save" ) }; - m_radioFileCtrlMode = new wxRadioBox( this, wxID_ANY, wxT( "wxFileCtrl mode" ), + static const wxString mode[] = { "open", "save" }; + m_radioFileCtrlMode = new wxRadioBox( this, wxID_ANY, "wxFileCtrl mode", wxDefaultPosition, wxDefaultSize, WXSIZEOF( mode ), mode ); sizerLeft->Add( m_radioFileCtrlMode, 0, wxALL | wxEXPAND , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetDirectory , wxT( "Set &directory" ), wxID_ANY, &m_dir ), + sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetDirectory , "Set &directory", wxID_ANY, &m_dir ), 0, wxALL | wxEXPAND , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetPath , wxT( "Set &path" ), wxID_ANY, &m_path ), + sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetPath , "Set &path", wxID_ANY, &m_path ), 0, wxALL | wxEXPAND , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetFilename , wxT( "Set &filename" ), wxID_ANY, &m_filename ), + sizerLeft->Add( CreateSizerWithTextAndButton( FileCtrlPage_SetFilename , "Set &filename", wxID_ANY, &m_filename ), 0, wxALL | wxEXPAND , 5 ); wxSizer *sizerUseFlags = - new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Flags" ) ); + new wxStaticBoxSizer( wxVERTICAL, this, "&Flags"); - m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_MULTIPLE" ) ); - m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_NOSHOWHIDDEN" ) ); + m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, "wxFC_MULTIPLE"); + m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, "wxFC_NOSHOWHIDDEN"); sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() ); wxSizer *sizerFilters = - new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Filters" ) ); - m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ), + new wxStaticBoxSizer( wxVERTICAL, this, "&Filters"); + m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format("all files (%s)|%s", wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) ); - m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) ); - m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) ); + m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, "C++ files (*.cpp; *.h)|*.cpp;*.h" ); + m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, "PNG images (*.png)|*.png"); sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() ); - wxButton *btn = new wxButton( this, FileCtrlPage_Reset, wxT( "&Reset" ) ); + wxButton *btn = new wxButton( this, FileCtrlPage_Reset, "&Reset" ); sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 ); // right pane @@ -253,7 +253,7 @@ void FileCtrlWidgetsPage::CreateFileCtrl() if ( m_fltr[i]->IsChecked() ) { if ( !wildcard.IsEmpty() ) - wildcard += wxT( "|" ); + wildcard += "|"; wildcard += m_fltr[i]->GetLabel(); } } diff --git a/samples/widgets/filepicker.cpp b/samples/widgets/filepicker.cpp index 14236781ad..dfa8e6ba2e 100644 --- a/samples/widgets/filepicker.cpp +++ b/samples/widgets/filepicker.cpp @@ -150,7 +150,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, wxT("FilePicker"), +IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, "FilePicker", PICKER_CTRLS | FAMILY_CTRLS); FilePickerWidgetsPage::FilePickerWidgetsPage(WidgetsBookCtrl *book, @@ -164,17 +164,17 @@ void FilePickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - static const wxString mode[] = { wxT("open"), wxT("save") }; - m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, wxT("wxFilePicker mode"), + static const wxString mode[] = { "open", "save" }; + m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, "wxFilePicker mode", wxDefaultPosition, wxDefaultSize, WXSIZEOF(mode), mode); boxleft->Add(m_radioFilePickerMode, 0, wxALL|wxGROW, 5); - wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FilePicker style")); - m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, wxT("With textctrl")); - m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, wxT("Overwrite prompt")); - m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, wxT("File must exist")); - m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, wxT("Change working dir")); + wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, "&FilePicker style"); + m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, "With textctrl"); + m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, "Overwrite prompt"); + m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, "File must exist"); + m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, "Change working dir"); m_chkSmall = CreateCheckBoxAndAddToSizer(filebox, "&Small version"); boxleft->Add(filebox, 0, wxALL|wxGROW, 5); @@ -189,7 +189,7 @@ void FilePickerWidgetsPage::CreateContent() boxleft->AddSpacer(10); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -245,7 +245,7 @@ void FilePickerWidgetsPage::CreatePicker() // pass an empty string as initial file m_filePicker = new wxFilePickerCtrl(this, PickerPage_File, wxEmptyString, - wxT("Hello!"), wxT("*"), + "Hello!", "*", wxDefaultPosition, wxDefaultSize, style); } @@ -310,7 +310,7 @@ void FilePickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void FilePickerWidgetsPage::OnFileChange(wxFileDirPickerEvent& event) { - wxLogMessage(wxT("The file changed to '%s' ! The current working directory is '%s'"), + wxLogMessage("The file changed to '%s' ! The current working directory is '%s'", event.GetPath().c_str(), wxGetCwd().c_str()); } diff --git a/samples/widgets/fontpicker.cpp b/samples/widgets/fontpicker.cpp index d753592796..3039479401 100644 --- a/samples/widgets/fontpicker.cpp +++ b/samples/widgets/fontpicker.cpp @@ -125,7 +125,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, wxT("FontPicker"), +IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, "FontPicker", PICKER_CTRLS | FAMILY_CTRLS); FontPickerWidgetsPage::FontPickerWidgetsPage(WidgetsBookCtrl *book, @@ -139,13 +139,13 @@ void FontPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FontPicker style")); - m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, wxT("With textctrl")); - m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Font desc as btn label")); - m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Use font for label")); + wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, "&FontPicker style"); + m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, "With textctrl"); + m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, "Font desc as btn label"); + m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, "Use font for label"); boxleft->Add(fontbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, "&Reset"), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state @@ -218,7 +218,7 @@ void FontPickerWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void FontPickerWidgetsPage::OnFontChange(wxFontPickerEvent& event) { - wxLogMessage(wxT("The font changed to '%s' with size %d !"), + wxLogMessage("The font changed to '%s' with size %d !", event.GetFont().GetFaceName().c_str(), event.GetFont().GetPointSize()); } diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index 87ad1b547d..457fb4aa77 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -175,7 +175,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, wxT("Gauge"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, "Gauge", FAMILY_CTRLS ); GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -199,25 +199,25 @@ void GaugeWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical")); - m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Smooth")); - m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Progress")); + m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical"); + m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, "&Smooth"); + m_chkProgress = CreateCheckBoxAndAddToSizer(sizerLeft, "&Progress"); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, GaugePage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, GaugePage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change gauge value")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change gauge value"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value", GaugePage_CurValueText, &text); text->SetEditable(false); @@ -225,26 +225,26 @@ void GaugeWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(GaugePage_SetValue, - wxT("Set &value"), + "Set &value", GaugePage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(GaugePage_SetRange, - wxT("Set &range"), + "Set &range", GaugePage_RangeText, &m_textRange); - m_textRange->SetValue( wxString::Format(wxT("%lu"), m_range) ); + m_textRange->SetValue( wxString::Format("%lu", m_range) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, GaugePage_Progress, wxT("Simulate &progress")); + btn = new wxButton(this, GaugePage_Progress, "Simulate &progress"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); btn = new wxButton(this, GaugePage_IndeterminateProgress, - wxT("Simulate &indeterminate job")); + "Simulate &indeterminate job"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, GaugePage_Clear, wxT("&Clear")); + btn = new wxButton(this, GaugePage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -322,13 +322,13 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked) { static const int INTERVAL = 300; - wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL); + wxLogMessage("Launched progress timer (interval = %d ms)", INTERVAL); m_timer = new wxTimer(this, clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer); m_timer->Start(INTERVAL); - clicked->SetLabel(wxT("&Stop timer")); + clicked->SetLabel("&Stop timer"); if (clicked->GetId() == GaugePage_Progress) FindWindow(GaugePage_IndeterminateProgress)->Disable(); @@ -338,23 +338,23 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked) void GaugeWidgetsPage::StopTimer(wxButton *clicked) { - wxCHECK_RET( m_timer, wxT("shouldn't be called") ); + wxCHECK_RET( m_timer, "shouldn't be called" ); m_timer->Stop(); wxDELETE(m_timer); if (clicked->GetId() == GaugePage_Progress) { - clicked->SetLabel(wxT("Simulate &progress")); + clicked->SetLabel("Simulate &progress"); FindWindow(GaugePage_IndeterminateProgress)->Enable(); } else { - clicked->SetLabel(wxT("Simulate indeterminate job")); + clicked->SetLabel("Simulate indeterminate job"); FindWindow(GaugePage_Progress)->Enable(); } - wxLogMessage(wxT("Progress finished.")); + wxLogMessage("Progress finished."); } // ---------------------------------------------------------------------------- @@ -379,7 +379,7 @@ void GaugeWidgetsPage::OnButtonProgress(wxCommandEvent& event) { StopTimer(b); - wxLogMessage(wxT("Stopped the timer.")); + wxLogMessage("Stopped the timer."); } } @@ -396,7 +396,7 @@ void GaugeWidgetsPage::OnButtonIndeterminateProgress(wxCommandEvent& event) m_gauge->SetValue(0); - wxLogMessage(wxT("Stopped the timer.")); + wxLogMessage("Stopped the timer."); } } @@ -457,7 +457,7 @@ void GaugeWidgetsPage::OnProgressTimer(wxTimerEvent& WXUNUSED(event)) else // reached the end { wxButton *btn = (wxButton *)FindWindow(GaugePage_Progress); - wxCHECK_RET( btn, wxT("no progress button?") ); + wxCHECK_RET( btn, "no progress button?" ); StopTimer(btn); } @@ -470,7 +470,7 @@ void GaugeWidgetsPage::OnIndeterminateProgressTimer(wxTimerEvent& WXUNUSED(event void GaugeWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(wxT("%d"), m_gauge->GetValue())); + event.SetText( wxString::Format("%d", m_gauge->GetValue())); } #endif diff --git a/samples/widgets/headerctrl.cpp b/samples/widgets/headerctrl.cpp index 92979e49a0..17c28de6e3 100644 --- a/samples/widgets/headerctrl.cpp +++ b/samples/widgets/headerctrl.cpp @@ -78,7 +78,7 @@ private: #endif IMPLEMENT_WIDGETS_PAGE(HeaderCtrlWidgetsPage, - wxT("Header"), HEADER_CTRL_FAMILY); + "Header", HEADER_CTRL_FAMILY); void HeaderCtrlWidgetsPage::CreateContent() { diff --git a/samples/widgets/hyperlnk.cpp b/samples/widgets/hyperlnk.cpp index d3d7baba44..fb110f5a71 100644 --- a/samples/widgets/hyperlnk.cpp +++ b/samples/widgets/hyperlnk.cpp @@ -142,7 +142,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(HyperlinkWidgetsPage, wxT("Hyperlink"), +IMPLEMENT_WIDGETS_PAGE(HyperlinkWidgetsPage, "Hyperlink", GENERIC_CTRLS ); @@ -157,33 +157,33 @@ void HyperlinkWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Hyperlink details")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Hyperlink details"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetLabel , wxT("Set &Label"), wxID_ANY, &m_label ), + sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetLabel , "Set &Label", wxID_ANY, &m_label ), 0, wxALL | wxALIGN_RIGHT , 5 ); - sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetURL , wxT("Set &URL"), wxID_ANY, &m_url ), + sizerLeft->Add( CreateSizerWithTextAndButton( HyperlinkPage_SetURL , "Set &URL", wxID_ANY, &m_url ), 0, wxALL | wxALIGN_RIGHT , 5 ); static const wxString alignments[] = { - wxT("&left"), - wxT("¢re"), - wxT("&right") + "&left", + "¢re", + "&right" }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(alignments) == Align_Max, AlignMismatch ); - m_radioAlignMode = new wxRadioBox(this, wxID_ANY, wxT("alignment"), + m_radioAlignMode = new wxRadioBox(this, wxID_ANY, "alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(alignments), alignments); m_radioAlignMode->SetSelection(1); // start with "centre" selected since // wxHL_DEFAULT_STYLE contains wxHL_ALIGN_CENTRE sizerLeft->Add(m_radioAlignMode, 0, wxALL|wxGROW, 5); - m_checkGeneric = new wxCheckBox(this, wxID_ANY, wxT("Use generic version"), + m_checkGeneric = new wxCheckBox(this, wxID_ANY, "Use generic version", wxDefaultPosition, wxDefaultSize); sizerLeft->Add(m_checkGeneric, 0, wxALL|wxGROW, 5); @@ -191,24 +191,24 @@ void HyperlinkWidgetsPage::CreateContent() wxSizer *szHyperlinkLong = new wxBoxSizer(wxVERTICAL); wxSizer *szHyperlink = new wxBoxSizer(wxHORIZONTAL); - m_visit = new wxStaticText(this, wxID_ANY, wxT("Visit ")); + m_visit = new wxStaticText(this, wxID_ANY, "Visit "); if (m_checkGeneric->IsChecked()) { m_hyperlink = new wxGenericHyperlinkCtrl(this, HyperlinkPage_Ctrl, - wxT("wxWidgets website"), - wxT("www.wxwidgets.org")); + "wxWidgets website", + "www.wxwidgets.org"); } else { m_hyperlink = new wxHyperlinkCtrl(this, HyperlinkPage_Ctrl, - wxT("wxWidgets website"), - wxT("www.wxwidgets.org")); + "wxWidgets website", + "www.wxwidgets.org"); } - m_fun = new wxStaticText(this, wxID_ANY, wxT(" for fun!")); + m_fun = new wxStaticText(this, wxID_ANY, " for fun!"); szHyperlink->Add(0, 0, 1, wxCENTRE); szHyperlink->Add(m_visit, 0, wxCENTRE); @@ -221,15 +221,15 @@ void HyperlinkWidgetsPage::CreateContent() { m_hyperlinkLong = new wxGenericHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org")); + "This is a long hyperlink", + "www.wxwidgets.org"); } else { m_hyperlinkLong = new wxHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org")); + "This is a long hyperlink", + "www.wxwidgets.org"); } szHyperlinkLong->Add(0, 0, 1, wxCENTRE); @@ -307,8 +307,8 @@ void HyperlinkWidgetsPage::CreateHyperlinkLong(long align) { hyp = new wxGenericHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org"), + "This is a long hyperlink", + "www.wxwidgets.org", wxDefaultPosition, wxDefaultSize, style); @@ -317,8 +317,8 @@ void HyperlinkWidgetsPage::CreateHyperlinkLong(long align) { hyp = new wxHyperlinkCtrl(this, wxID_ANY, - wxT("This is a long hyperlink"), - wxT("www.wxwidgets.org"), + "This is a long hyperlink", + "www.wxwidgets.org", wxDefaultPosition, wxDefaultSize, style); @@ -365,7 +365,7 @@ void HyperlinkWidgetsPage::OnAlignment(wxCommandEvent& WXUNUSED(event)) { default: case Align_Max: - wxFAIL_MSG( wxT("unknown alignment") ); + wxFAIL_MSG( "unknown alignment" ); // fall through case Align_Left: diff --git a/samples/widgets/itemcontainer.cpp b/samples/widgets/itemcontainer.cpp index bb081c8419..d120895aac 100644 --- a/samples/widgets/itemcontainer.cpp +++ b/samples/widgets/itemcontainer.cpp @@ -76,12 +76,12 @@ ItemContainerWidgetsPage::ItemContainerWidgetsPage(WidgetsBookCtrl *book, #endif // __WXMSW__ || __WXGTK__ , m_trackedDataObjects(0) { - m_items.Add(wxT("This")); - m_items.Add(wxT("is")); - m_items.Add(wxT("a")); - m_items.Add(wxT("List")); - m_items.Add(wxT("of")); - m_items.Add(wxT("strings")); + m_items.Add("This"); + m_items.Add("is"); + m_items.Add("a"); + m_items.Add("List"); + m_items.Add("of"); + m_items.Add("strings"); m_itemsSorted = m_items; } @@ -108,11 +108,11 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed() { if ( m_trackedDataObjects ) { - wxString message = wxT("Bug in managing wxClientData: "); + wxString message = "Bug in managing wxClientData: "; if ( m_trackedDataObjects > 0 ) - message << m_trackedDataObjects << wxT(" lost objects"); + message << m_trackedDataObjects << " lost objects"; else - message << (-m_trackedDataObjects) << wxT(" extra deletes"); + message << (-m_trackedDataObjects) << " extra deletes"; wxFAIL_MSG(message); return false; } @@ -123,7 +123,7 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed() void ItemContainerWidgetsPage::StartTest(const wxString& label) { m_container->Clear(); - wxLogMessage(wxT("Test - %s:"), label.c_str()); + wxLogMessage("Test - %s:", label.c_str()); } void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) @@ -133,7 +133,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) bool ok = count == items.GetCount(); if ( !ok ) { - wxFAIL_MSG(wxT("Item count does not match.")); + wxFAIL_MSG("Item count does not match."); } else { @@ -143,7 +143,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) if ( str != items[i] ) { wxFAIL_MSG(wxString::Format( - wxT("Wrong string \"%s\" at position %d (expected \"%s\")"), + "Wrong string \"%s\" at position %d (expected \"%s\")", str.c_str(), i, items[i].c_str())); ok = false; break; @@ -178,19 +178,19 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) m_container->Clear(); ok &= VerifyAllClientDataDestroyed(); - wxLogMessage(wxT("...%s"), ok ? wxT("passed") : wxT("failed")); + wxLogMessage("...%s", ok ? "passed" : "failed"); } wxString ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const { wxString str; - str << wxT("Current content:\n"); + str << "Current content:\n"; unsigned i; for ( i = 0; i < m_container->GetCount(); ++i ) { - str << wxT(" - ") << m_container->GetString(i) << wxT(" ["); + str << " - " << m_container->GetString(i) << " ["; if ( m_container->HasClientObjectData() ) { TrackedClientData * @@ -204,20 +204,20 @@ ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const if ( data ) str << (wxUIntPtr)data; } - str << wxT("]\n"); + str << "]\n"; } - str << wxT("Expected content:\n"); + str << "Expected content:\n"; for ( i = 0; i < expected.GetCount(); ++i ) { const wxString& item = expected[i]; - str << wxT(" - ") << item << wxT("["); + str << " - " << item << "["; for( unsigned j = 0; j < m_items.GetCount(); ++j ) { if ( m_items[j] == item ) str << j; } - str << wxT("]\n"); + str << "]\n"; } return str; @@ -227,7 +227,7 @@ bool ItemContainerWidgetsPage::VerifyClientData(wxUIntPtr i, const wxString& str { if ( i > m_items.GetCount() || m_items[i] != str ) { - wxLogMessage(wxT("Client data for '%s' does not match."), str.c_str()); + wxLogMessage("Client data for '%s' does not match.", str.c_str()); return false; } @@ -251,9 +251,9 @@ ItemContainerWidgetsPage::MakeArray(const wxSortedArrayString& sorted) void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) { m_container = GetContainer(); - wxASSERT_MSG(m_container, wxT("Widget must have a test widget")); + wxASSERT_MSG(m_container, "Widget must have a test widget"); - wxLogMessage(wxT("wxItemContainer test for %s, %s:"), + wxLogMessage("wxItemContainer test for %s, %s:", GetWidget()->GetClassInfo()->GetClassName(), (m_container->IsSorted() ? "Sorted" : "Unsorted")); @@ -261,16 +261,16 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) expected_result = m_container->IsSorted() ? MakeArray(m_itemsSorted) : m_items; - StartTest(wxT("Append one item")); + StartTest("Append one item"); wxString item = m_items[0]; m_container->Append(item); EndTest(wxArrayString(1, &item)); - StartTest(wxT("Append some items")); + StartTest("Append some items"); m_container->Append(m_items); EndTest(expected_result); - StartTest(wxT("Append some items with data objects")); + StartTest("Append some items with data objects"); wxClientData **objects = new wxClientData *[m_items.GetCount()]; for ( unsigned i = 0; i < m_items.GetCount(); ++i ) objects[i] = CreateClientData(i); @@ -278,7 +278,7 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) EndTest(expected_result); delete[] objects; - StartTest(wxT("Append some items with data")); + StartTest("Append some items with data"); void **data = new void *[m_items.GetCount()]; for ( unsigned i = 0; i < m_items.GetCount(); ++i ) data[i] = wxUIntToPtr(i); @@ -286,19 +286,19 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) EndTest(expected_result); delete[] data; - StartTest(wxT("Append some items with data, one by one")); + StartTest("Append some items with data, one by one"); for ( unsigned i = 0; i < m_items.GetCount(); ++i ) m_container->Append(m_items[i], wxUIntToPtr(i)); EndTest(expected_result); - StartTest(wxT("Append some items with data objects, one by one")); + StartTest("Append some items with data objects, one by one"); for ( unsigned i = 0; i < m_items.GetCount(); ++i ) m_container->Append(m_items[i], CreateClientData(i)); EndTest(expected_result); if ( !m_container->IsSorted() ) { - StartTest(wxT("Insert in reverse order with data, one by one")); + StartTest("Insert in reverse order with data, one by one"); for ( unsigned i = m_items.GetCount(); i; --i ) m_container->Insert(m_items[i - 1], 0, wxUIntToPtr(i - 1)); EndTest(expected_result); diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index 22da0c9b4e..c8e567479e 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -244,7 +244,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, wxT("Listbox"), +IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, "Listbox", FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -278,17 +278,17 @@ void ListboxWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - wxT("&Set listbox parameters")); + "&Set listbox parameters"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); static const wxString modes[] = { - wxT("single"), - wxT("extended"), - wxT("multiple"), + "single", + "extended", + "multiple", }; - m_radioSelMode = new wxRadioBox(this, wxID_ANY, wxT("Selection &mode:"), + m_radioSelMode = new wxRadioBox(this, wxID_ANY, "Selection &mode:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(modes), modes, 1, wxRA_SPECIFY_COLS); @@ -311,15 +311,15 @@ void ListboxWidgetsPage::CreateContent() m_chkVScroll = CreateCheckBoxAndAddToSizer ( sizerLeft, - wxT("Always show &vertical scrollbar") + "Always show &vertical scrollbar" ); m_chkHScroll = CreateCheckBoxAndAddToSizer ( sizerLeft, - wxT("Show &horizontal scrollbar") + "Show &horizontal scrollbar" ); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); - m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Owner drawn")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, "&Sort items"); + m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, "&Owner drawn"); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioSelMode, 0, wxGROW | wxALL, 5); @@ -327,67 +327,67 @@ void ListboxWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioListType, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, ListboxPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ListboxPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change listbox contents")); + "&Change listbox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Add, wxT("&Add this string")); - m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, wxT("test item 0")); + btn = new wxButton(this, ListboxPage_Add, "&Add this string"); + m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, "test item 0"); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_AddSeveral, wxT("&Insert a few strings")); + btn = new wxButton(this, ListboxPage_AddSeveral, "&Insert a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_AddMany, wxT("Add &many strings")); + btn = new wxButton(this, ListboxPage_AddMany, "Add &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Change, wxT("C&hange current")); + btn = new wxButton(this, ListboxPage_Change, "C&hange current"); m_textChange = new wxTextCtrl(this, ListboxPage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_EnsureVisible, wxT("Make item &visible")); + btn = new wxButton(this, ListboxPage_EnsureVisible, "Make item &visible"); m_textEnsureVisible = new wxTextCtrl(this, ListboxPage_EnsureVisibleText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textEnsureVisible, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Delete, wxT("&Delete this item")); + btn = new wxButton(this, ListboxPage_Delete, "&Delete this item"); m_textDelete = new wxTextCtrl(this, ListboxPage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ListboxPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_Clear, wxT("&Clear")); + btn = new wxButton(this, ListboxPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_MoveUp, wxT("Move item &up")); + btn = new wxButton(this, ListboxPage_MoveUp, "Move item &up"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_MoveDown, wxT("Move item &down")); + btn = new wxButton(this, ListboxPage_MoveDown, "Move item &down"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_GetTopItem, wxT("Get top item")); + btn = new wxButton(this, ListboxPage_GetTopItem, "Get top item"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_GetCountPerPage, wxT("Get count per page")); + btn = new wxButton(this, ListboxPage_GetCountPerPage, "Get count per page"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ListboxPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -431,7 +431,7 @@ void ListboxWidgetsPage::CreateLbox() switch ( m_radioSelMode->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected radio box selection") ); + wxFAIL_MSG( "unexpected radio box selection" ); wxFALLTHROUGH; case LboxSel_Single: flags |= wxLB_SINGLE; break; @@ -617,7 +617,7 @@ void ListboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_lbox->Append(s); @@ -628,16 +628,16 @@ void ListboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_lbox->Append(wxString::Format(wxT("item #%u"), n)); + m_lbox->Append(wxString::Format("item #%u", n)); } } void ListboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(wxT("First")); - items.Add(wxT("another one")); - items.Add(wxT("and the last (very very very very very very very very very very long) one")); + items.Add("First"); + items.Add("another one"); + items.Add("and the last (very very very very very very very very very very long) one"); m_lbox->InsertItems(items, 0); } @@ -700,26 +700,26 @@ void ListboxWidgetsPage::OnUpdateUIMoveButtons(wxUpdateUIEvent& evt) void ListboxWidgetsPage::OnListbox(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); if (event.IsSelection()) { - wxLogMessage(wxT("Listbox item %ld selected"), sel); + wxLogMessage("Listbox item %ld selected", sel); } else { - wxLogMessage(wxT("Listbox item %ld deselected"), sel); + wxLogMessage("Listbox item %ld deselected", sel); } } void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event) { - wxLogMessage( wxT("Listbox item %d double clicked"), event.GetInt() ); + wxLogMessage( "Listbox item %d double clicked", event.GetInt() ); } void ListboxWidgetsPage::OnCheckListbox(wxCommandEvent& event) { - wxLogMessage( wxT("Listbox item %d toggled"), event.GetInt() ); + wxLogMessage( "Listbox item %d toggled", event.GetInt() ); } void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/widgets/native.cpp b/samples/widgets/native.cpp index ba2cbd6b5f..d355a85251 100644 --- a/samples/widgets/native.cpp +++ b/samples/widgets/native.cpp @@ -272,7 +272,7 @@ private: // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(NativeWidgetsPage, wxT("Native"), NATIVE_CTRLS); +IMPLEMENT_WIDGETS_PAGE(NativeWidgetsPage, "Native", NATIVE_CTRLS); NativeWidgetsPage::NativeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) : WidgetsPage(book, imaglist, native_xpm) diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index c8d94e86ed..08c51f1f3c 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -204,20 +204,20 @@ void BookWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); // must be in sync with Orient enum wxArrayString orientations; - orientations.Add(wxT("&top")); - orientations.Add(wxT("&bottom")); - orientations.Add(wxT("&left")); - orientations.Add(wxT("&right")); + orientations.Add("&top"); + orientations.Add("&bottom"); + orientations.Add("&left"); + orientations.Add("&right"); wxASSERT_MSG( orientations.GetCount() == Orient_Max, - wxT("forgot to update something") ); + "forgot to update something" ); - m_chkImages = new wxCheckBox(this, wxID_ANY, wxT("Show &images")); - m_radioOrient = new wxRadioBox(this, wxID_ANY, wxT("&Tab orientation"), + m_chkImages = new wxCheckBox(this, wxID_ANY, "Show &images"); + m_radioOrient = new wxRadioBox(this, wxID_ANY, "&Tab orientation", wxDefaultPosition, wxDefaultSize, orientations, 1, wxRA_SPECIFY_COLS); @@ -227,48 +227,48 @@ void BookWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioOrient, 0, wxALL, 5); - wxButton *btn = new wxButton(this, BookPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, BookPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Contents")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Number of pages: "), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Number of pages: ", BookPage_NumPagesText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection: "), + sizerRow = CreateSizerWithTextAndLabel("Current selection: ", BookPage_CurSelectText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage, - wxT("&Select page"), + "&Select page", BookPage_SelectText, &m_textSelect); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BookPage_AddPage, wxT("&Add page")); + btn = new wxButton(this, BookPage_AddPage, "&Add page"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage, - wxT("&Insert page at"), + "&Insert page at", BookPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage, - wxT("&Remove page"), + "&Remove page", BookPage_RemoveText, &m_textRemove); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BookPage_DeleteAll, wxT("&Delete All")); + btn = new wxButton(this, BookPage_DeleteAll, "&Delete All"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -342,7 +342,7 @@ void BookWidgetsPage::RecreateBook() switch ( m_radioOrient->GetSelection() ) { default: - wxFAIL_MSG( wxT("unknown orientation") ); + wxFAIL_MSG( "unknown orientation" ); // fall through case Orient_Top: @@ -429,7 +429,7 @@ int BookWidgetsPage::GetIconIndex() const wxWindow *BookWidgetsPage::CreateNewPage() { - return new wxTextCtrl(m_book, wxID_ANY, wxT("I'm a book page")); + return new wxTextCtrl(m_book, wxID_ANY, "I'm a book page"); } // ---------------------------------------------------------------------------- @@ -451,30 +451,30 @@ void BookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event)) void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textSelect); - wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), "button should be disabled" ); m_book->SetSelection(pos); } void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event)) { - m_book->AddPage(CreateNewPage(), wxT("Added page"), false, + m_book->AddPage(CreateNewPage(), "Added page", false, GetIconIndex()); } void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textInsert); - wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), "button should be disabled" ); - m_book->InsertPage(pos, CreateNewPage(), wxT("Inserted page"), false, + m_book->InsertPage(pos, CreateNewPage(), "Inserted page", false, GetIconIndex()); } void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textRemove); - wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), "button should be disabled" ); m_book->DeletePage(pos); } @@ -504,13 +504,13 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(wxT("%u"), unsigned(m_book->GetPageCount())) ); + event.SetText( wxString::Format("%u", unsigned(m_book->GetPageCount())) ); } void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(wxT("%d"), m_book->GetSelection()) ); + event.SetText( wxString::Format("%d", m_book->GetSelection()) ); } void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -573,13 +573,13 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, wxT("Notebook"), +IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, "Notebook", FAMILY_CTRLS | BOOK_CTRLS ); void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) { - wxLogMessage(wxT("Notebook page changing from %d to %d (currently %d)."), + wxLogMessage("Notebook page changing from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -589,7 +589,7 @@ void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event) { - wxLogMessage(wxT("Notebook page changed from %d to %d (currently %d)."), + wxLogMessage("Notebook page changed from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -646,13 +646,13 @@ wxBEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage) EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged) wxEND_EVENT_TABLE() -IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, wxT("Listbook"), +IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, "Listbook", GENERIC_CTRLS | BOOK_CTRLS ); void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event) { - wxLogMessage(wxT("Listbook page changing from %d to %d (currently %d)."), + wxLogMessage("Listbook page changing from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -662,7 +662,7 @@ void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event) void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event) { - wxLogMessage(wxT("Listbook page changed from %d to %d (currently %d)."), + wxLogMessage("Listbook page changed from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -719,13 +719,13 @@ wxBEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage) EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged) wxEND_EVENT_TABLE() -IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, wxT("Choicebook"), +IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, "Choicebook", GENERIC_CTRLS | BOOK_CTRLS ); void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event) { - wxLogMessage(wxT("Choicebook page changing from %d to %d (currently %d)."), + wxLogMessage("Choicebook page changing from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -735,7 +735,7 @@ void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event) void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event) { - wxLogMessage(wxT("Choicebook page changed from %d to %d (currently %d)."), + wxLogMessage("Choicebook page changed from %d to %d (currently %d).", event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); diff --git a/samples/widgets/odcombobox.cpp b/samples/widgets/odcombobox.cpp index e3e9486def..0b30bf15d8 100644 --- a/samples/widgets/odcombobox.cpp +++ b/samples/widgets/odcombobox.cpp @@ -299,7 +299,7 @@ public: }; -IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, wxT("OwnerDrawnCombobox"), +IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, "OwnerDrawnCombobox", GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -332,88 +332,88 @@ void ODComboboxWidgetsPage::CreateContent() wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); // left pane - style box - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only")); - m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Double-click Cycles")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, "&Sort items"); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, "&Read only"); + m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, "&Double-click Cycles"); sizerStyle->AddSpacer(4); - m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Bitmap button")); - m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("B&lank button background")); + m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, "&Bitmap button"); + m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, "B&lank button background"); - wxButton *btn = new wxButton(this, ODComboPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, ODComboPage_Reset, "&Reset"); sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3); sizerLeft->Add(sizerStyle, wxSizerFlags().Expand()); // left pane - popup adjustment box - box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &popup")); + box = new wxStaticBox(this, wxID_ANY, "Adjust &popup"); wxSizer *sizerPopupPos = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(wxT("Min. Width:"), + sizerRow = CreateSizerWithTextAndLabel("Min. Width:", ODComboPage_PopupMinWidth, &m_textPopupMinWidth); - m_textPopupMinWidth->SetValue(wxT("-1")); + m_textPopupMinWidth->SetValue("-1"); sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Max. Height:"), + sizerRow = CreateSizerWithTextAndLabel("Max. Height:", ODComboPage_PopupHeight, &m_textPopupHeight); - m_textPopupHeight->SetValue(wxT("-1")); + m_textPopupHeight->SetValue("-1"); sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, wxT("Align Right")); + m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, "Align Right"); sizerLeft->Add(sizerPopupPos, wxSizerFlags().Expand().Border(wxTOP, 2)); // left pane - button adjustment box - box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &button")); + box = new wxStaticBox(this, wxID_ANY, "Adjust &button"); wxSizer *sizerButtonPos = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(wxT("Width:"), + sizerRow = CreateSizerWithTextAndLabel("Width:", ODComboPage_ButtonWidth, &m_textButtonWidth); - m_textButtonWidth->SetValue(wxT("-1")); + m_textButtonWidth->SetValue("-1"); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("VSpacing:"), + sizerRow = CreateSizerWithTextAndLabel("VSpacing:", ODComboPage_ButtonSpacing, &m_textButtonSpacing); - m_textButtonSpacing->SetValue(wxT("0")); + m_textButtonSpacing->SetValue("0"); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Height:"), + sizerRow = CreateSizerWithTextAndLabel("Height:", ODComboPage_ButtonHeight, &m_textButtonHeight); - m_textButtonHeight->SetValue(wxT("-1")); + m_textButtonHeight->SetValue("-1"); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, wxT("Align Left")); + m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, "Align Left"); sizerLeft->Add(sizerButtonPos, wxSizerFlags().Expand().Border(wxTOP, 2)); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change combobox contents")); + "&Change combobox contents"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, ODComboPage_ContainerTests, wxT("Run &tests")); + btn = new wxButton(this, ODComboPage_ContainerTests, "Run &tests"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection"), + sizerRow = CreateSizerWithTextAndLabel("Current selection", ODComboPage_CurText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"), + sizerRow = CreateSizerWithTextAndLabel("Insertion Point", ODComboPage_InsertionPointText, &text); text->SetEditable(false); @@ -421,39 +421,39 @@ void ODComboboxWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Insert, - wxT("&Insert this string"), + "&Insert this string", ODComboPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Add, - wxT("&Add this string"), + "&Add this string", ODComboPage_AddText, &m_textAdd); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_AddSeveral, wxT("&Append a few strings")); + btn = new wxButton(this, ODComboPage_AddSeveral, "&Append a few strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_AddMany, wxT("Append &many strings")); + btn = new wxButton(this, ODComboPage_AddMany, "Append &many strings"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Change, - wxT("C&hange current"), + "C&hange current", ODComboPage_ChangeText, &m_textChange); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Delete, - wxT("&Delete this item"), + "&Delete this item", ODComboPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_DeleteSel, wxT("Delete &selection")); + btn = new wxButton(this, ODComboPage_DeleteSel, "Delete &selection"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_Clear, wxT("&Clear")); + btn = new wxButton(this, ODComboPage_Clear, "&Clear"); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -569,7 +569,7 @@ void ODComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(wxT("Not implemented in wxGTK")); + wxLogMessage("Not implemented in wxGTK"); #endif } } @@ -608,7 +608,7 @@ void ODComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format("test item %u", ++s_item)); } if (m_combobox->GetSelection() >= 0) @@ -623,7 +623,7 @@ void ODComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format("test item %u", ++s_item)); } m_combobox->Append(s); @@ -634,15 +634,15 @@ void ODComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(wxT("item #%u"), n)); + m_combobox->Append(wxString::Format("item #%u", n)); } } void ODComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(wxT("First")); - m_combobox->Append(wxT("another one")); - m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); + m_combobox->Append("First"); + m_combobox->Append("another one"); + m_combobox->Append("and the last (very very very very very very very very very very long) one"); } void ODComboboxWidgetsPage::OnTextPopupWidth(wxCommandEvent& WXUNUSED(event)) @@ -698,13 +698,13 @@ void ODComboboxWidgetsPage::OnTextButtonAll(wxCommandEvent& WXUNUSED(event)) void ODComboboxWidgetsPage::OnUpdateUICurText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(wxT("%d"), m_combobox->GetSelection()) ); + event.SetText( wxString::Format("%d", m_combobox->GetSelection()) ); } void ODComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) ); + event.SetText( wxString::Format("%ld", m_combobox->GetInsertionPoint()) ); } void ODComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) @@ -761,26 +761,26 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - wxT("event and combobox values should be the same") ); + "event and combobox values should be the same" ); if (event.GetEventType() == wxEVT_TEXT_ENTER) { - wxLogMessage(wxT("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage("OwnerDrawnCombobox enter pressed (now '%s')", s.c_str()); } else { - wxLogMessage(wxT("OwnerDrawnCombobox text changed (now '%s')"), s.c_str()); + wxLogMessage("OwnerDrawnCombobox text changed (now '%s')", s.c_str()); } } void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); + m_textDelete->SetValue(wxString::Format("%ld", sel)); - wxLogMessage(wxT("OwnerDrawnCombobox item %ld selected"), sel); + wxLogMessage("OwnerDrawnCombobox item %ld selected", sel); - wxLogMessage(wxT("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage("OwnerDrawnCombobox GetValue(): %s", m_combobox->GetValue().c_str() ); } void ODComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) @@ -849,12 +849,12 @@ wxBitmap ODComboboxWidgetsPage::CreateBitmap(const wxColour& colour) void ODComboboxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox dropped down")); + wxLogMessage("Combobox dropped down"); } void ODComboboxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(wxT("Combobox closed up")); + wxLogMessage("Combobox closed up"); } #endif //wxUSE_ODCOMBOBOX diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index 04d5721009..7af9465417 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -180,7 +180,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, wxT("Radio"), +IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, "Radio", FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -207,7 +207,7 @@ void RadioWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); @@ -219,12 +219,12 @@ void RadioWidgetsPage::CreateContent() static const wxString layoutDir[] = { - wxT("default"), - wxT("left to right"), - wxT("top to bottom") + "default", + "left to right", + "top to bottom" }; - m_radioDir = new wxRadioBox(this, wxID_ANY, wxT("Numbering:"), + m_radioDir = new wxRadioBox(this, wxID_ANY, "Numbering:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(layoutDir), layoutDir, 1, wxRA_SPECIFY_COLS); @@ -236,57 +236,57 @@ void RadioWidgetsPage::CreateContent() #endif // wxRA_LEFTTORIGHT wxSizer *sizerRow; - sizerRow = CreateSizerWithTextAndLabel(wxT("&Major dimension:"), + sizerRow = CreateSizerWithTextAndLabel("&Major dimension:", wxID_ANY, &m_textMajorDim); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); - sizerRow = CreateSizerWithTextAndLabel(wxT("&Number of buttons:"), + sizerRow = CreateSizerWithTextAndLabel("&Number of buttons:", wxID_ANY, &m_textNumBtns); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); wxButton *btn; - btn = new wxButton(this, RadioPage_Update, wxT("&Update")); + btn = new wxButton(this, RadioPage_Update, "&Update"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 5); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - btn = new wxButton(this, RadioPage_Reset, wxT("&Reset")); + btn = new wxButton(this, RadioPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change parameters")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change parameters"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection:"), + sizerRow = CreateSizerWithTextAndLabel("Current selection:", wxID_ANY, &m_textCurSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection, - wxT("&Change selection:"), + "&Change selection:", wxID_ANY, &m_textSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Label, - wxT("&Label for box:"), + "&Label for box:", wxID_ANY, &m_textLabel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn, - wxT("&Label for buttons:"), + "&Label for buttons:", wxID_ANY, &m_textLabelBtns); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); m_chkEnableItem = CreateCheckBoxAndAddToSizer(sizerMiddle, - wxT("Disable &2nd item"), + "Disable &2nd item", RadioPage_EnableItem); m_chkShowItem = CreateCheckBoxAndAddToSizer(sizerMiddle, - wxT("Hide 2nd &item"), + "Hide 2nd &item", RadioPage_ShowItem); // right pane @@ -312,10 +312,10 @@ void RadioWidgetsPage::CreateContent() void RadioWidgetsPage::Reset() { - m_textMajorDim->SetValue(wxString::Format(wxT("%u"), DEFAULT_MAJOR_DIM)); - m_textNumBtns->SetValue(wxString::Format(wxT("%u"), DEFAULT_NUM_ENTRIES)); - m_textLabel->SetValue(wxT("I'm a radiobox")); - m_textLabelBtns->SetValue(wxT("item")); + m_textMajorDim->SetValue(wxString::Format("%u", DEFAULT_MAJOR_DIM)); + m_textNumBtns->SetValue(wxString::Format("%u", DEFAULT_NUM_ENTRIES)); + m_textLabel->SetValue("I'm a radiobox"); + m_textLabelBtns->SetValue("item"); m_chkSpecifyRows->SetValue(false); m_chkEnableItem->SetValue(true); @@ -342,7 +342,7 @@ void RadioWidgetsPage::CreateRadio() unsigned long count; if ( !m_textNumBtns->GetValue().ToULong(&count) ) { - wxLogWarning(wxT("Should have a valid number for number of items.")); + wxLogWarning("Should have a valid number for number of items."); // fall back to default count = DEFAULT_NUM_ENTRIES; @@ -351,7 +351,7 @@ void RadioWidgetsPage::CreateRadio() unsigned long majorDim; if ( !m_textMajorDim->GetValue().ToULong(&majorDim) ) { - wxLogWarning(wxT("Should have a valid major dimension number.")); + wxLogWarning("Should have a valid major dimension number."); // fall back to default majorDim = DEFAULT_MAJOR_DIM; @@ -362,7 +362,7 @@ void RadioWidgetsPage::CreateRadio() wxString labelBtn = m_textLabelBtns->GetValue(); for ( size_t n = 0; n < count; n++ ) { - items[n] = wxString::Format(wxT("%s %lu"), + items[n] = wxString::Format("%s %lu", labelBtn.c_str(), (unsigned long)n + 1); } @@ -375,7 +375,7 @@ void RadioWidgetsPage::CreateRadio() switch ( m_radioDir->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected wxRadioBox layout direction") ); + wxFAIL_MSG( "unexpected wxRadioBox layout direction" ); // fall through case RadioDir_Default: @@ -434,12 +434,12 @@ void RadioWidgetsPage::OnRadioBox(wxCommandEvent& event) int event_sel = event.GetSelection(); wxUnusedVar(event_sel); - wxLogMessage(wxT("Radiobox selection changed, now %d"), sel); + wxLogMessage("Radiobox selection changed, now %d", sel); wxASSERT_MSG( sel == event_sel, - wxT("selection should be the same in event and radiobox") ); + "selection should be the same in event and radiobox" ); - m_textCurSel->SetValue(wxString::Format(wxT("%d"), sel)); + m_textCurSel->SetValue(wxString::Format("%d", sel)); } void RadioWidgetsPage::OnButtonRecreate(wxCommandEvent& WXUNUSED(event)) @@ -458,7 +458,7 @@ void RadioWidgetsPage::OnButtonSelection(wxCommandEvent& WXUNUSED(event)) if ( !m_textSel->GetValue().ToULong(&sel) || (sel >= (size_t)m_radio->GetCount()) ) { - wxLogWarning(wxT("Invalid number specified as new selection.")); + wxLogWarning("Invalid number specified as new selection."); } else { @@ -516,14 +516,14 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event) void RadioWidgetsPage::OnUpdateUIEnableItem(wxUpdateUIEvent& event) { - event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? wxT("Disable &2nd item") - : wxT("Enable &2nd item")); + event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? "Disable &2nd item" + : "Enable &2nd item"); } void RadioWidgetsPage::OnUpdateUIShowItem(wxUpdateUIEvent& event) { - event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? wxT("Hide 2nd &item") - : wxT("Show 2nd &item")); + event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? "Hide 2nd &item" + : "Show 2nd &item"); } #endif // wxUSE_RADIOBOX diff --git a/samples/widgets/searchctrl.cpp b/samples/widgets/searchctrl.cpp index ec295e87e9..91e45c64f0 100644 --- a/samples/widgets/searchctrl.cpp +++ b/samples/widgets/searchctrl.cpp @@ -130,7 +130,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, wxT("SearchCtrl"), +IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, "SearchCtrl", FAMILY_CTRLS | EDITABLE_CTRLS | ALL_CTRLS); SearchCtrlWidgetsPage::SearchCtrlWidgetsPage(WidgetsBookCtrl *book, @@ -147,12 +147,12 @@ void SearchCtrlWidgetsPage::CreateContent() wxSizer* box = new wxStaticBoxSizer( - new wxStaticBox(this, -1, wxT("Options")), + new wxStaticBox(this, -1, "Options"), wxVERTICAL); - m_searchBtnCheck = new wxCheckBox(this, ID_SEARCH_CB, wxT("Search button")); - m_cancelBtnCheck = new wxCheckBox(this, ID_CANCEL_CB, wxT("Cancel button")); - m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, wxT("Search menu")); + m_searchBtnCheck = new wxCheckBox(this, ID_SEARCH_CB, "Search button"); + m_cancelBtnCheck = new wxCheckBox(this, ID_CANCEL_CB, "Cancel button"); + m_menuBtnCheck = new wxCheckBox(this, ID_MENU_CB, "Search menu"); m_searchBtnCheck->SetValue(true); @@ -191,12 +191,12 @@ wxMenu* SearchCtrlWidgetsPage::CreateTestMenu() { wxMenu* menu = new wxMenu; const int SEARCH_MENU_SIZE = 5; - wxMenuItem* menuItem = menu->Append(wxID_ANY, wxT("Recent Searches"), wxT(""), wxITEM_NORMAL); + wxMenuItem* menuItem = menu->Append(wxID_ANY, "Recent Searches", "", wxITEM_NORMAL); menuItem->Enable(false); for ( int i = 0; i < SEARCH_MENU_SIZE; i++ ) { - wxString itemText = wxString::Format(wxT("item %i"),i); - wxString tipText = wxString::Format(wxT("tip %i"),i); + wxString itemText = wxString::Format("item %i",i); + wxString tipText = wxString::Format("tip %i",i); menu->Append(ID_SEARCHMENU+i, itemText, tipText, wxITEM_NORMAL); } return menu; diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index e5a3b454d6..33edea188d 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -226,7 +226,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, wxT("Slider"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, "Slider", FAMILY_CTRLS ); SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -253,43 +253,43 @@ void SliderWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Inverse")); - m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &ticks")); - m_chkMinMaxLabels = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show min/max &labels")); - m_chkValueLabel = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &value label")); + m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, "&Inverse"); + m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, "Show &ticks"); + m_chkMinMaxLabels = CreateCheckBoxAndAddToSizer(sizerLeft, "Show min/max &labels"); + m_chkValueLabel = CreateCheckBoxAndAddToSizer(sizerLeft, "Show &value label"); static const wxString sides[] = { - wxT("default"), - wxT("top"), - wxT("bottom"), - wxT("left"), - wxT("right"), + "default", + "top", + "bottom", + "left", + "right", }; - m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, wxT("&Label position"), + m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, "&Label position", wxDefaultPosition, wxDefaultSize, WXSIZEOF(sides), sides, 1, wxRA_SPECIFY_COLS); sizerLeft->Add(m_radioSides, 0, wxGROW | wxALL, 5); m_chkBothSides = CreateCheckBoxAndAddToSizer - (sizerLeft, wxT("&Both sides"), SliderPage_BothSides); + (sizerLeft, "&Both sides", SliderPage_BothSides); #if wxUSE_TOOLTIPS - m_chkBothSides->SetToolTip( wxT("\"Both sides\" is only supported \nin Universal") ); + m_chkBothSides->SetToolTip("\"Both sides\" is only supported \nin Universal"); #endif // wxUSE_TOOLTIPS sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, SliderPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, SliderPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change slider value")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change slider value"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value", SliderPage_CurValueText, &text); text->SetEditable(false); @@ -297,49 +297,49 @@ void SliderWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetValue, - wxT("Set &value"), + "Set &value", SliderPage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetMinAndMax, - wxT("&Min and max"), + "&Min and max", SliderPage_MinText, &m_textMin); m_textMax = new wxTextCtrl(this, SliderPage_MaxText, wxEmptyString); sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); - m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) ); - m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) ); + m_textMin->SetValue( wxString::Format("%d", m_min) ); + m_textMax->SetValue( wxString::Format("%d", m_max) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetLineSize, - wxT("Li&ne size"), + "Li&ne size", SliderPage_LineSizeText, &m_textLineSize); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetPageSize, - wxT("P&age size"), + "P&age size", SliderPage_PageSizeText, &m_textPageSize); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetTickFreq, - wxT("Tick &frequency"), + "Tick &frequency", SliderPage_TickFreqText, &m_textTickFreq); - m_textTickFreq->SetValue(wxT("10")); + m_textTickFreq->SetValue("10"); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen, - wxT("Thumb &length"), + "Thumb &length", SliderPage_ThumbLenText, &m_textThumbLen); @@ -353,8 +353,8 @@ void SliderWidgetsPage::CreateContent() Reset(); CreateSlider(); - m_textLineSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetLineSize())); - m_textPageSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetPageSize())); + m_textLineSize->SetValue(wxString::Format("%d", m_slider->GetLineSize())); + m_textPageSize->SetValue(wxString::Format("%d", m_slider->GetPageSize())); // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); @@ -429,7 +429,7 @@ void SliderWidgetsPage::CreateSlider() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through } @@ -488,7 +488,7 @@ void SliderWidgetsPage::DoSetLineSize() long lineSize; if ( !m_textLineSize->GetValue().ToLong(&lineSize) ) { - wxLogWarning(wxT("Invalid slider line size")); + wxLogWarning("Invalid slider line size"); return; } @@ -497,7 +497,7 @@ void SliderWidgetsPage::DoSetLineSize() if ( m_slider->GetLineSize() != lineSize ) { - wxLogWarning(wxT("Invalid line size in slider.")); + wxLogWarning("Invalid line size in slider."); } } @@ -506,7 +506,7 @@ void SliderWidgetsPage::DoSetPageSize() long pageSize; if ( !m_textPageSize->GetValue().ToLong(&pageSize) ) { - wxLogWarning(wxT("Invalid slider page size")); + wxLogWarning("Invalid slider page size"); return; } @@ -515,7 +515,7 @@ void SliderWidgetsPage::DoSetPageSize() if ( m_slider->GetPageSize() != pageSize ) { - wxLogWarning(wxT("Invalid page size in slider.")); + wxLogWarning("Invalid page size in slider."); } } @@ -524,7 +524,7 @@ void SliderWidgetsPage::DoSetTickFreq() long freq; if ( !m_textTickFreq->GetValue().ToLong(&freq) ) { - wxLogWarning(wxT("Invalid slider tick frequency")); + wxLogWarning("Invalid slider tick frequency"); return; } @@ -537,7 +537,7 @@ void SliderWidgetsPage::DoSetThumbLen() long len; if ( !m_textThumbLen->GetValue().ToLong(&len) ) { - wxLogWarning(wxT("Invalid slider thumb length")); + wxLogWarning("Invalid slider thumb length"); return; } @@ -584,7 +584,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) !m_textMax->GetValue().ToLong(&maxNew) || minNew >= maxNew ) { - wxLogWarning(wxT("Invalid min/max values for the slider.")); + wxLogWarning("Invalid min/max values for the slider."); return; } @@ -597,7 +597,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) if ( m_slider->GetMin() != m_min || m_slider->GetMax() != m_max ) { - wxLogWarning(wxT("Invalid range in slider.")); + wxLogWarning("Invalid range in slider."); } } @@ -606,7 +606,7 @@ void SliderWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event)) long val; if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) ) { - wxLogWarning(wxT("Invalid slider value.")); + wxLogWarning("Invalid slider value."); return; } @@ -673,7 +673,7 @@ void SliderWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void SliderWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(wxT("%d"), m_slider->GetValue()) ); + event.SetText( wxString::Format("%d", m_slider->GetValue()) ); } void SliderWidgetsPage::OnUpdateUIRadioSides(wxUpdateUIEvent& event) @@ -693,7 +693,7 @@ void SliderWidgetsPage::OnUpdateUIBothSides(wxUpdateUIEvent& event) void SliderWidgetsPage::OnSlider(wxScrollEvent& event) { wxASSERT_MSG( event.GetInt() == m_slider->GetValue(), - wxT("slider value should be the same") ); + "slider value should be the same" ); wxEventType eventType = event.GetEventType(); @@ -702,17 +702,17 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event) include/wx/event.h (section "wxScrollBar and wxSlider event identifiers") */ - static const wxChar *eventNames[] = + static const wxString eventNames[] = { - wxT("wxEVT_SCROLL_TOP"), - wxT("wxEVT_SCROLL_BOTTOM"), - wxT("wxEVT_SCROLL_LINEUP"), - wxT("wxEVT_SCROLL_LINEDOWN"), - wxT("wxEVT_SCROLL_PAGEUP"), - wxT("wxEVT_SCROLL_PAGEDOWN"), - wxT("wxEVT_SCROLL_THUMBTRACK"), - wxT("wxEVT_SCROLL_THUMBRELEASE"), - wxT("wxEVT_SCROLL_CHANGED") + "wxEVT_SCROLL_TOP", + "wxEVT_SCROLL_BOTTOM", + "wxEVT_SCROLL_LINEUP", + "wxEVT_SCROLL_LINEDOWN", + "wxEVT_SCROLL_PAGEUP", + "wxEVT_SCROLL_PAGEDOWN", + "wxEVT_SCROLL_THUMBTRACK", + "wxEVT_SCROLL_THUMBRELEASE", + "wxEVT_SCROLL_CHANGED" }; int index = eventType - wxEVT_SCROLL_TOP; @@ -722,12 +722,12 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event) should be added to the above eventNames array. */ wxASSERT_MSG(index >= 0 && (size_t)index < WXSIZEOF(eventNames), - wxT("Unknown slider event") ); + "Unknown slider event" ); static int s_numSliderEvents = 0; - wxLogMessage(wxT("Slider event #%d: %s (pos = %d, int value = %d)"), + wxLogMessage("Slider event #%d: %s (pos = %d, int value = %d)", s_numSliderEvents++, eventNames[index], event.GetPosition(), diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index 391160fff6..b86f477fdf 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -211,7 +211,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, wxT("Spin"), +IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, "Spin", FAMILY_CTRLS | EDITABLE_CTRLS ); @@ -245,25 +245,25 @@ void SpinBtnWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set style"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical")); - m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Arrow Keys")); - m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Wrap")); + m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, "&Vertical"); + m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, "&Arrow Keys"); + m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, "&Wrap"); m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeft, - wxT("Process &Enter")); + "Process &Enter"); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; - m_radioAlign = new wxRadioBox(this, wxID_ANY, wxT("&Text alignment"), + m_radioAlign = new wxRadioBox(this, wxID_ANY, "&Text alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 1); @@ -271,17 +271,17 @@ void SpinBtnWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, SpinBtnPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, SpinBtnPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - wxT("&Change spinbtn value")); + "&Change spinbtn value"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel("Current value", SpinBtnPage_CurValueText, &text); text->SetEditable(false); @@ -289,21 +289,21 @@ void SpinBtnWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetValue, - wxT("Set &value"), + "Set &value", SpinBtnPage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetMinAndMax, - wxT("&Min and max"), + "&Min and max", SpinBtnPage_MinText, &m_textMin); m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString); sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); - m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) ); - m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) ); + m_textMin->SetValue( wxString::Format("%d", m_min) ); + m_textMax->SetValue( wxString::Format("%d", m_max) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -367,7 +367,7 @@ void SpinBtnWidgetsPage::CreateSpin() switch ( m_radioAlign->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case Align_Left: @@ -403,28 +403,28 @@ void SpinBtnWidgetsPage::CreateSpin() m_spinbtn->SetRange(m_min, m_max); m_spinctrl = new wxSpinCtrl(this, SpinBtnPage_SpinCtrl, - wxString::Format(wxT("%d"), val), + wxString::Format("%d", val), wxDefaultPosition, wxDefaultSize, flags | textFlags, m_min, m_max, val); m_spinctrldbl = new wxSpinCtrlDouble(this, SpinBtnPage_SpinCtrlDouble, - wxString::Format(wxT("%d"), val), + wxString::Format("%d", val), wxDefaultPosition, wxDefaultSize, flags | textFlags, m_min, m_max, val, 0.1); // Add spacers, labels and spin controls to the sizer. m_sizerSpin->Add(0, 0, 1); - m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinButton")), + m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinButton"), 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(m_spinbtn, 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(0, 0, 1); - m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrl")), + m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrl"), 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(m_spinctrl, 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(0, 0, 1); - m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, wxT("wxSpinCtrlDouble")), + m_sizerSpin->Add(new wxStaticText(this, wxID_ANY, "wxSpinCtrlDouble"), 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(m_spinctrldbl, 0, wxALIGN_CENTRE | wxALL, 5); m_sizerSpin->Add(0, 0, 1); @@ -451,7 +451,7 @@ void SpinBtnWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) !m_textMax->GetValue().ToLong(&maxNew) || minNew > maxNew ) { - wxLogWarning(wxT("Invalid min/max values for the spinbtn.")); + wxLogWarning("Invalid min/max values for the spinbtn."); return; } @@ -498,7 +498,7 @@ void SpinBtnWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event)) long val; if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) ) { - wxLogWarning(wxT("Invalid spinbtn value.")); + wxLogWarning("Invalid spinbtn value."); return; } @@ -542,7 +542,7 @@ void SpinBtnWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void SpinBtnWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(wxT("%d"), m_spinbtn->GetValue())); + event.SetText( wxString::Format("%d", m_spinbtn->GetValue())); } void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) @@ -550,20 +550,20 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) int value = event.GetInt(); wxASSERT_MSG( value == m_spinbtn->GetValue(), - wxT("spinbtn value should be the same") ); + "spinbtn value should be the same" ); - wxLogMessage(wxT("Spin button value changed, now %d"), value); + wxLogMessage("Spin button value changed, now %d", value); } void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event) { - wxLogMessage( wxT("Spin button value incremented, will be %d (was %d)"), + wxLogMessage( "Spin button value incremented, will be %d (was %d)", event.GetInt(), m_spinbtn->GetValue() ); } void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event) { - wxLogMessage( wxT("Spin button value decremented, will be %d (was %d)"), + wxLogMessage( "Spin button value decremented, will be %d (was %d)", event.GetInt(), m_spinbtn->GetValue() ); } @@ -572,21 +572,21 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxSpinEvent& event) int value = event.GetInt(); wxASSERT_MSG( value == m_spinctrl->GetValue(), - wxT("spinctrl value should be the same") ); + "spinctrl value should be the same" ); - wxLogMessage(wxT("Spin control value changed, now %d"), value); + wxLogMessage("Spin control value changed, now %d", value); } void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event) { double value = event.GetValue(); - wxLogMessage(wxT("Spin control value changed, now %g"), value); + wxLogMessage("Spin control value changed, now %g", value); } void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event) { - wxLogMessage(wxT("Text changed in spin control, now \"%s\""), + wxLogMessage("Text changed in spin control, now \"%s\"", event.GetString().c_str()); } diff --git a/samples/widgets/statbmp.cpp b/samples/widgets/statbmp.cpp index 97ebb97030..c1842beb74 100644 --- a/samples/widgets/statbmp.cpp +++ b/samples/widgets/statbmp.cpp @@ -62,7 +62,7 @@ private: void OnMouseEvent(wxMouseEvent& WXUNUSED(event)) { - wxLogMessage(wxT("wxStaticBitmap clicked.")); + wxLogMessage("wxStaticBitmap clicked."); } wxStaticBitmapBase *m_statbmp; @@ -74,7 +74,7 @@ private: DECLARE_WIDGETS_PAGE(StatBmpWidgetsPage) }; -IMPLEMENT_WIDGETS_PAGE(StatBmpWidgetsPage, wxT("StaticBitmap"), +IMPLEMENT_WIDGETS_PAGE(StatBmpWidgetsPage, "StaticBitmap", ALL_CTRLS); void StatBmpWidgetsPage::CreateContent() @@ -92,12 +92,12 @@ void StatBmpWidgetsPage::CreateContent() wxString testImage; #if wxUSE_LIBPNG wxPathList pathlist; - pathlist.Add(wxT(".")); - pathlist.Add(wxT("..")); - pathlist.Add(wxT("../image")); - pathlist.Add(wxT("../../../samples/image")); + pathlist.Add("."); + pathlist.Add(".."); + pathlist.Add("../image"); + pathlist.Add("../../../samples/image"); - wxFileName fn(pathlist.FindValidPath(wxT("toucan.png"))); + wxFileName fn(pathlist.FindValidPath("toucan.png")); if ( fn.FileExists() ) testImage = fn.GetFullPath(); #endif // wxUSE_LIBPNG diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 143205238d..5ae946b9f8 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -200,7 +200,7 @@ wxEND_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, wxT("Static"), +IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, "Static", (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS) ); @@ -260,22 +260,22 @@ void StaticWidgetsPage::CreateContent() static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; static const wxString valign[] = { - wxT("top"), - wxT("centre"), - wxT("bottom"), + "top", + "centre", + "bottom", }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 3); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign, 3); @@ -285,23 +285,23 @@ void StaticWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Ellipsize")); + m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, "&Ellipsize"); static const wxString ellipsizeMode[] = { - wxT("&start"), - wxT("&middle"), - wxT("&end"), + "&start", + "&middle", + "&end", }; - m_radioEllipsize = new wxRadioBox(this, wxID_ANY, wxT("&Ellipsize mode"), + m_radioEllipsize = new wxRadioBox(this, wxID_ANY, "&Ellipsize mode", wxDefaultPosition, wxDefaultSize, WXSIZEOF(ellipsizeMode), ellipsizeMode, 3); sizerLeft->Add(m_radioEllipsize, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, StaticPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, StaticPage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane @@ -340,14 +340,14 @@ void StaticWidgetsPage::CreateContent() // NB: must be done _before_ calling CreateStatic() Reset(); - m_textBox->SetValue(wxT("This is a &box")); - m_textLabel->SetValue(wxT("And this is a\n\tlabel inside the box with a &mnemonic.\n") - wxT("Only this text is affected by the ellipsize settings.")); + m_textBox->SetValue("This is a &box"); + m_textLabel->SetValue("And this is a\n\tlabel inside the box with a &mnemonic.\n" + "Only this text is affected by the ellipsize settings."); #if wxUSE_MARKUP - m_textLabelWithMarkup->SetValue(wxT("Another label, this time decorated ") - wxT("with markup; here you need entities ") - wxT("for the symbols: < > & ' " ") - wxT(" but you can still place &mnemonics...")); + m_textLabelWithMarkup->SetValue("Another label, this time decorated " + "with markup; here you need entities " + "for the symbols: < > & ' " " + " but you can still place &mnemonics..."); #endif // wxUSE_MARKUP // right pane @@ -416,7 +416,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioHAlign->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case StaticHAlign_Left: @@ -435,7 +435,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioVAlign->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case StaticVAlign_Top: @@ -456,7 +456,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioEllipsize->GetSelection() ) { default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case StaticEllipsize_Start: @@ -603,9 +603,9 @@ void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& WXUNUSED(event)) // test GetLabel() and GetLabelText(); the first should return the // label as it is written in the relative text control; the second should // return the label as it's shown in the wxStaticText - wxLogMessage(wxT("The original label should be '%s'"), + wxLogMessage("The original label should be '%s'", m_statText->GetLabel()); - wxLogMessage(wxT("The label text is '%s'"), + wxLogMessage("The label text is '%s'", m_statText->GetLabelText()); } @@ -617,9 +617,9 @@ void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(eve // test GetLabel() and GetLabelText(); the first should return the // label as it is written in the relative text control; the second should // return the label as it's shown in the wxStaticText - wxLogMessage(wxT("The original label should be '%s'"), + wxLogMessage("The original label should be '%s'", m_statMarkup->GetLabel()); - wxLogMessage(wxT("The label text is '%s'"), + wxLogMessage("The label text is '%s'", m_statMarkup->GetLabelText()); } #endif // wxUSE_MARKUP diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 96e5074954..4797c0100b 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -292,32 +292,32 @@ private: switch ( HitTest(event.GetPosition(), &x, &y) ) { default: - wxFAIL_MSG( wxT("unexpected HitTest() result") ); + wxFAIL_MSG( "unexpected HitTest() result" ); // fall through case wxTE_HT_UNKNOWN: x = y = -1; - where = wxT("nowhere near"); + where = "nowhere near"; break; case wxTE_HT_BEFORE: - where = wxT("before"); + where = "before"; break; case wxTE_HT_BELOW: - where = wxT("below"); + where = "below"; break; case wxTE_HT_BEYOND: - where = wxT("beyond"); + where = "beyond"; break; case wxTE_HT_ON_TEXT: - where = wxT("at"); + where = "at"; break; } - wxLogMessage(wxT("Mouse is %s (%ld, %ld)"), where.c_str(), x, y); + wxLogMessage("Mouse is %s (%ld, %ld)", where.c_str(), x, y); } }; @@ -366,7 +366,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, wxT("Text"), +IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, "Text", FAMILY_CTRLS | EDITABLE_CTRLS ); @@ -415,12 +415,12 @@ void TextWidgetsPage::CreateContent() // left pane static const wxString modes[] = { - wxT("single line"), - wxT("multi line"), + "single line", + "multi line", }; - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set textctrl parameters")); - m_radioTextLines = new wxRadioBox(this, wxID_ANY, wxT("&Number of lines:"), + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "&Set textctrl parameters"); + m_radioTextLines = new wxRadioBox(this, wxID_ANY, "&Number of lines:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(modes), modes, 1, wxRA_SPECIFY_COLS); @@ -431,22 +431,22 @@ void TextWidgetsPage::CreateContent() sizerLeft->AddSpacer(5); m_chkPassword = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("&Password control"), TextPage_Password + sizerLeft, "&Password control", TextPage_Password ); m_chkReadonly = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("&Read-only mode") + sizerLeft, "&Read-only mode" ); m_chkProcessEnter = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("Process &Enter") + sizerLeft, "Process &Enter" ); m_chkProcessTab = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("Process &Tab") + sizerLeft, "Process &Tab" ); m_chkFilename = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("&Filename control") + sizerLeft, "&Filename control" ); m_chkNoVertScrollbar = CreateCheckBoxAndAddToSizer( - sizerLeft, wxT("No &vertical scrollbar"), + sizerLeft, "No &vertical scrollbar", TextPage_NoVertScrollbar ); m_chkFilename->Disable(); // not implemented yet @@ -454,13 +454,13 @@ void TextWidgetsPage::CreateContent() static const wxString wrap[] = { - wxT("no wrap"), - wxT("word wrap"), - wxT("char wrap"), - wxT("best wrap"), + "no wrap", + "word wrap", + "char wrap", + "best wrap", }; - m_radioWrap = new wxRadioBox(this, TextPage_WrapLines, wxT("&Wrap style:"), + m_radioWrap = new wxRadioBox(this, TextPage_WrapLines, "&Wrap style:", wxDefaultPosition, wxDefaultSize, WXSIZEOF(wrap), wrap, 1, wxRA_SPECIFY_COLS); @@ -481,12 +481,12 @@ void TextWidgetsPage::CreateContent() #ifdef __WXMSW__ static const wxString kinds[] = { - wxT("plain edit"), - wxT("rich edit"), - wxT("rich edit 2.0"), + "plain edit", + "rich edit", + "rich edit 2.0", }; - m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Control &kind"), + m_radioKind = new wxRadioBox(this, wxID_ANY, "Control &kind", wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); @@ -495,33 +495,33 @@ void TextWidgetsPage::CreateContent() sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); #endif // __WXMSW__ - wxButton *btn = new wxButton(this, TextPage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, TextPage_Reset, "&Reset"); sizerLeft->Add(2, 2, 0, wxGROW | wxALL, 1); // spacer sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change contents:")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Change contents:"); wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, TextPage_Set, wxT("&Set text value")); + btn = new wxButton(this, TextPage_Set, "&Set text value"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Add, wxT("&Append text")); + btn = new wxButton(this, TextPage_Add, "&Append text"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Insert, wxT("&Insert text")); + btn = new wxButton(this, TextPage_Insert, "&Insert text"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Load, wxT("&Load file")); + btn = new wxButton(this, TextPage_Load, "&Load file"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Clear, wxT("&Clear")); + btn = new wxButton(this, TextPage_Clear, "&Clear"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_StreamRedirector, wxT("St&ream redirection")); + btn = new wxButton(this, TextPage_StreamRedirector, "St&ream redirection"); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, wxT("&Info:")); + wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, "&Info:"); wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL); m_textPosCur = CreateInfoText(); @@ -531,19 +531,19 @@ void TextWidgetsPage::CreateContent() wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); sizerRow->Add(CreateTextWithLabelSizer ( - wxT("Current pos:"), + "Current pos:", m_textPosCur ), 0, wxRIGHT, 5); sizerRow->Add(CreateTextWithLabelSizer ( - wxT("Col:"), + "Col:", m_textColCur ), 0, wxLEFT | wxRIGHT, 5); sizerRow->Add(CreateTextWithLabelSizer ( - wxT("Row:"), + "Row:", m_textRowCur ), 0, wxLEFT, 5); @@ -555,9 +555,9 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - wxT("Number of lines:"), + "Number of lines:", m_textLineLast, - wxT("Last position:"), + "Last position:", m_textPosLast ), 0, wxALL, 5 @@ -569,9 +569,9 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - wxT("Selection: from"), + "Selection: from", m_textSelFrom, - wxT("to"), + "to", m_textSelTo ), 0, wxALL, 5 @@ -584,7 +584,7 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - wxT("Range 10..20:"), + "Range 10..20:", m_textRange ), 0, wxALL, 5 @@ -606,7 +606,7 @@ void TextWidgetsPage::CreateContent() sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5); // right pane - wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, wxT("&Text:")); + wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, "&Text:"); m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL); Reset(); CreateText(); @@ -631,7 +631,7 @@ wxTextCtrl *TextWidgetsPage::CreateInfoText() if ( !s_maxWidth ) { // calc it once only - GetTextExtent(wxT("9999999"), &s_maxWidth, NULL); + GetTextExtent("9999999", &s_maxWidth, NULL); } wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, @@ -689,7 +689,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioTextLines->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected lines radio box selection") ); + wxFAIL_MSG( "unexpected lines radio box selection" ); case TextLines_Single: break; @@ -714,7 +714,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioWrap->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected wrap style radio box selection") ); + wxFAIL_MSG( "unexpected wrap style radio box selection" ); wxFALLTHROUGH; case WrapStyle_None: @@ -754,7 +754,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( wxT("unexpected kind radio box selection") ); + wxFAIL_MSG( "unexpected kind radio box selection" ); case TextKind_Plain: break; @@ -779,7 +779,7 @@ void TextWidgetsPage::CreateText() } else { - valueOld = wxT("Hello, Universe!"); + valueOld = "Hello, Universe!"; } m_text = new WidgetsTextCtrl(this, TextPage_Textctrl, valueOld, flags); @@ -839,7 +839,7 @@ void TextWidgetsPage::OnIdle(wxIdleEvent& WXUNUSED(event)) if ( m_textLineLast ) { m_textLineLast->SetValue( - wxString::Format(wxT("%d"), m_text->GetNumberOfLines()) ); + wxString::Format("%d", m_text->GetNumberOfLines()) ); } if ( m_textSelFrom && m_textSelTo ) @@ -884,8 +884,8 @@ void TextWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void TextWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) { m_text->SetValue(m_text->GetWindowStyle() & wxTE_MULTILINE - ? wxT("Here,\nthere and\neverywhere") - : wxT("Yellow submarine")); + ? "Here,\nthere and\neverywhere" + : "Yellow submarine"); m_text->SetFocus(); } @@ -894,18 +894,18 @@ void TextWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) { if ( m_text->GetWindowStyle() & wxTE_MULTILINE ) { - m_text->AppendText(wxT("We all live in a\n")); + m_text->AppendText("We all live in a\n"); } - m_text->AppendText(wxT("Yellow submarine")); + m_text->AppendText("Yellow submarine"); } void TextWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) { - m_text->WriteText(wxT("Is there anybody going to listen to my story")); + m_text->WriteText("Is there anybody going to listen to my story"); if ( m_text->GetWindowStyle() & wxTE_MULTILINE ) { - m_text->WriteText(wxT("\nall about the girl who came to stay")); + m_text->WriteText("\nall about the girl who came to stay"); } } @@ -919,15 +919,15 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) { // search for the file in several dirs where it's likely to be wxPathList pathlist; - pathlist.Add(wxT(".")); - pathlist.Add(wxT("..")); - pathlist.Add(wxT("../widgets")); - pathlist.Add(wxT("../../../samples/widgets")); + pathlist.Add("."); + pathlist.Add(".."); + pathlist.Add("../widgets"); + pathlist.Add("../../../samples/widgets"); - wxString filename = pathlist.FindValidPath(wxT("textctrl.cpp")); + wxString filename = pathlist.FindValidPath("textctrl.cpp"); if ( !filename ) { - wxLogError(wxT("File textctrl.cpp not found.")); + wxLogError("File textctrl.cpp not found."); } else // load it { @@ -935,12 +935,12 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) if ( !m_text->LoadFile(filename) ) { // this is not supposed to happen ... - wxLogError(wxT("Error loading file.")); + wxLogError("Error loading file."); } else { long elapsed = sw.Time(); - wxLogMessage(wxT("Loaded file '%s' in %lu.%us"), + wxLogMessage("Loaded file '%s' in %lu.%us", filename.c_str(), elapsed / 1000, (unsigned int) elapsed % 1000); } @@ -996,12 +996,12 @@ void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event)) return; } - wxLogMessage(wxT("Text ctrl value changed")); + wxLogMessage("Text ctrl value changed"); } void TextWidgetsPage::OnTextEnter(wxCommandEvent& event) { - wxLogMessage(wxT("Text entered: '%s'"), event.GetString().c_str()); + wxLogMessage("Text entered: '%s'", event.GetString().c_str()); event.Skip(); } @@ -1058,9 +1058,9 @@ void TextWidgetsPage::OnStreamRedirector(wxCommandEvent& WXUNUSED(event)) { #if wxHAS_TEXT_WINDOW_STREAM wxStreamToTextRedirector redirect(m_text); - wxString str( wxT("Outputed to cout, appears in wxTextCtrl!") ); + wxString str( "Outputed to cout, appears in wxTextCtrl!" ); wxSTD cout << str << wxSTD endl; #else - wxMessageBox(wxT("This wxWidgets build does not support wxStreamToTextRedirector")); + wxMessageBox("This wxWidgets build does not support wxStreamToTextRedirector"); #endif } diff --git a/samples/widgets/timepick.cpp b/samples/widgets/timepick.cpp index b8c0572b9a..303aee3f5d 100644 --- a/samples/widgets/timepick.cpp +++ b/samples/widgets/timepick.cpp @@ -119,7 +119,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(TimePickerWidgetsPage, wxT("TimePicker"), +IMPLEMENT_WIDGETS_PAGE(TimePickerWidgetsPage, "TimePicker", FAMILY_CTRLS | PICKER_CTRLS ); diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index 1bbdcab0ef..83289037bc 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -175,7 +175,7 @@ wxEND_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, wxT("ToggleButton"), +IMPLEMENT_WIDGETS_PAGE(ToggleWidgetsPage, "ToggleButton", FAMILY_CTRLS ); @@ -213,14 +213,14 @@ void ToggleWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("Styles")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, "Styles"); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); #ifdef wxHAS_BITMAPTOGGLEBUTTON m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only"); m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and bitmap"); - m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly")); + m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, "&Fit exactly"); #endif // wxHAS_BITMAPTOGGLEBUTTON #if wxUSE_MARKUP m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup"); @@ -261,22 +261,22 @@ void ToggleWidgetsPage::CreateContent() // should be in sync with enums Toggle[HV]Align! static const wxString halign[] = { - wxT("left"), - wxT("centre"), - wxT("right"), + "left", + "centre", + "right", }; static const wxString valign[] = { - wxT("top"), - wxT("centre"), - wxT("bottom"), + "top", + "centre", + "bottom", }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, "&Horz alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, "&Vert alignment", wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); @@ -286,18 +286,18 @@ void ToggleWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, TogglePage_Reset, wxT("&Reset")); + wxButton *btn = new wxButton(this, TogglePage_Reset, "&Reset"); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, "&Operations"); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel, - wxT("Change label"), + "Change label", wxID_ANY, &m_textLabel); - m_textLabel->SetValue(wxT("&Toggle me!")); + m_textLabel->SetValue("&Toggle me!"); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -378,7 +378,7 @@ void ToggleWidgetsPage::CreateToggle() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ToggleHAlign_Centre: @@ -396,7 +396,7 @@ void ToggleWidgetsPage::CreateToggle() break; default: - wxFAIL_MSG(wxT("unexpected radiobox selection")); + wxFAIL_MSG("unexpected radiobox selection"); // fall through case ToggleVAlign_Centre: @@ -419,22 +419,22 @@ void ToggleWidgetsPage::CreateToggle() if ( m_chkUseBitmapClass->GetValue() ) { btgl = new wxBitmapToggleButton(this, TogglePage_Picker, - CreateBitmap(wxT("normal"))); + CreateBitmap("normal")); } else { - btgl = new wxToggleButton(this, TogglePage_Picker, wxT("")); - btgl->SetBitmapLabel(CreateBitmap(wxT("normal"))); + btgl = new wxToggleButton(this, TogglePage_Picker, ""); + btgl->SetBitmapLabel(CreateBitmap("normal")); } #ifdef wxHAS_ANY_BUTTON if ( m_chkUsePressed->GetValue() ) - btgl->SetBitmapPressed(CreateBitmap(wxT("pushed"))); + btgl->SetBitmapPressed(CreateBitmap("pushed")); if ( m_chkUseFocused->GetValue() ) - btgl->SetBitmapFocus(CreateBitmap(wxT("focused"))); + btgl->SetBitmapFocus(CreateBitmap("focused")); if ( m_chkUseCurrent->GetValue() ) - btgl->SetBitmapCurrent(CreateBitmap(wxT("hover"))); + btgl->SetBitmapCurrent(CreateBitmap("hover")); if ( m_chkUseDisabled->GetValue() ) - btgl->SetBitmapDisabled(CreateBitmap(wxT("disabled"))); + btgl->SetBitmapDisabled(CreateBitmap("disabled")); #endif // wxHAS_ANY_BUTTON m_toggle = btgl; } @@ -527,8 +527,8 @@ wxBitmap ToggleWidgetsPage::CreateBitmap(const wxString& label) dc.SetBackground(*wxCYAN_BRUSH); dc.Clear(); dc.SetTextForeground(*wxBLACK); - dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n") - wxT("(") + label + wxT(" state)"), + dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + "\n" + "(" + label + " state)", wxArtProvider::GetBitmap(wxART_INFORMATION), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index c14cadcc26..63eee2c2f8 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -357,22 +357,22 @@ bool WidgetsApp::OnInit() // this sample side by side and it is useful to see which one is which wxString title; #if defined(__WXUNIVERSAL__) - title = wxT("wxUniv/"); + title = "wxUniv/"; #endif #if defined(__WXMSW__) - title += wxT("wxMSW"); + title += "wxMSW"; #elif defined(__WXGTK__) - title += wxT("wxGTK"); + title += "wxGTK"; #elif defined(__WXMAC__) - title += wxT("wxMAC"); + title += "wxMAC"; #elif defined(__WXMOTIF__) - title += wxT("wxMOTIF"); + title += "wxMOTIF"; #else - title += wxT("wxWidgets"); + title += "wxWidgets"; #endif - wxFrame *frame = new WidgetsFrame(title + wxT(" widgets demo")); + wxFrame *frame = new WidgetsFrame(title + " widgets demo"); frame->Show(); return true; @@ -400,25 +400,25 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxMenuBar *mbar = new wxMenuBar; wxMenu *menuWidget = new wxMenu; #if wxUSE_TOOLTIPS - menuWidget->Append(Widgets_SetTooltip, wxT("Set &tooltip...\tCtrl-T")); + menuWidget->Append(Widgets_SetTooltip, "Set &tooltip...\tCtrl-T"); menuWidget->AppendSeparator(); #endif // wxUSE_TOOLTIPS - menuWidget->Append(Widgets_SetFgColour, wxT("Set &foreground...\tCtrl-F")); - menuWidget->Append(Widgets_SetBgColour, wxT("Set &background...\tCtrl-B")); - menuWidget->Append(Widgets_SetPageBg, wxT("Set &page background...\tShift-Ctrl-B")); - menuWidget->Append(Widgets_SetFont, wxT("Set f&ont...\tCtrl-O")); - menuWidget->AppendCheckItem(Widgets_Enable, wxT("&Enable/disable\tCtrl-E")); - menuWidget->AppendCheckItem(Widgets_Show, wxT("Show/Hide")); + menuWidget->Append(Widgets_SetFgColour, "Set &foreground...\tCtrl-F"); + menuWidget->Append(Widgets_SetBgColour, "Set &background...\tCtrl-B"); + menuWidget->Append(Widgets_SetPageBg, "Set &page background...\tShift-Ctrl-B"); + menuWidget->Append(Widgets_SetFont, "Set f&ont...\tCtrl-O"); + menuWidget->AppendCheckItem(Widgets_Enable, "&Enable/disable\tCtrl-E"); + menuWidget->AppendCheckItem(Widgets_Show, "Show/Hide"); wxMenu *menuBorders = new wxMenu; - menuBorders->AppendRadioItem(Widgets_BorderDefault, wxT("De&fault\tCtrl-Shift-9")); - menuBorders->AppendRadioItem(Widgets_BorderNone, wxT("&None\tCtrl-Shift-0")); - menuBorders->AppendRadioItem(Widgets_BorderSimple, wxT("&Simple\tCtrl-Shift-1")); - menuBorders->AppendRadioItem(Widgets_BorderDouble, wxT("&Double\tCtrl-Shift-2")); - menuBorders->AppendRadioItem(Widgets_BorderStatic, wxT("Stati&c\tCtrl-Shift-3")); - menuBorders->AppendRadioItem(Widgets_BorderRaised, wxT("&Raised\tCtrl-Shift-4")); - menuBorders->AppendRadioItem(Widgets_BorderSunken, wxT("S&unken\tCtrl-Shift-5")); - menuWidget->AppendSubMenu(menuBorders, wxT("Set &border")); + menuBorders->AppendRadioItem(Widgets_BorderDefault, "De&fault\tCtrl-Shift-9"); + menuBorders->AppendRadioItem(Widgets_BorderNone, "&None\tCtrl-Shift-0"); + menuBorders->AppendRadioItem(Widgets_BorderSimple, "&Simple\tCtrl-Shift-1"); + menuBorders->AppendRadioItem(Widgets_BorderDouble, "&Double\tCtrl-Shift-2"); + menuBorders->AppendRadioItem(Widgets_BorderStatic, "Stati&c\tCtrl-Shift-3"); + menuBorders->AppendRadioItem(Widgets_BorderRaised, "&Raised\tCtrl-Shift-4"); + menuBorders->AppendRadioItem(Widgets_BorderSunken, "S&unken\tCtrl-Shift-5"); + menuWidget->AppendSubMenu(menuBorders, "Set &border"); wxMenu* const menuVariants = new wxMenu; menuVariants->AppendRadioItem(Widgets_VariantMini, "&Mini\tCtrl-Shift-6"); @@ -433,31 +433,31 @@ WidgetsFrame::WidgetsFrame(const wxString& title) menuWidget->AppendSeparator(); menuWidget->AppendCheckItem(Widgets_GlobalBusyCursor, - wxT("Toggle &global busy cursor\tCtrl-Shift-U")); + "Toggle &global busy cursor\tCtrl-Shift-U"); menuWidget->AppendCheckItem(Widgets_BusyCursor, - wxT("Toggle b&usy cursor\tCtrl-U")); + "Toggle b&usy cursor\tCtrl-U"); menuWidget->AppendSeparator(); - menuWidget->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q")); - mbar->Append(menuWidget, wxT("&Widget")); + menuWidget->Append(wxID_EXIT, "&Quit\tCtrl-Q"); + mbar->Append(menuWidget, "&Widget"); wxMenu *menuTextEntry = new wxMenu; menuTextEntry->AppendRadioItem(TextEntry_DisableAutoComplete, - wxT("&Disable auto-completion")); + "&Disable auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFixed, - wxT("Fixed-&list auto-completion")); + "Fixed-&list auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames, - wxT("&Files names auto-completion")); + "&Files names auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteDirectories, - wxT("&Directories names auto-completion")); + "&Directories names auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteCustom, - wxT("&Custom auto-completion")); + "&Custom auto-completion"); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteKeyLength, - wxT("Custom with &min length")); + "Custom with &min length"); menuTextEntry->AppendSeparator(); menuTextEntry->Append(TextEntry_SetHint, "Set help &hint"); - mbar->Append(menuTextEntry, wxT("&Text")); + mbar->Append(menuTextEntry, "&Text"); SetMenuBar(mbar); @@ -488,7 +488,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title) // the lower one only has the log listbox and a button to clear it #if USE_LOG wxSizer *sizerDown = new wxStaticBoxSizer( - new wxStaticBox( m_panel, wxID_ANY, wxT("&Log window") ), + new wxStaticBox( m_panel, wxID_ANY, "&Log window" ), wxVERTICAL); m_lboxLog = new wxListBox(m_panel, wxID_ANY); @@ -501,11 +501,11 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL); wxButton *btn; #if USE_LOG - btn = new wxButton(m_panel, Widgets_ClearLog, wxT("Clear &log")); + btn = new wxButton(m_panel, Widgets_ClearLog, "Clear &log"); sizerBtns->Add(btn); sizerBtns->Add(10, 0); // spacer #endif // USE_LOG - btn = new wxButton(m_panel, Widgets_Quit, wxT("E&xit")); + btn = new wxButton(m_panel, Widgets_Quit, "E&xit"); sizerBtns->Add(btn); sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5); @@ -601,7 +601,7 @@ void WidgetsFrame::InitBook() } } - GetMenuBar()->Append(menuPages, wxT("&Page")); + GetMenuBar()->Append(menuPages, "&Page"); m_book->AssignImageList(imageList); @@ -664,7 +664,7 @@ WidgetsPage *WidgetsFrame::CurrentPage() #if !USE_TREEBOOK WidgetsBookCtrl *subBook = wxStaticCast(page, WidgetsBookCtrl); - wxCHECK_MSG( subBook, NULL, wxT("no WidgetsBookCtrl?") ); + wxCHECK_MSG( subBook, NULL, "no WidgetsBookCtrl?" ); page = subBook->GetCurrentPage(); #endif // !USE_TREEBOOK @@ -771,8 +771,8 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) wxTextEntryDialog dialog ( this, - wxT("Tooltip text (may use \\n, leave empty to remove): "), - wxT("Widgets sample"), + "Tooltip text (may use \\n, leave empty to remove): ", + "Widgets sample", WidgetsPage::GetAttrs().m_tooltip ); @@ -780,7 +780,7 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) return; WidgetsPage::GetAttrs().m_tooltip = dialog.GetValue(); - WidgetsPage::GetAttrs().m_tooltip.Replace(wxT("\\n"), wxT("\n")); + WidgetsPage::GetAttrs().m_tooltip.Replace("\\n", "\n"); CurrentPage()->SetUpWidget(); } @@ -870,7 +870,7 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event)) // so re-layout to show it correctly. page->Layout(); #else - wxLogMessage(wxT("Font selection dialog not available in current build.")); + wxLogMessage("Font selection dialog not available in current build."); #endif } @@ -901,7 +901,7 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event) case Widgets_BorderDouble: border = wxBORDER_DOUBLE; break; default: - wxFAIL_MSG( wxT("unknown border style") ); + wxFAIL_MSG( "unknown border style" ); // fall through case Widgets_BorderDefault: border = wxBORDER_DEFAULT; break; @@ -1210,7 +1210,7 @@ void WidgetsFrame::OnWidgetFocus(wxFocusEvent& event) // WidgetsPageInfo // ---------------------------------------------------------------------------- -WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories) +WidgetsPageInfo::WidgetsPageInfo(Constructor ctor, const wxString& label, int categories) : m_label(label) , m_categories(categories) { diff --git a/samples/widgets/widgets.h b/samples/widgets/widgets.h index 65d7708133..c632fffe6c 100644 --- a/samples/widgets/widgets.h +++ b/samples/widgets/widgets.h @@ -197,7 +197,7 @@ public: wxImageList *imaglist); // our ctor - WidgetsPageInfo(Constructor ctor, const wxChar *label, int categories); + WidgetsPageInfo(Constructor ctor, const wxString& label, int categories); // accessors const wxString& GetLabel() const { return m_label; } diff --git a/samples/xti/codereadercallback.cpp b/samples/xti/codereadercallback.cpp index e2a1d187b4..f48e61c348 100644 --- a/samples/xti/codereadercallback.cpp +++ b/samples/xti/codereadercallback.cpp @@ -90,7 +90,7 @@ void wxObjectCodeReaderCallback::AllocateObject(int objectID, wxClassInfo *class { // add corresponding header if not already included wxString include; - include.Printf(wxT("#include \"%s\"\n"),classInfo->GetIncludeName()); + include.Printf("#include \"%s\"\n",classInfo->GetIncludeName()); if ( m_headerincludes.Find(include) == wxNOT_FOUND) m_headerincludes += include; } @@ -155,12 +155,12 @@ wxString wxObjectCodeReaderCallback::ValueAsCode( const wxAny ¶m ) } else { - wxLogError ( _("Internal error, illegal wxCustomTypeInfo") ); + wxLogError ( "Internal error, illegal wxCustomTypeInfo" ); } } else if ( type->GetKind() == wxT_STRING ) { - value.Printf( wxT("\"%s\""), wxAnyGetAsString(param).c_str() ); + value.Printf( "\"%s\"", wxAnyGetAsString(param).c_str() ); } else if ( type->GetKind() == wxT_OBJECT ) {