From eb0fc45d9254d0bc84a45825825f6e4b430fa0d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 May 2019 22:24:07 +0200 Subject: [PATCH] Add a comment explaining why m_isIcon needs to be set early No changes, just explain why we can't simply let SetImageNoCopy() set m_isIcon to the correct value and need to do it here instead. --- src/msw/statbmp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index faeb3855df..f19dc32f81 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -105,6 +105,11 @@ bool wxStaticBitmap::Create(wxWindow *parent, // will transform it to an icon ourselves because otherwise the mask will // be ignored by Windows wxGDIImage *image = ConvertImage( bitmap ); + + // Note that m_isIcon must be set before calling MSWCreateControl() so that + // it creates the control with the correct style, as returned by + // MSWGetStyle(), which uses m_isIcon to determine whether to use SS_ICON + // or SS_BITMAP. m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) ); // create the native control