]>
git.saurik.com Git - wxWidgets.git/blob - src/common/ctrlcmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxControl common interface
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "ctrlcmn.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/control.h"
36 // ============================================================================
38 // ============================================================================
40 bool wxControlBase::CreateControl(wxWindowBase
*parent
,
45 const wxValidator
& validator
,
48 // even if it's possible to create controls without parents in some port,
49 // it should surely be discouraged because it doesn't work at all under
51 wxCHECK_MSG( parent
, FALSE
, _T("all controls must have parents") );
53 if ( !CreateBase(parent
, id
, pos
, size
, style
, validator
, name
) )
56 parent
->AddChild(this);
61 // inherit colour and font settings from the parent window
62 void wxControlBase::InheritAttributes()
64 SetBackgroundColour(GetParent()->GetBackgroundColour());
65 SetForegroundColour(GetParent()->GetForegroundColour());
66 SetFont(GetParent()->GetFont());
69 void wxControlBase::Command(wxCommandEvent
& event
)
71 (void)ProcessEvent(event
);