]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_pycontrol.i
Make IsSelected be a bit more specific
[wxWidgets.git] / wxPython / src / _pycontrol.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _pywindows.i
3// Purpose: SWIG interface for wxPyControl, See also _pywindows.i
4//
5// Author: Robin Dunn
6//
7// Created: 2-June-1998
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17%newgroup
18
19
d14a1e28
RD
20
21//---------------------------------------------------------------------------
22
23%{ // C++ version of Python aware wxControl
24class wxPyControl : public wxControl
25{
26 DECLARE_DYNAMIC_CLASS(wxPyControl)
27public:
28 wxPyControl() : wxControl() {}
29 wxPyControl(wxWindow* parent, const wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = 0,
33 const wxValidator& validator=wxDefaultValidator,
34 const wxString& name = wxPyControlNameStr)
35 : wxControl(parent, id, pos, size, style, validator, name) {}
36
1a10485f 37 void SetBestSize(const wxSize& size) { wxControl::SetBestSize(size); }
d14a1e28
RD
38
39 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
40 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
41 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
42 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
43
44 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
45 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
46 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
47
48 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
49 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
50
51 DEC_PYCALLBACK__(InitDialog);
52 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
53 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
54 DEC_PYCALLBACK_BOOL_(Validate);
55
56 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
57 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
58 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
59
60 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
61 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
62
1a10485f 63 DEC_PYCALLBACK_BOOL_const(ShouldInheritColours);
d43da706 64 DEC_PYCALLBACK__COLOUR(ApplyParentThemeBackground);
1a10485f 65 DEC_PYCALLBACK_VIZATTR_(GetDefaultAttributes);
4d2962b1 66
b035e80b
RD
67 DEC_PYCALLBACK_BOOL_(HasTransparentBackground);
68
d14a1e28
RD
69 PYPRIVATE;
70};
71
72IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl);
73
74IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow);
75IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize);
76IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize);
77IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize);
78
79IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize);
80IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize);
81IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition);
82
83IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize);
84IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize);
85
86IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog);
87IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow);
88IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow);
89IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate);
90
91IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus);
92IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard);
93IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize);
94
95IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild);
96IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild);
97
1a10485f 98IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, ShouldInheritColours);
d43da706 99IMP_PYCALLBACK__COLOUR(wxPyControl, wxControl, ApplyParentThemeBackground);
1a10485f 100IMP_PYCALLBACK_VIZATTR_(wxPyControl, wxControl, GetDefaultAttributes);
b035e80b
RD
101
102IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, HasTransparentBackground);
103 %}
d14a1e28
RD
104
105// And now the one for SWIG to see
ab1f7d2a 106MustHaveApp(wxPyControl);
d14a1e28
RD
107class wxPyControl : public wxControl
108{
109public:
2b9048c5 110 %pythonAppend wxPyControl "self._setOORInfo(self); self._setCallbackInfo(self, PyControl)"
d43da706 111 %pythonAppend wxPyControl() ""
d14a1e28 112
d5573410 113 wxPyControl(wxWindow* parent, const wxWindowID id=-1,
d14a1e28
RD
114 const wxPoint& pos = wxDefaultPosition,
115 const wxSize& size = wxDefaultSize,
116 long style = 0,
117 const wxValidator& validator=wxDefaultValidator,
118 const wxString& name = wxPyControlNameStr);
119
1b8c7ba6 120 %RenameCtor(PrePyControl, wxPyControl());
d43da706 121
d14a1e28 122 void _setCallbackInfo(PyObject* self, PyObject* _class);
d14a1e28 123
1a10485f 124 void SetBestSize(const wxSize& size);
d14a1e28
RD
125
126 void base_DoMoveWindow(int x, int y, int width, int height);
127 void base_DoSetSize(int x, int y, int width, int height,
128 int sizeFlags = wxSIZE_AUTO);
129 void base_DoSetClientSize(int width, int height);
130 void base_DoSetVirtualSize( int x, int y );
131
322913ce
RD
132 DocDeclA(
133 void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const,
134 "base_DoGetSize() -> (width, height)");
135 DocDeclA(
136 void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
137 "base_DoGetClientSize() -> (width, height)");
138 DocDeclA(
139 void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
140 "base_DoGetPosition() -> (x,y)");
d14a1e28
RD
141
142 wxSize base_DoGetVirtualSize() const;
143 wxSize base_DoGetBestSize() const;
144
145 void base_InitDialog();
146 bool base_TransferDataToWindow();
147 bool base_TransferDataFromWindow();
148 bool base_Validate();
149
150 bool base_AcceptsFocus() const;
151 bool base_AcceptsFocusFromKeyboard() const;
152 wxSize base_GetMaxSize() const;
153
154 void base_AddChild(wxWindow* child);
155 void base_RemoveChild(wxWindow* child);
d43da706 156
1a10485f 157 bool base_ShouldInheritColours() const;
d43da706 158 void base_ApplyParentThemeBackground(const wxColour& c);
1a10485f 159 wxVisualAttributes base_GetDefaultAttributes();
d14a1e28
RD
160};
161
162
163//---------------------------------------------------------------------------
164//---------------------------------------------------------------------------