// 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( wxT("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 );
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();
}
void wxBitmapButton::SetBitmap()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, wxT("invalid button") );
wxBitmap the_one;
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;
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;
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;
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;
m_isSelected = FALSE;
SetBitmap();
}
+#endif
-#endif
\ No newline at end of file