]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/button.cpp
many compilation fixes for WinCE using VC8 (it now build, although still doesn't...
[wxWidgets.git] / src / gtk1 / button.cpp
index f84cfc32213da3fcf1d2adc4c2fb6fbddd94d2e7..6d71384052e2ba9125e6569788c95ec7ce375673 100644 (file)
 
 #if wxUSE_BUTTON
 
-#include "wx/button.h"
-
 #ifndef WX_PRECOMP
-    #include "wx/toplevel.h"
+    #include "wx/button.h"
 #endif
 
 #include "wx/stockitem.h"
@@ -157,18 +155,17 @@ bool wxButton::Create(  wxWindow *parent, wxWindowID id, const wxString &label,
 }
 
 
-void wxButton::SetDefault()
+wxWindow *wxButton::SetDefault()
 {
-    wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
-    wxCHECK_RET( tlw, _T("button without top level window?") );
-
-    tlw->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 */