]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/button.cpp
Fix wxHtmlHelpData::SetTempDir() to behave correctly without trailing slash.
[wxWidgets.git] / src / gtk1 / button.cpp
index c84debc53d2710540c53b85bac7255d1695dd252..a414ecfa4ee1177b4053250731d5409fcc2a4be3 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/gtk1/button.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #if wxUSE_BUTTON
 
-#include "wx/button.h"
+#ifndef WX_PRECOMP
+    #include "wx/button.h"
+#endif
+
 #include "wx/stockitem.h"
 
 #include "wx/gtk1/private.h"
@@ -50,9 +52,9 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
     if (!button->m_hasVMT) return;
     if (g_blockEventsOnDrag) return;
 
-    wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
+    wxCommandEvent event(wxEVT_BUTTON, button->GetId());
     event.SetEventObject(button);
-    button->GetEventHandler()->ProcessEvent(event);
+    button->HandleWindowEvent(event);
 }
 }
 
@@ -91,8 +93,6 @@ gtk_button_style_set_callback( GtkWidget *m_widget, GtkStyle *WXUNUSED(style), w
 // wxButton
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxButton,wxControl)
-
 wxButton::wxButton()
 {
 }
@@ -152,18 +152,17 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 }
 
 
-void wxButton::SetDefault()
+wxWindow *wxButton::SetDefault()
 {
-    wxWindow *parent = GetParent();
-    wxCHECK_RET( parent, _T("button without parent?") );
-
-    parent->SetDefaultItem(this);
+    wxWindow *oldDefault = wxButtonBase::SetDefault();
 
     GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
     gtk_widget_grab_default( m_widget );
 
     // resize for default border
     gtk_button_style_set_callback( m_widget, NULL, this );
+
+    return oldDefault;
 }
 
 /* static */