X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae4375b878f28ba89fd1814740c9293ba367c230..cdbd62d6ff290fd58acd1bc5574dfc79db3a6f70:/src/msw/statbmp.cpp diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index a41b7e17aa..496df705a8 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -42,9 +41,13 @@ #include // --------------------------------------------------------------------------- -// macors +// macros // --------------------------------------------------------------------------- +wxBEGIN_EVENT_TABLE(wxStaticBitmap, wxStaticBitmapBase) + EVT_SIZE(wxStaticBitmap::WXHandleSize) +wxEND_EVENT_TABLE() + // =========================================================================== // implementation // =========================================================================== @@ -61,7 +64,7 @@ static wxGDIImage* ConvertImage( const wxGDIImage& bitmap ) { - bool isIcon = bitmap.IsKindOf( CLASSINFO(wxIcon) ); + bool isIcon = bitmap.IsKindOf( wxCLASSINFO(wxIcon) ); if( !isIcon ) { @@ -99,10 +102,10 @@ bool wxStaticBitmap::Create(wxWindow *parent, // we may have either bitmap or icon: if a bitmap with mask is passed, we // will transform it to an icon ourselves because otherwise the mask will // be ignored by Windows - m_isIcon = bitmap.IsKindOf(CLASSINFO(wxIcon)); + m_isIcon = bitmap.IsKindOf(wxCLASSINFO(wxIcon)); wxGDIImage *image = ConvertImage( bitmap ); - m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); + m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) ); // create the native control if ( !MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size) ) @@ -206,6 +209,15 @@ wxSize wxStaticBitmap::DoGetBestClientSize() const return size; } +void wxStaticBitmap::WXHandleSize(wxSizeEvent& event) +{ + // Invalidate everything when our size changes as the image position (it's + // drawn centred in the window client area) changes. + Refresh(); + + event.Skip(); +} + #ifndef __WXWINCE__ void wxStaticBitmap::DoPaintManually(wxPaintEvent& WXUNUSED(event)) @@ -243,7 +255,7 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image) Free(); InvalidateBestSize(); - m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); + m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) ); // the image has already been copied m_image = image;