]>
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 "controlbase.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
,
46 # if defined(__VISAGECPP__)
47 const wxValidator
* validator
,
49 const wxValidator
& validator
,
54 // even if it's possible to create controls without parents in some port,
55 // it should surely be discouraged because it doesn't work at all under
57 wxCHECK_MSG( parent
, FALSE
, wxT("all controls must have parents") );
59 if ( !CreateBase(parent
, id
, pos
, size
, style
, validator
, name
) )
62 parent
->AddChild(this);
67 // inherit colour and font settings from the parent window
68 void wxControlBase::InheritAttributes()
70 SetBackgroundColour(GetParent()->GetBackgroundColour());
71 SetForegroundColour(GetParent()->GetForegroundColour());
72 SetFont(GetParent()->GetFont());
75 void wxControlBase::Command(wxCommandEvent
& event
)
77 (void)ProcessEvent(event
);