X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47908e25f992135fbc8c9573870784c62654e9e9..64a1451536e1917c240a8377c7672ea155e7681d:/src/gtk/bmpbuttn.cpp diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index f1a0aa1a46..102ec21dc5 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -20,35 +20,37 @@ class wxBitmapButton; +//----------------------------------------------------------------------------- +// data +//----------------------------------------------------------------------------- + +extern bool g_blockEventsOnDrag; + //----------------------------------------------------------------------------- // wxBitmapButton //----------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl) -void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) +static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button ) { + if (!button->HasVMT()) return; + if (g_blockEventsOnDrag) return; + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); button->GetEventHandler()->ProcessEvent(event); -}; +} //----------------------------------------------------------------------------- wxBitmapButton::wxBitmapButton(void) { -}; - -wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap, - const wxPoint &pos, const wxSize &size, - long style, const wxString &name ) -{ - Create( parent, id, bitmap, pos, size, style, name ); -}; +} bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap, const wxPoint &pos, const wxSize &size, - long style, const wxString &name ) + long style, const wxValidator& validator, const wxString &name ) { m_needParent = TRUE; @@ -56,6 +58,8 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &b PreCreation( parent, id, pos, newSize, style, name ); + SetValidator( validator ); + m_bitmap = bitmap; m_label = ""; @@ -69,7 +73,7 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &b gtk_widget_show( pixmap ); gtk_container_add( GTK_CONTAINER(m_widget), pixmap ); - }; + } if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10; if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10; @@ -83,18 +87,19 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &b Show( TRUE ); return TRUE; -}; +} void wxBitmapButton::SetDefault(void) { -}; + gtk_widget_grab_default( m_widget ); +} void wxBitmapButton::SetLabel( const wxString &label ) { wxControl::SetLabel( label ); -}; +} wxString wxBitmapButton::GetLabel(void) const { return wxControl::GetLabel(); -}; +}