// wxBitmapButton
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
wxBitmapButton::wxBitmapButton()
{
m_needParent = TRUE;
m_acceptsFocus = TRUE;
- wxSize newSize = size;
-
- PreCreation( parent, id, pos, newSize, style, name );
-
-#if wxUSE_VALIDATORS
- SetValidator( validator );
-#endif
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, validator, name ))
+ {
+ wxFAIL_MSG( _T("wxBitmapButton creation failed") );
+ return FALSE;
+ }
m_bitmap = bitmap;
m_disabled = bitmap;
if (m_bitmap.Ok())
{
+ wxSize newSize = size;
+
GdkBitmap *mask = (GdkBitmap *) NULL;
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );