From be696ed8a4572d2ac8ecf6605ec4bd0b9f837c99 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 13 May 2018 02:15:30 +0200 Subject: [PATCH] Reuse base class icon-related functions in wxAuiMDIChildFrame Don't define GetIcon(), GetIcons() and SetIcon() at all as the base class already implements them and just keep SetIcons(), which can now be marked as overridden as it's inherited from wxTopLevelWindow via wxTDIChildFrame. --- include/wx/aui/tabmdi.h | 8 +------- src/aui/tabmdi.cpp | 22 ++-------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/include/wx/aui/tabmdi.h b/include/wx/aui/tabmdi.h index e9707853fe..e260109ef0 100644 --- a/include/wx/aui/tabmdi.h +++ b/include/wx/aui/tabmdi.h @@ -144,11 +144,7 @@ public: virtual void SetTitle(const wxString& title); - virtual void SetIcons(const wxIconBundle& icons); - virtual const wxIconBundle& GetIcons() const; - - virtual void SetIcon(const wxIcon& icon); - virtual const wxIcon& GetIcon() const; + virtual void SetIcons(const wxIconBundle& icons) wxOVERRIDE; virtual void Activate(); virtual bool Destroy() wxOVERRIDE; @@ -171,8 +167,6 @@ public: protected: wxAuiMDIParentFrame* m_pMDIParentFrame; - wxIcon m_icon; - wxIconBundle m_iconBundle; bool m_activateOnCreate; #if wxUSE_MENUS diff --git a/src/aui/tabmdi.cpp b/src/aui/tabmdi.cpp index 0ac1316565..fc55a27e81 100644 --- a/src/aui/tabmdi.cpp +++ b/src/aui/tabmdi.cpp @@ -606,25 +606,13 @@ void wxAuiMDIChildFrame::SetTitle(const wxString& title) void wxAuiMDIChildFrame::SetIcons(const wxIconBundle& icons) { - // get icon with the system icon size - SetIcon(icons.GetIcon(-1)); - m_iconBundle = icons; -} + wxTDIChildFrame::SetIcons(icons); -const wxIconBundle& wxAuiMDIChildFrame::GetIcons() const -{ - return m_iconBundle; -} - -void wxAuiMDIChildFrame::SetIcon(const wxIcon& icon) -{ wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame(); wxASSERT_MSG(pParentFrame, wxT("Missing MDI Parent Frame")); - m_icon = icon; - wxBitmap bmp; - bmp.CopyFromIcon(m_icon); + bmp.CopyFromIcon(icons.GetIcon(-1)); wxAuiMDIClientWindow* pClientWindow = pParentFrame->GetClientWindow(); if (pClientWindow != NULL) @@ -638,12 +626,6 @@ void wxAuiMDIChildFrame::SetIcon(const wxIcon& icon) } } -const wxIcon& wxAuiMDIChildFrame::GetIcon() const -{ - return m_icon; -} - - void wxAuiMDIChildFrame::Activate() { wxAuiMDIParentFrame* pParentFrame = GetMDIParentFrame();