]>
git.saurik.com Git - wxWidgets.git/blob - src/common/btncmn.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/btncmn.cpp
3 // Purpose: implementation of wxButtonBase
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
29 #include "wx/button.h"
30 #include "wx/toplevel.h"
33 // ============================================================================
35 // ============================================================================
37 wxWindow
*wxButtonBase::SetDefault()
39 wxTopLevelWindow
* const
40 tlw
= wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow
);
42 wxCHECK_MSG( tlw
, NULL
, _T("button without top level window?") );
44 return tlw
->SetDefaultItem(this);
47 void wxButtonBase::SetBitmapPosition(wxDirection dir
)
49 wxASSERT_MSG( !(dir
& ~wxDIRECTION_MASK
), "non-direction flag used" );
50 wxASSERT_MSG( !!(dir
& wxLEFT
) +
53 !!(dir
& wxBOTTOM
) == 1,
54 "exactly one direction flag must be set" );
56 DoSetBitmapPosition(dir
);
59 #endif // wxUSE_BUTTON