+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+
+ wxControl::SetLabel( label );
+}
+
+wxString wxBitmapButton::GetLabel() const
+{
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") );
+
+ return wxControl::GetLabel();
+}
+
+void wxBitmapButton::ApplyWidgetStyle()
+{
+}
+
+void wxBitmapButton::SetBitmap()
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+
+ wxBitmap the_one;
+
+ if (!m_isEnabled)
+ the_one = m_disabled;
+ else
+ {
+ if (m_isSelected)
+ {
+ the_one = m_selected;
+ }
+ else
+ {
+ if (m_hasFocus)
+ the_one = m_focus;
+ else
+ the_one = m_bitmap;
+ }
+ }
+
+ if (!the_one.Ok()) the_one = m_bitmap;
+ if (!the_one.Ok()) return;
+
+ GtkButton *bin = GTK_BUTTON( m_widget );
+ GtkPixmap *g_pixmap = GTK_PIXMAP( bin->child );
+
+ GdkBitmap *mask = (GdkBitmap *) NULL;
+ if (the_one.GetMask()) mask = the_one.GetMask()->GetBitmap();
+
+ gtk_pixmap_set( g_pixmap, the_one.GetPixmap(), mask );
+}
+
+void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+
+ if ( ! m_disabled.Ok() ) return;
+ m_disabled = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+
+ if ( ! m_focus.Ok() ) return;
+ m_focus = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+
+ if (!m_bitmap.Ok()) return;
+ m_bitmap = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+
+ if ( ! m_selected.Ok() ) return;
+ m_selected = bitmap;
+
+ SetBitmap();
+}
+
+bool wxBitmapButton::Enable( bool enable )
+{
+ if ( !wxWindow::Enable(enable) )
+ return FALSE;
+
+ SetBitmap();
+
+ return TRUE;
+}
+
+void wxBitmapButton::HasFocus()
+{
+ m_hasFocus = TRUE;
+ SetBitmap();
+}