replace wxDocument::GetPrintableName(wxString&) and wxDocManager::MakeDefaultName...
[wxWidgets.git] / src / common / btncmn.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/btncmn.cpp
3 // Purpose: implementation of wxButtonBase
4 // Author: Vadim Zeitlin
5 // Created: 2007-04-08
6 // RCS-ID: $Id$
7 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 // ============================================================================
12 // declarations
13 // ============================================================================
14
15 // ----------------------------------------------------------------------------
16 // headers
17 // ----------------------------------------------------------------------------
18
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
21
22 #ifdef __BORLANDC__
23 #pragma hdrstop
24 #endif
25
26 #ifndef WX_PRECOMP
27 #include "wx/button.h"
28 #include "wx/toplevel.h"
29 #endif //WX_PRECOMP
30
31 // ============================================================================
32 // implementation
33 // ============================================================================
34
35 wxWindow *wxButtonBase::SetDefault()
36 {
37 wxTopLevelWindow * const
38 tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
39
40 wxCHECK_MSG( tlw, NULL, _T("button without top level window?") );
41
42 return tlw->SetDefaultItem(this);
43 }
44