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
This commit is contained in:
Paul Cornett 2008-07-05 18:23:01 +00:00
parent 0d65494402
commit bbe28fbb83
4 changed files with 46 additions and 70 deletions

View File

@ -445,11 +445,11 @@ public:
// return true if this is a vertical toolbar, otherwise false // return true if this is a vertical toolbar, otherwise false
bool IsVertical() const; bool IsVertical() const;
#if WXWIN_COMPATIBILITY_2_8
// the old versions of the various methods kept for compatibility // the old versions of the various methods kept for compatibility
// don't use in the new code! // don't use in the new code!
// -------------------------------------------------------------- // --------------------------------------------------------------
wxDEPRECATED_INLINE(
wxToolBarToolBase *AddTool(int toolid, wxToolBarToolBase *AddTool(int toolid,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled, const wxBitmap& bmpDisabled,
@ -457,23 +457,23 @@ public:
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelpString = wxEmptyString, const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString) const wxString& longHelpString = wxEmptyString)
{ ,
return AddTool(toolid, wxEmptyString, return AddTool(toolid, wxEmptyString,
bitmap, bmpDisabled, bitmap, bmpDisabled,
toggle ? wxITEM_CHECK : wxITEM_NORMAL, toggle ? wxITEM_CHECK : wxITEM_NORMAL,
shortHelpString, longHelpString, clientData); shortHelpString, longHelpString, clientData);
} )
wxDEPRECATED_INLINE(
wxToolBarToolBase *AddTool(int toolid, wxToolBarToolBase *AddTool(int toolid,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxString& shortHelpString = wxEmptyString, const wxString& shortHelpString = wxEmptyString,
const wxString& longHelpString = wxEmptyString) const wxString& longHelpString = wxEmptyString)
{ ,
return AddTool(toolid, wxEmptyString, return AddTool(toolid, wxEmptyString,
bitmap, wxNullBitmap, wxITEM_NORMAL, bitmap, wxNullBitmap, wxITEM_NORMAL,
shortHelpString, longHelpString, NULL); shortHelpString, longHelpString, NULL);
} )
wxDEPRECATED_INLINE(
wxToolBarToolBase *AddTool(int toolid, wxToolBarToolBase *AddTool(int toolid,
const wxBitmap& bitmap, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled, const wxBitmap& bmpDisabled,
@ -483,12 +483,12 @@ public:
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString) const wxString& longHelp = wxEmptyString)
{ ,
return DoAddTool(toolid, wxEmptyString, bitmap, bmpDisabled, return DoAddTool(toolid, wxEmptyString, bitmap, bmpDisabled,
toggle ? wxITEM_CHECK : wxITEM_NORMAL, toggle ? wxITEM_CHECK : wxITEM_NORMAL,
shortHelp, longHelp, clientData, xPos, yPos); shortHelp, longHelp, clientData, xPos, yPos);
} )
wxDEPRECATED_INLINE(
wxToolBarToolBase *InsertTool(size_t pos, wxToolBarToolBase *InsertTool(size_t pos,
int toolid, int toolid,
const wxBitmap& bitmap, const wxBitmap& bitmap,
@ -497,11 +497,12 @@ public:
wxObject *clientData = NULL, wxObject *clientData = NULL,
const wxString& shortHelp = wxEmptyString, const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString) const wxString& longHelp = wxEmptyString)
{ ,
return InsertTool(pos, toolid, wxEmptyString, bitmap, bmpDisabled, return InsertTool(pos, toolid, wxEmptyString, bitmap, bmpDisabled,
toggle ? wxITEM_CHECK : wxITEM_NORMAL, toggle ? wxITEM_CHECK : wxITEM_NORMAL,
shortHelp, longHelp, clientData); shortHelp, longHelp, clientData);
} )
#endif // WXWIN_COMPATIBILITY_2_8
// event handlers // event handlers
// -------------- // --------------

View File

@ -665,28 +665,28 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos,
wxToolBar* toolBar = CreateToolBar(); wxToolBar* toolBar = CreateToolBar();
toolBar->AddTool(wxID_OPEN, wxBitmap(open_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Open")); toolBar->AddTool(wxID_OPEN, wxEmptyString, wxBitmap(open_xpm), _("Open"));
toolBar->AddTool(wxID_SAVEAS, wxBitmap(save_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Save")); toolBar->AddTool(wxID_SAVEAS, wxEmptyString, wxBitmap(save_xpm), _("Save"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_CUT, wxBitmap(cut_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Cut")); toolBar->AddTool(wxID_CUT, wxEmptyString, wxBitmap(cut_xpm), _("Cut"));
toolBar->AddTool(wxID_COPY, wxBitmap(copy_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Copy")); toolBar->AddTool(wxID_COPY, wxEmptyString, wxBitmap(copy_xpm), _("Copy"));
toolBar->AddTool(wxID_PASTE, wxBitmap(paste_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Paste")); toolBar->AddTool(wxID_PASTE, wxEmptyString, wxBitmap(paste_xpm), _("Paste"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_UNDO, wxBitmap(undo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Undo")); toolBar->AddTool(wxID_UNDO, wxEmptyString, wxBitmap(undo_xpm), _("Undo"));
toolBar->AddTool(wxID_REDO, wxBitmap(redo_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Redo")); toolBar->AddTool(wxID_REDO, wxEmptyString, wxBitmap(redo_xpm), _("Redo"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_BOLD, wxBitmap(bold_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Bold")); toolBar->AddCheckTool(ID_FORMAT_BOLD, wxEmptyString, wxBitmap(bold_xpm), wxNullBitmap, _("Bold"));
toolBar->AddTool(ID_FORMAT_ITALIC, wxBitmap(italic_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Italic")); toolBar->AddCheckTool(ID_FORMAT_ITALIC, wxEmptyString, wxBitmap(italic_xpm), wxNullBitmap, _("Italic"));
toolBar->AddTool(ID_FORMAT_UNDERLINE, wxBitmap(underline_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Underline")); toolBar->AddCheckTool(ID_FORMAT_UNDERLINE, wxEmptyString, wxBitmap(underline_xpm), wxNullBitmap, _("Underline"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_ALIGN_LEFT, wxBitmap(alignleft_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Left")); toolBar->AddCheckTool(ID_FORMAT_ALIGN_LEFT, wxEmptyString, wxBitmap(alignleft_xpm), wxNullBitmap, _("Align Left"));
toolBar->AddTool(ID_FORMAT_ALIGN_CENTRE, wxBitmap(centre_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Centre")); toolBar->AddCheckTool(ID_FORMAT_ALIGN_CENTRE, wxEmptyString, wxBitmap(centre_xpm), wxNullBitmap, _("Centre"));
toolBar->AddTool(ID_FORMAT_ALIGN_RIGHT, wxBitmap(alignright_xpm), wxNullBitmap, true, -1, -1, (wxObject *) NULL, _("Align Right")); toolBar->AddCheckTool(ID_FORMAT_ALIGN_RIGHT, wxEmptyString, wxBitmap(alignright_xpm), wxNullBitmap, _("Align Right"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxBitmap(indentless_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent Less")); toolBar->AddTool(ID_FORMAT_INDENT_LESS, wxEmptyString, wxBitmap(indentless_xpm), _("Indent Less"));
toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxBitmap(indentmore_xpm), wxNullBitmap, false, -1, -1, (wxObject *) NULL, _("Indent More")); toolBar->AddTool(ID_FORMAT_INDENT_MORE, wxEmptyString, wxBitmap(indentmore_xpm), _("Indent More"));
toolBar->AddSeparator(); 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)); wxRichTextStyleComboCtrl* combo = new wxRichTextStyleComboCtrl(toolBar, ID_RICHTEXT_STYLE_COMBO, wxDefaultPosition, wxSize(200, -1));
toolBar->AddControl(combo); toolBar->AddControl(combo);

View File

@ -312,15 +312,10 @@ void MyFrame::InitToolBar(wxToolBar* toolBar)
bitmaps[1] = new wxBitmap( save_xpm ); bitmaps[1] = new wxBitmap( save_xpm );
bitmaps[2] = new wxBitmap( help_xpm ); bitmaps[2] = new wxBitmap( help_xpm );
int width = 16; toolBar->AddTool(MDI_NEW_WINDOW, wxEmptyString, *(bitmaps[0]), wxS("New SVG test window"));
int currentX = 5; toolBar->AddTool(MDI_SAVE, wxEmptyString, *bitmaps[1], wxS("Save test in SVG format"));
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->AddSeparator(); 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(); toolBar->Realize();
@ -424,10 +419,10 @@ void MyCanvas::OnDraw(wxDC& dc)
dc.SetBrush(*wxCYAN_BRUSH); dc.SetBrush(*wxCYAN_BRUSH);
dc.SetPen(*wxRED_PEN); dc.SetPen(*wxRED_PEN);
dc.DrawRectangle(10, 10, 100, 70); dc.DrawRectangle(10, 10, 100, 70);
wB = wxBrush (_T("DARK ORCHID"), wxTRANSPARENT); wB = wxBrush (_T("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT);
dc.SetBrush (wB); dc.SetBrush (wB);
dc.DrawRoundedRectangle(50, 50, 100, 70, 20); dc.DrawRoundedRectangle(50, 50, 100, 70, 20);
dc.SetBrush (wxBrush(_T("GOLDENROD"), wxSOLID) ); dc.SetBrush (wxBrush(_T("GOLDENROD")) );
dc.DrawEllipse(100, 100, 100, 50); dc.DrawEllipse(100, 100, 100, 50);
points[0].x = 100; points[0].y = 200; points[0].x = 100; points[0].y = 200;
@ -491,7 +486,7 @@ void MyCanvas::OnDraw(wxDC& dc)
wP.SetWidth(3); wP.SetWidth(3);
dc.SetPen(wP); dc.SetPen(wP);
//wxTRANSPARENT)); //wxTRANSPARENT));
dc.SetBrush (wxBrush (_T("SALMON"),wxSOLID)) ; dc.SetBrush (wxBrush (_T("SALMON"))) ;
dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0) ; dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0) ;
//same end point //same end point
dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ; dc.DrawEllipticArc(300, 50,200,100,90.0,145.0) ;
@ -504,7 +499,7 @@ void MyCanvas::OnDraw(wxDC& dc)
case 4: case 4:
dc.DrawCheckMark ( 30,30,25,25); 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.DrawCheckMark ( 80,50,75,75);
dc.DrawRectangle ( 80,50,75,75); dc.DrawRectangle ( 80,50,75,75);
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR

View File

@ -652,48 +652,28 @@ void wxHtmlHelpWindow::AddToolbarButtons(wxToolBar *toolBar, int style)
wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ; wxT("One or more HTML help frame toolbar bitmap could not be loaded.")) ;
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_PANEL, wxEmptyString, wpanelBitmap, _("Show/hide navigation panel"));
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Show/hide navigation panel"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_BACK, wxEmptyString, wbackBitmap, _("Go back"));
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, toolBar->AddTool(wxID_HTML_FORWARD, wxEmptyString, wforwardBitmap, _("Go forward"));
_("Go back"));
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go forward"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_UPNODE, wxEmptyString, wupnodeBitmap, _("Go one level up in document hierarchy"));
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_UP, wxEmptyString, wupBitmap, _("Previous page"));
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, toolBar->AddTool(wxID_HTML_DOWN, wxEmptyString, wdownBitmap, _("Next page"));
_("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"));
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES)) if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
toolBar->AddSeparator(); toolBar->AddSeparator();
if (style & wxHF_OPEN_FILES) if (style & wxHF_OPEN_FILES)
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_OPENFILE, wxEmptyString, wopenBitmap, _("Open HTML document"));
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Open HTML document"));
#if wxUSE_PRINTING_ARCHITECTURE #if wxUSE_PRINTING_ARCHITECTURE
if (style & wxHF_PRINT) if (style & wxHF_PRINT)
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_PRINT, wxEmptyString, wprintBitmap, _("Print this page"));
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Print this page"));
#endif #endif
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_OPTIONS, wxEmptyString, woptionsBitmap, _("Display options dialog"));
false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Display options dialog"));
// Allow application to add custom buttons // Allow application to add custom buttons
wxHtmlHelpFrame* parentFrame = wxDynamicCast(GetParent(), wxHtmlHelpFrame); wxHtmlHelpFrame* parentFrame = wxDynamicCast(GetParent(), wxHtmlHelpFrame);