#include <stdio.h>
// ---------------------------------------------------------------------------
-// macors
+// macros
// ---------------------------------------------------------------------------
+wxBEGIN_EVENT_TABLE(wxStaticBitmap, wxStaticBitmapBase)
+ EVT_SIZE(wxStaticBitmap::WXHandleSize)
+wxEND_EVENT_TABLE()
+
// ===========================================================================
// implementation
// ===========================================================================
static wxGDIImage* ConvertImage( const wxGDIImage& bitmap )
{
- bool isIcon = bitmap.IsKindOf( CLASSINFO(wxIcon) );
+ bool isIcon = bitmap.IsKindOf( wxCLASSINFO(wxIcon) );
if( !isIcon )
{
// 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) )
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))
Free();
InvalidateBestSize();
- m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) );
+ m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) );
// the image has already been copied
m_image = image;