+ wxCHECK_RET( m_widget != NULL, "invalid button" );
+
+ wxControl::SetLabel( label );
+}
+
+wxString wxBitmapButton::GetLabel() const
+{
+ wxCHECK_MSG( m_widget != NULL, "", "invalid button" );
+
+ return wxControl::GetLabel();
+}
+
+void wxBitmapButton::ApplyWidgetStyle()
+{
+}
+
+void wxBitmapButton::SetBitmap()
+{
+ wxCHECK_RET( m_widget != NULL, "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, "invalid button" );
+
+ if ( ! m_disabled.Ok() ) return;
+ m_disabled = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, "invalid button" );
+
+ if ( ! m_focus.Ok() ) return;
+ m_focus = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, "invalid button" );
+
+ if (!m_bitmap.Ok()) return;
+ m_bitmap = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap )
+{
+ wxCHECK_RET( m_widget != NULL, "invalid button" );
+
+ if ( ! m_selected.Ok() ) return;
+ m_selected = bitmap;
+
+ SetBitmap();
+}
+
+void wxBitmapButton::Enable( const bool enable )
+{
+ wxWindow::Enable(enable);
+
+ SetBitmap();
+}
+
+void wxBitmapButton::HasFocus()
+{
+ m_hasFocus = TRUE;
+ SetBitmap();
+}
+
+void wxBitmapButton::NotFocus()
+{
+ m_hasFocus = FALSE;
+ SetBitmap();
+}
+
+void wxBitmapButton::StartSelect()
+{
+ m_isSelected = TRUE;
+ SetBitmap();
+}