]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/bmpbuttn.cpp
couple of minor bug fixes/enhancements (interface unchanged)
[wxWidgets.git] / src / gtk1 / bmpbuttn.cpp
index 09722663f3393e96876378ae1d6363aa0a2e76fa..4e33f54278948aa48cf32bd1fa7e1626c439d163 100644 (file)
 
 class wxBitmapButton;
 
+//-----------------------------------------------------------------------------
+// data
+//-----------------------------------------------------------------------------
+
+extern bool   g_blockEventsOnDrag;
+
 //-----------------------------------------------------------------------------
 // wxBitmapButton
 //-----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
 
-void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), gpointer data )
+static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
 {
-  wxBitmapButton *button = (wxBitmapButton*)data;
+  if (!button->HasVMT()) return;
+  if (g_blockEventsOnDrag) return;
+  
   wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
   event.SetEventObject(button);
-  button->ProcessEvent(event);
+  button->GetEventHandler()->ProcessEvent(event);
 };
 
 //-----------------------------------------------------------------------------
@@ -42,14 +50,14 @@ wxBitmapButton::wxBitmapButton(void)
 
 wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
       const wxPoint &pos, const wxSize &size, 
-      const long style, const wxString &name )
+      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, 
-      const long style, const wxString &name )
+      long style, const wxString &name )
 {
   m_needParent = TRUE;