]> git.saurik.com Git - wxWidgets.git/blame - include/wx/control.h
even more wxDateTime work (completely broken for now, but support for the
[wxWidgets.git] / include / wx / control.h
CommitLineData
8d99be5f
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/control.h
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
34138703
JS
12#ifndef _WX_CONTROL_H_BASE_
13#define _WX_CONTROL_H_BASE_
c801d85f 14
8d99be5f
VZ
15// ----------------------------------------------------------------------------
16// headers
17// ----------------------------------------------------------------------------
18
19#ifdef __GNUG__
1b68e0b5 20 #pragma interface "controlbase.h"
8d99be5f
VZ
21#endif
22
23#include "wx/window.h" // base class
24
25// ----------------------------------------------------------------------------
26// wxControl is the base class for all controls
27// ----------------------------------------------------------------------------
28
29class WXDLLEXPORT wxControlBase : public wxWindow
30{
31public:
32 // simulates the event of given type (i.e. wxButton::Command() is just as
33 // if the button was clicked)
34 virtual void Command(wxCommandEvent &event);
35
36protected:
3f2711d5
VZ
37 // creates the control (calls wxWindowBase::CreateBase inside) and adds it
38 // to the list of parents children
8d99be5f
VZ
39 bool CreateControl(wxWindowBase *parent,
40 wxWindowID id,
41 const wxPoint& pos,
42 const wxSize& size,
43 long style,
57c4d796 44#if wxUSE_VALIDATORS
8d99be5f 45 const wxValidator& validator,
57c4d796 46#endif
8d99be5f
VZ
47 const wxString& name);
48
3f2711d5
VZ
49 // an overloaded version for the controls without validators
50 bool CreateControl(wxWindowBase *parent,
51 wxWindowID id,
52 const wxPoint& pos,
53 const wxSize& size,
54 long style,
55 const wxString& name)
56 {
57 return CreateControl(parent, id, pos, size, style,
58 wxDefaultValidator, name);
59 }
60
8d99be5f
VZ
61 // inherit colour and font settings from the parent window
62 void InheritAttributes();
63};
64
65// ----------------------------------------------------------------------------
66// include platform-dependent wxControl declarations
67// ----------------------------------------------------------------------------
f03fc89f 68
2049ba38 69#if defined(__WXMSW__)
8d99be5f 70 #include "wx/msw/control.h"
2049ba38 71#elif defined(__WXMOTIF__)
8d99be5f 72 #include "wx/motif/control.h"
2049ba38 73#elif defined(__WXGTK__)
8d99be5f 74 #include "wx/gtk/control.h"
b4e76e0d 75#elif defined(__WXQT__)
8d99be5f 76 #include "wx/qt/control.h"
34138703 77#elif defined(__WXMAC__)
8d99be5f 78 #include "wx/mac/control.h"
1777b9bb
DW
79#elif defined(__WXPM__)
80 #include "wx/os2/control.h"
34138703 81#elif defined(__WXSTUBS__)
8d99be5f 82 #include "wx/stubs/control.h"
c801d85f
KB
83#endif
84
85#endif
34138703 86 // _WX_CONTROL_H_BASE_