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
This commit is contained in:
Maarten Bent
2018-09-21 20:16:02 +02:00
committed by Vadim Zeitlin
parent 455a45f5a8
commit a3eeb4d0be
3 changed files with 19 additions and 3 deletions

View File

@@ -129,15 +129,19 @@ public:
const wxRect& rect, const wxRect& rect,
wxAuiPaneInfo& pane) wxOVERRIDE; wxAuiPaneInfo& pane) wxOVERRIDE;
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_MSG("This is not intended for the public API")
void DrawIcon(wxDC& dc, void DrawIcon(wxDC& dc,
wxWindow *window,
const wxRect& rect, const wxRect& rect,
wxAuiPaneInfo& pane); wxAuiPaneInfo& pane);
#endif
protected: protected:
void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active); void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
void DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane);
void InitBitmaps(); void InitBitmaps();
protected: protected:

View File

@@ -337,8 +337,10 @@ public:
const wxRect& rect, const wxRect& rect,
wxAuiPaneInfo& pane); wxAuiPaneInfo& pane);
/**
@deprecated Not intended for the public API.
*/
void DrawIcon(wxDC& dc, void DrawIcon(wxDC& dc,
wxWindow *window,
const wxRect& rect, const wxRect& rect,
wxAuiPaneInfo& pane); wxAuiPaneInfo& pane);
@@ -346,6 +348,8 @@ protected:
void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active); void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
void DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane);
void InitBitmaps(); void InitBitmaps();
protected: protected:

View File

@@ -632,12 +632,20 @@ void wxAuiDefaultDockArt::DrawCaption(wxDC& dc,
dc.DestroyClippingRegion(); dc.DestroyClippingRegion();
} }
#if WXWIN_COMPATIBILITY_3_0
void wxAuiDefaultDockArt::DrawIcon(wxDC& dc, const wxRect& rect, wxAuiPaneInfo& pane)
{
DrawIcon(dc, NULL, rect, pane);
}
#endif
void void
wxAuiDefaultDockArt::DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane) wxAuiDefaultDockArt::DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wxAuiPaneInfo& pane)
{ {
// Draw the icon centered vertically // Draw the icon centered vertically
int xOffset = window ? window->FromDIP(2) : 2;
dc.DrawBitmap(pane.icon, 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); true);
} }