From 907f6da047b098bf9d80b8bb4dcf6fb01fa674c5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 10 Nov 2021 23:28:19 +0000 Subject: [PATCH] Make wxWithImages::GetUpdatedImageListFor() public It should be possible to call this function on wxWithImages objects contained in derived classes too. This commit is best viewed with --color-moved git option. --- include/wx/withimages.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/include/wx/withimages.h b/include/wx/withimages.h index a93ee65be3..d8a60ac94a 100644 --- a/include/wx/withimages.h +++ b/include/wx/withimages.h @@ -102,25 +102,6 @@ public: // Get pointer (may be NULL) to the associated image list. wxImageList* GetImageList() const { return m_imageList; } -protected: - // This function is called when the images associated with the control - // change, due to either SetImages() or SetImageList() being called. - // - // It ought to be pure virtual, but isn't because there could be existing - // application code inheriting from this class and not overriding it - // (because this function hadn't existed when this code was written). - virtual void OnImagesChanged() { } - - // This function can be used as event handle for wxEVT_DPI_CHANGED event - // and simply calls OnImagesChanged() to refresh the images when it happens. - void WXHandleDPIChanged(wxDPIChangedEvent& event) - { - if ( HasImages() ) - OnImagesChanged(); - - event.Skip(); - } - // This helper function can be used from OnImagesChanged() if the derived // class actually needs to use wxImageList: it ensures that m_imageList is // updated from m_images, if the latter is not empty, using the images of @@ -141,6 +122,25 @@ protected: return m_imageList; } +protected: + // This function is called when the images associated with the control + // change, due to either SetImages() or SetImageList() being called. + // + // It ought to be pure virtual, but isn't because there could be existing + // application code inheriting from this class and not overriding it + // (because this function hadn't existed when this code was written). + virtual void OnImagesChanged() { } + + // This function can be used as event handle for wxEVT_DPI_CHANGED event + // and simply calls OnImagesChanged() to refresh the images when it happens. + void WXHandleDPIChanged(wxDPIChangedEvent& event) + { + if ( HasImages() ) + OnImagesChanged(); + + event.Skip(); + } + // Return true if we have a valid image list. bool HasImageList() const { return m_imageList != NULL; }