wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event);
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event);
}
bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
}
bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxBitmapButton creation failed") );
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxBitmapButton creation failed") );
GdkBitmap *mask = (GdkBitmap *) NULL;
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );
GdkBitmap *mask = (GdkBitmap *) NULL;
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
GtkWidget *pixmap = gtk_pixmap_new( m_bitmap.GetPixmap(), mask );
gtk_widget_show( pixmap );
gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
gtk_widget_show( pixmap );
gtk_container_add( GTK_CONTAINER(m_widget), pixmap );
int border = 10;
if (style & wxNO_BORDER) border = 4;
if (newSize.x == -1) newSize.x = m_bitmap.GetWidth()+border;
if (newSize.y == -1) newSize.y = m_bitmap.GetHeight()+border;
SetSize( newSize.x, newSize.y );
}
int border = 10;
if (style & wxNO_BORDER) border = 4;
if (newSize.x == -1) newSize.x = m_bitmap.GetWidth()+border;
if (newSize.y == -1) newSize.y = m_bitmap.GetHeight()+border;
SetSize( newSize.x, newSize.y );
}
void wxBitmapButton::SetDefault()
{
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
gtk_widget_grab_default( m_widget );
void wxBitmapButton::SetDefault()
{
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
gtk_widget_grab_default( m_widget );
SetSize( m_x, m_y, m_width, m_height );
}
SetSize( m_x, m_y, m_width, m_height );
}