+ TODO PROPERTIES :
+ bitmap
+*/
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// wxStaticBitmap
+// ---------------------------------------------------------------------------
+
+// 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
+// note that this function will create a new object every time
+// it is called even if the image needs no conversion
+
+#ifndef __WIN16__
+
+static wxGDIImage* ConvertImage( const wxGDIImage& bitmap )
+{
+ bool isIcon = bitmap.IsKindOf( CLASSINFO(wxIcon) );
+
+ if( !isIcon )
+ {
+ wxASSERT_MSG( wxDynamicCast(&bitmap, wxBitmap),
+ _T("not an icon and not a bitmap?") );
+
+ const wxBitmap& bmp = (const wxBitmap&)bitmap;
+ wxMask *mask = bmp.GetMask();
+ if ( mask && mask->GetMaskBitmap() )
+ {
+ wxIcon* icon = new wxIcon;
+ icon->CopyFromBitmap(bmp);
+
+ return icon;
+ }
+
+ return new wxBitmap( bmp );
+ }
+
+ // copying a bitmap is a cheap operation
+ return new wxIcon( (const wxIcon&)bitmap );
+}
+
+#endif
+
+bool wxStaticBitmap::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxGDIImage& bitmap,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style,
+ const wxString& name)
+{
+ if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
+ return FALSE;
+
+ // 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
+ wxGDIImage *image = (wxGDIImage *)NULL;
+ m_isIcon = bitmap.IsKindOf(CLASSINFO(wxIcon));
+
+#ifdef __WIN16__
+ wxASSERT_MSG( !m_isIcon, "Icons are not supported in wxStaticBitmap under WIN16." );
+ image = &bitmap;
+#else // Win32
+ image = ConvertImage( bitmap );
+ m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) );
+#endif // Win16/32
+
+ // create the native control
+ if ( !MSWCreateControl(
+#ifdef __WIN32__
+ _T("STATIC"),
+#else // Win16
+ _T("BUTTON"),
+#endif // Win32/16
+ wxEmptyString, pos, size) )
+ {
+ // control creation failed
+ return FALSE;
+ }
+
+ // no need to delete the new image
+ SetImageNoCopy(image);
+
+ return TRUE;
+}
+
+wxBorder wxStaticBitmap::GetDefaultBorder() const