]> git.saurik.com Git - wxWidgets.git/blame - src/common/ctrlcmn.cpp
1. added wxEnhMetaFileXXX classes
[wxWidgets.git] / src / common / ctrlcmn.cpp
CommitLineData
2d61b48d
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: ctrlcmn.cpp
3// Purpose: wxControl common interface
4// Author: Vadim Zeitlin
5// Modified by:
6// Created: 26.07.99
7// RCS-ID: $Id$
8// Copyright: (c) wxWindows team
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
20#ifdef __GNUG__
1b68e0b5 21 #pragma implementation "controlbase.h"
2d61b48d
VZ
22#endif
23
24// For compilers that support precompilation, includes "wx.h".
25#include "wx/wxprec.h"
26
27#ifdef __BORLANDC__
28 #pragma hdrstop
29#endif
30
31#ifndef WX_PRECOMP
32 #include "wx/control.h"
33 #include "wx/log.h"
34#endif
35
36// ============================================================================
37// implementation
38// ============================================================================
39
40bool wxControlBase::CreateControl(wxWindowBase *parent,
41 wxWindowID id,
42 const wxPoint& pos,
43 const wxSize& size,
44 long style,
45 const wxValidator& validator,
46 const wxString& name)
47{
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
50 // Windows
223d09f6 51 wxCHECK_MSG( parent, FALSE, wxT("all controls must have parents") );
2d61b48d
VZ
52
53 if ( !CreateBase(parent, id, pos, size, style, validator, name) )
54 return FALSE;
55
56 parent->AddChild(this);
57
58 return TRUE;
59}
60
61// inherit colour and font settings from the parent window
62void wxControlBase::InheritAttributes()
63{
64 SetBackgroundColour(GetParent()->GetBackgroundColour());
65 SetForegroundColour(GetParent()->GetForegroundColour());
66 SetFont(GetParent()->GetFont());
67}
68
69void wxControlBase::Command(wxCommandEvent& event)
70{
71 (void)ProcessEvent(event);
72}