From a3eeb4d0be2d764e38ffcf79ea64635ff197a316 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Fri, 21 Sep 2018 20:16:02 +0200 Subject: [PATCH] Revert wxAuiDefaultDockArt::DrawIcon API change Mark the function as deprecated. It should not be part of the public API. It cannot be overridden and manually calling it has no lasting effect because DrawCaption calls it as well. Closes https://github.com/wxWidgets/wxWidgets/pull/943 --- include/wx/aui/dockart.h | 6 +++++- interface/wx/aui/dockart.h | 6 +++++- src/aui/dockart.cpp | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/wx/aui/dockart.h b/include/wx/aui/dockart.h index 89f2b63821..48ee31bc25 100644 --- a/include/wx/aui/dockart.h +++ b/include/wx/aui/dockart.h @@ -129,15 +129,19 @@ public: const wxRect& rect, wxAuiPaneInfo& pane) wxOVERRIDE; +#if WXWIN_COMPATIBILITY_3_0 + wxDEPRECATED_MSG("This is not intended for the public API") void DrawIcon(wxDC& dc, - wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane); +#endif protected: void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active); + void DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane); + void InitBitmaps(); protected: diff --git a/interface/wx/aui/dockart.h b/interface/wx/aui/dockart.h index 6895880153..dca375c5a7 100644 --- a/interface/wx/aui/dockart.h +++ b/interface/wx/aui/dockart.h @@ -337,8 +337,10 @@ public: const wxRect& rect, wxAuiPaneInfo& pane); + /** + @deprecated Not intended for the public API. + */ void DrawIcon(wxDC& dc, - wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane); @@ -346,6 +348,8 @@ protected: void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active); + void DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane); + void InitBitmaps(); protected: diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index a08d376661..870f5c2d68 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -632,12 +632,20 @@ void wxAuiDefaultDockArt::DrawCaption(wxDC& dc, dc.DestroyClippingRegion(); } +#if WXWIN_COMPATIBILITY_3_0 +void wxAuiDefaultDockArt::DrawIcon(wxDC& dc, const wxRect& rect, wxAuiPaneInfo& pane) +{ + DrawIcon(dc, NULL, rect, pane); +} +#endif + void wxAuiDefaultDockArt::DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane) { // Draw the icon centered vertically + int xOffset = window ? window->FromDIP(2) : 2; dc.DrawBitmap(pane.icon, - rect.x+window->FromDIP(2), rect.y+(rect.height-pane.icon.GetScaledHeight())/2, + rect.x+xOffset, rect.y+(rect.height-pane.icon.GetScaledHeight())/2, true); }