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:
44
src/common/btncmn.cpp
Normal file
44
src/common/btncmn.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/common/btncmn.cpp
|
||||
// Purpose: implementation of wxButtonBase
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-04-08
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/button.h"
|
||||
#include "wx/toplevel.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
wxWindow *wxButtonBase::SetDefault()
|
||||
{
|
||||
wxTopLevelWindow * const
|
||||
tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
|
||||
|
||||
wxCHECK_MSG( tlw, NULL, _T("button without top level window?") );
|
||||
|
||||
return tlw->SetDefaultItem(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user