]> git.saurik.com Git - wxWidgets.git/blame - src/common/btncmn.cpp
Supress SetFocus() warning in wxVListBoxComboPopup
[wxWidgets.git] / src / common / btncmn.cpp
CommitLineData
94aff5ff
VZ
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
28fcfbfe
VZ
26#if wxUSE_BUTTON
27
94aff5ff
VZ
28#ifndef WX_PRECOMP
29 #include "wx/button.h"
30 #include "wx/toplevel.h"
31#endif //WX_PRECOMP
32
33// ============================================================================
34// implementation
35// ============================================================================
36
37wxWindow *wxButtonBase::SetDefault()
38{
39 wxTopLevelWindow * const
40 tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
41
9a83f860 42 wxCHECK_MSG( tlw, NULL, wxT("button without top level window?") );
94aff5ff
VZ
43
44 return tlw->SetDefaultItem(this);
45}
46
233f10bf
VZ
47void wxButtonBase::SetBitmapPosition(wxDirection dir)
48{
49 wxASSERT_MSG( !(dir & ~wxDIRECTION_MASK), "non-direction flag used" );
50 wxASSERT_MSG( !!(dir & wxLEFT) +
51 !!(dir & wxRIGHT) +
52 !!(dir & wxTOP) +
53 !!(dir & wxBOTTOM) == 1,
54 "exactly one direction flag must be set" );
55
56 DoSetBitmapPosition(dir);
57
58}
28fcfbfe 59#endif // wxUSE_BUTTON