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.
This commit is contained in:
Vadim Zeitlin 2019-05-16 22:24:07 +02:00
parent f69c3c203e
commit eb0fc45d92

View File

@ -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