From: Paul Cornett Date: Sat, 5 Jul 2008 18:23:01 +0000 (+0000) Subject: mark long-deprecated methods as such, and don't use them in wx code X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bbe28fbb8364c150e9e2dae9bafb05921aa5d63d?ds=sidebyside mark long-deprecated methods as such, and don't use them in wx code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index 586f6c3d71..4246032a5b 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -445,11 +445,11 @@ public: // return true if this is a vertical toolbar, otherwise false bool IsVertical() const; - +#if WXWIN_COMPATIBILITY_2_8 // the old versions of the various methods kept for compatibility // don't use in the new code! // -------------------------------------------------------------- - + wxDEPRECATED_INLINE( wxToolBarToolBase *AddTool(int toolid, const wxBitmap& bitmap, const wxBitmap& bmpDisabled, @@ -457,23 +457,23 @@ public: wxObject *clientData = NULL, const wxString& shortHelpString = wxEmptyString, const wxString& longHelpString = wxEmptyString) - { + , return AddTool(toolid, wxEmptyString, bitmap, bmpDisabled, toggle ? wxITEM_CHECK : wxITEM_NORMAL, shortHelpString, longHelpString, clientData); - } - + ) + wxDEPRECATED_INLINE( wxToolBarToolBase *AddTool(int toolid, const wxBitmap& bitmap, const wxString& shortHelpString = wxEmptyString, const wxString& longHelpString = wxEmptyString) - { + , return AddTool(toolid, wxEmptyString, bitmap, wxNullBitmap, wxITEM_NORMAL, shortHelpString, longHelpString, NULL); - } - + ) + wxDEPRECATED_INLINE( wxToolBarToolBase *AddTool(int toolid, const wxBitmap& bitmap, const wxBitmap& bmpDisabled, @@ -483,12 +483,12 @@ public: wxObject *clientData = NULL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString) - { + , return DoAddTool(toolid, wxEmptyString, bitmap, bmpDisabled, toggle ? wxITEM_CHECK : wxITEM_NORMAL, shortHelp, longHelp, clientData, xPos, yPos); - } - + ) + wxDEPRECATED_INLINE( wxToolBarToolBase *InsertTool(size_t pos, int toolid, const wxBitmap& bitmap, @@ -497,11 +497,12 @@ public: wxObject *clientData = NULL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString) - { + , return InsertTool(pos, toolid, wxEmptyString, bitmap, bmpDisabled, toggle ? wxITEM_CHECK : wxITEM_NORMAL, shortHelp, longHelp, clientData); - } + ) +#endif // WXWIN_COMPATIBILITY_2_8 // event handlers // -------------- diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index 94b224cff4..0028970274 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -665,28 +665,28 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos, wxToolBar* toolBar = CreateToolBar(); - toolBar->AddTool(wxID_OPEN, wxBitmap(open_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Open")); - toolBar->AddTool(wxID_SAVEAS, wxBitmap(save_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Save")); + toolBar->AddTool(wxID_OPEN, wxEmptyString, wxBitmap(open_xpm), _("Open")); + toolBar->AddTool(wxID_SAVEAS, wxEmptyString, wxBitmap(save_xpm), _("Save")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_CUT, wxBitmap(cut_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Cut")); - toolBar->AddTool(wxID_COPY, wxBitmap(copy_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Copy")); - toolBar->AddTool(wxID_PASTE, wxBitmap(paste_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Paste")); + toolBar->AddTool(wxID_CUT, wxEmptyString, wxBitmap(cut_xpm), _("Cut")); + toolBar->AddTool(wxID_COPY, wxEmptyString, wxBitmap(copy_xpm), _("Copy")); + toolBar->AddTool(wxID_PASTE, wxEmptyString, wxBitmap(paste_xpm), _("Paste")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_UNDO, wxBitmap(undo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Undo")); - toolBar->AddTool(wxID_REDO, wxBitmap(redo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Redo")); + toolBar->AddTool(wxID_UNDO, wxEmptyString, wxBitmap(undo_xpm), _("Undo")); + toolBar->AddTool(wxID_REDO, wxEmptyString, wxBitmap(redo_xpm), _("Redo")); toolBar->AddSeparator(); - toolBar->AddTool(ID_FORMAT_BOLD, wxBitmap(bold_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Bold")); - toolBar->AddTool(ID_FORMAT_ITALIC, wxBitmap(italic_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Italic")); - toolBar->AddTool(ID_FORMAT_UNDERLINE, wxBitmap(underline_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Underline")); + toolBar->AddCheckTool(ID_FORMAT_BOLD, wxEmptyString, wxBitmap(bold_xpm), wxNullBitmap, _("Bold")); + toolBar->AddCheckTool(ID_FORMAT_ITALIC, wxEmptyString, wxBitmap(italic_xpm), wxNullBitmap, _("Italic")); + toolBar->AddCheckTool(ID_FORMAT_UNDERLINE, wxEmptyString, wxBitmap(underline_xpm), wxNullBitmap, _("Underline")); toolBar->AddSeparator(); - toolBar->AddTool(ID_FORMAT_ALIGN_LEFT, wxBitmap(alignleft_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Left")); - toolBar->AddTool(ID_FORMAT_ALIGN_CENTRE, wxBitmap(centre_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Centre")); - toolBar->AddTool(ID_FORMAT_ALIGN_RIGHT, wxBitmap(alignright_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Right")); + toolBar->AddCheckTool(ID_FORMAT_ALIGN_LEFT, wxEmptyString, wxBitmap(alignleft_xpm), wxNullBitmap, _("Align Left")); + toolBar->AddCheckTool(ID_FORMAT_ALIGN_CENTRE, wxEmptyString, wxBitmap(centre_xpm), wxNullBitmap, _("Centre")); + toolBar->AddCheckTool(ID_FORMAT_ALIGN_RIGHT, wxEmptyString, wxBitmap(alignright_xpm), wxNullBitmap, _("Align Right")); toolBar->AddSeparator(); - toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxBitmap(indentless_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent Less")); - toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxBitmap(indentmore_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent More")); + toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxEmptyString, wxBitmap(indentless_xpm), _("Indent Less")); + toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxEmptyString, wxBitmap(indentmore_xpm), _("Indent More")); toolBar->AddSeparator(); - toolBar->AddTool(ID_FORMAT_FONT, wxBitmap(font_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Font")); + toolBar->AddTool(ID_FORMAT_FONT, wxEmptyString, wxBitmap(font_xpm), _("Font")); wxRichTextStyleComboCtrl* combo = new wxRichTextStyleComboCtrl(toolBar, ID_RICHTEXT_STYLE_COMBO, wxDefaultPosition, wxSize(200, -1)); toolBar->AddControl(combo); diff --git a/samples/svg/svgtest.cpp b/samples/svg/svgtest.cpp index 1f44b5558e..2d20ab1368 100644 --- a/samples/svg/svgtest.cpp +++ b/samples/svg/svgtest.cpp @@ -312,15 +312,10 @@ void MyFrame::InitToolBar(wxToolBar* toolBar) bitmaps[1] = new wxBitmap( save_xpm ); bitmaps[2] = new wxBitmap( help_xpm ); - int width = 16; - int currentX = 5; - - toolBar->AddTool( MDI_NEW_WINDOW, *(bitmaps[0]), wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("New SVG test window")); - currentX += width + 5; - toolBar->AddTool( MDI_SAVE, *bitmaps[1], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Save test in SVG format")); - currentX += width + 5; + toolBar->AddTool(MDI_NEW_WINDOW, wxEmptyString, *(bitmaps[0]), wxS("New SVG test window")); + toolBar->AddTool(MDI_SAVE, wxEmptyString, *bitmaps[1], wxS("Save test in SVG format")); toolBar->AddSeparator(); - toolBar->AddTool(MDI_ABOUT, *bitmaps[2], wxNullBitmap, false, currentX, wxDefaultCoord, (wxObject *) NULL, wxT("Help")); + toolBar->AddTool(MDI_ABOUT, wxEmptyString, *bitmaps[2], wxS("Help")); toolBar->Realize(); @@ -424,10 +419,10 @@ void MyCanvas::OnDraw(wxDC& dc) dc.SetBrush(*wxCYAN_BRUSH); dc.SetPen(*wxRED_PEN); dc.DrawRectangle(10, 10, 100, 70); - wB = wxBrush (_T("DARK ORCHID"), wxTRANSPARENT); + wB = wxBrush (_T("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT); dc.SetBrush (wB); dc.DrawRoundedRectangle(50, 50, 100, 70, 20); - dc.SetBrush (wxBrush(_T("GOLDENROD"), wxSOLID) ); + dc.SetBrush (wxBrush(_T("GOLDENROD")) ); dc.DrawEllipse(100, 100, 100, 50); points[0].x = 100; points[0].y = 200; @@ -491,7 +486,7 @@ void MyCanvas::OnDraw(wxDC& dc) wP.SetWidth(3); dc.SetPen(wP); //wxTRANSPARENT)); - dc.SetBrush (wxBrush (_T("SALMON"),wxSOLID)) ; + dc.SetBrush (wxBrush (_T("SALMON"))) ; dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0) ; //same end point dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ; @@ -504,7 +499,7 @@ void MyCanvas::OnDraw(wxDC& dc) case 4: dc.DrawCheckMark ( 30,30,25,25); - dc.SetBrush (wxBrush (_T("SALMON"),wxTRANSPARENT)); + dc.SetBrush (wxBrush (_T("SALMON"),wxBRUSHSTYLE_TRANSPARENT)); dc.DrawCheckMark ( 80,50,75,75); dc.DrawRectangle ( 80,50,75,75); #if wxUSE_STATUSBAR diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 7c19a1e957..115a299cdf 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -652,48 +652,28 @@ void wxHtmlHelpWindow::AddToolbarButtons(wxToolBar *toolBar, int style) wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ; - toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Show/hide navigation panel")); - + toolBar->AddTool(wxID_HTML_PANEL, wxEmptyString, wpanelBitmap, _("Show/hide navigation panel")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Go back")); - toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Go forward")); + toolBar->AddTool(wxID_HTML_BACK, wxEmptyString, wbackBitmap, _("Go back")); + toolBar->AddTool(wxID_HTML_FORWARD, wxEmptyString, wforwardBitmap, _("Go forward")); toolBar->AddSeparator(); - - toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Go one level up in document hierarchy")); - toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Previous page")); - toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Next page")); + toolBar->AddTool(wxID_HTML_UPNODE, wxEmptyString, wupnodeBitmap, _("Go one level up in document hierarchy")); + toolBar->AddTool(wxID_HTML_UP, wxEmptyString, wupBitmap, _("Previous page")); + toolBar->AddTool(wxID_HTML_DOWN, wxEmptyString, wdownBitmap, _("Next page")); if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES)) toolBar->AddSeparator(); if (style & wxHF_OPEN_FILES) - toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Open HTML document")); + toolBar->AddTool(wxID_HTML_OPENFILE, wxEmptyString, wopenBitmap, _("Open HTML document")); #if wxUSE_PRINTING_ARCHITECTURE if (style & wxHF_PRINT) - toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Print this page")); + toolBar->AddTool(wxID_HTML_PRINT, wxEmptyString, wprintBitmap, _("Print this page")); #endif toolBar->AddSeparator(); - toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap, - false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, - _("Display options dialog")); + toolBar->AddTool(wxID_HTML_OPTIONS, wxEmptyString, woptionsBitmap, _("Display options dialog")); // Allow application to add custom buttons wxHtmlHelpFrame* parentFrame = wxDynamicCast(GetParent(), wxHtmlHelpFrame);