Call wxTLW::SetDefaultItem() from wxButtonBase::SetDefault() instead of doing
it in wxButton implementations in (almost) all ports; changed its return type to "wxWindow *" from "void" to accommodate the ports needing the old default item (replaces part of patch 1696563) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12,10 +12,8 @@
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
|
||||
#include "wx/button.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/toplevel.h"
|
||||
#include "wx/button.h"
|
||||
#endif
|
||||
|
||||
#include "wx/stockitem.h"
|
||||
@@ -167,18 +165,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 */
|
||||
|
Reference in New Issue
Block a user