X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1af991f497a5e95d8f8ab15a4e4a4a4c375928f..fe26d444bbc1d49dd8fe375ca736426f2309a1cd:/src/gtk1/bmpbuttn.cpp diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index 7bfc477e35..691e6912d7 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -105,7 +105,7 @@ static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitma // wxBitmapButton //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton) wxBitmapButton::wxBitmapButton() { @@ -118,13 +118,12 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi 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( wxT("wxBitmapButton creation failed") ); + return FALSE; + } m_bitmap = bitmap; m_disabled = bitmap; @@ -142,6 +141,8 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi 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 ); @@ -189,14 +190,14 @@ void wxBitmapButton::SetDefault() void wxBitmapButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, wxT("invalid button") ); wxControl::SetLabel( label ); } wxString wxBitmapButton::GetLabel() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") ); + wxCHECK_MSG( m_widget != NULL, wxT(""), wxT("invalid button") ); return wxControl::GetLabel(); } @@ -207,7 +208,7 @@ void wxBitmapButton::ApplyWidgetStyle() void wxBitmapButton::SetBitmap() { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, wxT("invalid button") ); wxBitmap the_one; @@ -242,7 +243,7 @@ void wxBitmapButton::SetBitmap() void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, wxT("invalid button") ); if ( ! m_disabled.Ok() ) return; m_disabled = bitmap; @@ -252,7 +253,7 @@ void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, wxT("invalid button") ); if ( ! m_focus.Ok() ) return; m_focus = bitmap; @@ -262,7 +263,7 @@ void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, wxT("invalid button") ); if (!m_bitmap.Ok()) return; m_bitmap = bitmap; @@ -272,7 +273,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, wxT("invalid button") ); if ( ! m_selected.Ok() ) return; m_selected = bitmap; @@ -313,5 +314,5 @@ void wxBitmapButton::EndSelect() m_isSelected = FALSE; SetBitmap(); } +#endif -#endif \ No newline at end of file