]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_pywindows.i
Added missing Detach method wrapper
[wxWidgets.git] / wxPython / src / _pywindows.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _pywindows.i
3// Purpose: SWIG interface for wxPyWindow, and etc. These classes support
4// overriding many of wxWindow's virtual methods in Python derived
5// classes.
6//
7// Author: Robin Dunn
8//
9// Created: 2-June-1998
10// RCS-ID: $Id$
11// Copyright: (c) 2003 by Total Control Software
12// Licence: wxWindows license
13/////////////////////////////////////////////////////////////////////////////
14
15// Not a %module
16
17
18//---------------------------------------------------------------------------
19%newgroup
20
21// TODO: Redo these with SWIG directors?
22
23// TODO: Which (if any?) of these should be done also???
24// Destroy
25// DoCaptureMouse
26// DoClientToScreen
27// DoHitTest
28// DoMoveWindow
29// DoPopupMenu
30// DoReleaseMouse
31// DoScreenToClient
32// DoSetToolTip
33// Enable
34// Fit
35// GetCharHeight
36// GetCharWidth
37// GetClientAreaOrigin
38// GetDefaultItem
39// IsTopLevel
40// SetBackgroundColour
41// SetDefaultItem
42// SetFocus
43// SetFocusFromKbd
44// SetForegroundColour
45// SetSizeHints
46// SetVirtualSizeHints
47// Show
48
49
50// TODO: Virtualize ShouldInheritColours
51
52//---------------------------------------------------------------------------
53
54
55%{ // C++ version of Python aware wxWindow
56class wxPyWindow : public wxWindow
57{
58 DECLARE_DYNAMIC_CLASS(wxPyWindow)
59public:
60 wxPyWindow() : wxWindow() {}
61 wxPyWindow(wxWindow* parent, const wxWindowID id,
62 const wxPoint& pos = wxDefaultPosition,
63 const wxSize& size = wxDefaultSize,
64 long style = 0,
65 const wxString& name = wxPyPanelNameStr)
66 : wxWindow(parent, id, pos, size, style, name) {}
67
68
69 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
70 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
71 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
72 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
73
74 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
75 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
76 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
77
78 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
79 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
80
81 DEC_PYCALLBACK__(InitDialog);
82 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
83 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
84 DEC_PYCALLBACK_BOOL_(Validate);
85
86 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
87 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
88 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
89
90 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
91 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
92
4d2962b1 93 DEC_PYCALLBACK_BOOL_(ShouldInheritColours);
d43da706 94 DEC_PYCALLBACK__COLOUR(ApplyParentThemeBackground);
4d2962b1 95
d14a1e28
RD
96 PYPRIVATE;
97};
98
99IMPLEMENT_DYNAMIC_CLASS(wxPyWindow, wxWindow);
100
101IMP_PYCALLBACK_VOID_INT4(wxPyWindow, wxWindow, DoMoveWindow);
102IMP_PYCALLBACK_VOID_INT5(wxPyWindow, wxWindow, DoSetSize);
103IMP_PYCALLBACK_VOID_INTINT(wxPyWindow, wxWindow, DoSetClientSize);
104IMP_PYCALLBACK_VOID_INTINT(wxPyWindow, wxWindow, DoSetVirtualSize);
105
106IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyWindow, wxWindow, DoGetSize);
107IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyWindow, wxWindow, DoGetClientSize);
108IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyWindow, wxWindow, DoGetPosition);
109
110IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, DoGetVirtualSize);
111IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, DoGetBestSize);
112
113IMP_PYCALLBACK__(wxPyWindow, wxWindow, InitDialog);
114IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, TransferDataFromWindow);
115IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, TransferDataToWindow);
116IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, Validate);
117
118IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocus);
119IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocusFromKeyboard);
120IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, GetMaxSize);
121
122IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, AddChild);
123IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, RemoveChild);
124
4d2962b1 125IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, ShouldInheritColours);
d43da706
RD
126IMP_PYCALLBACK__COLOUR(wxPyWindow, wxWindow, ApplyParentThemeBackground);
127
d14a1e28
RD
128%}
129
130// And now the one for SWIG to see
131class wxPyWindow : public wxWindow
132{
133public:
2b9048c5 134 %pythonAppend wxPyWindow "self._setOORInfo(self); self._setCallbackInfo(self, PyWindow)"
d43da706 135 %pythonAppend wxPyWindow() ""
d14a1e28
RD
136
137 wxPyWindow(wxWindow* parent, const wxWindowID id,
138 const wxPoint& pos = wxDefaultPosition,
139 const wxSize& size = wxDefaultSize,
140 long style = 0,
141 const wxString& name = wxPyPanelNameStr);
142
d43da706
RD
143 %name(PrePyWindow) wxPyWindow();
144
d14a1e28
RD
145 void _setCallbackInfo(PyObject* self, PyObject* _class);
146
147
148 void base_DoMoveWindow(int x, int y, int width, int height);
149 void base_DoSetSize(int x, int y, int width, int height,
150 int sizeFlags = wxSIZE_AUTO);
151 void base_DoSetClientSize(int width, int height);
152 void base_DoSetVirtualSize( int x, int y );
153
322913ce
RD
154 DocDeclA(
155 void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const,
156 "base_DoGetSize() -> (width, height)");
157 DocDeclA(
158 void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
159 "base_DoGetClientSize() -> (width, height)");
160 DocDeclA(
161 void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
162 "base_DoGetPosition() -> (x,y)");
d14a1e28
RD
163
164 wxSize base_DoGetVirtualSize() const;
165 wxSize base_DoGetBestSize() const;
166
167 void base_InitDialog();
168 bool base_TransferDataToWindow();
169 bool base_TransferDataFromWindow();
170 bool base_Validate();
171
172 bool base_AcceptsFocus() const;
173 bool base_AcceptsFocusFromKeyboard() const;
174 wxSize base_GetMaxSize() const;
175
176 void base_AddChild(wxWindow* child);
177 void base_RemoveChild(wxWindow* child);
d43da706
RD
178
179 bool base_ShouldInheritColours();
180 void base_ApplyParentThemeBackground(const wxColour& c);
d14a1e28
RD
181};
182
183//---------------------------------------------------------------------------
184// Do the same thing for wxControl
185
186// ** See _pycontrol.i, it was moved there because of dependency on wxControl
187
188
189//---------------------------------------------------------------------------
190// and for wxPanel
191
192%{ // C++ version of Python aware wxPanel
193class wxPyPanel : public wxPanel
194{
195 DECLARE_DYNAMIC_CLASS(wxPyPanel)
196public:
197 wxPyPanel() : wxPanel() {}
198 wxPyPanel(wxWindow* parent, const wxWindowID id,
199 const wxPoint& pos = wxDefaultPosition,
200 const wxSize& size = wxDefaultSize,
201 long style = 0,
202 const wxString& name = wxPyPanelNameStr)
203 : wxPanel(parent, id, pos, size, style, name) {}
204
205
206 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
207 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
208 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
209 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
210
211 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
212 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
213 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
214
215 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
216 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
217
218 DEC_PYCALLBACK__(InitDialog);
219 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
220 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
221 DEC_PYCALLBACK_BOOL_(Validate);
222
223 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
224 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
225 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
226
227 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
228 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
229
4d2962b1 230 DEC_PYCALLBACK_BOOL_(ShouldInheritColours);
d43da706 231 DEC_PYCALLBACK__COLOUR(ApplyParentThemeBackground);
4d2962b1 232
d14a1e28
RD
233 PYPRIVATE;
234};
235
236IMPLEMENT_DYNAMIC_CLASS(wxPyPanel, wxPanel);
237
238IMP_PYCALLBACK_VOID_INT4(wxPyPanel, wxPanel, DoMoveWindow);
239IMP_PYCALLBACK_VOID_INT5(wxPyPanel, wxPanel, DoSetSize);
240IMP_PYCALLBACK_VOID_INTINT(wxPyPanel, wxPanel, DoSetClientSize);
241IMP_PYCALLBACK_VOID_INTINT(wxPyPanel, wxPanel, DoSetVirtualSize);
242
243IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyPanel, wxPanel, DoGetSize);
244IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyPanel, wxPanel, DoGetClientSize);
245IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyPanel, wxPanel, DoGetPosition);
246
247IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, DoGetVirtualSize);
248IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, DoGetBestSize);
249
250IMP_PYCALLBACK__(wxPyPanel, wxPanel, InitDialog);
251IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, TransferDataFromWindow);
252IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, TransferDataToWindow);
253IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, Validate);
254
255IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocus);
256IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocusFromKeyboard);
257IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, GetMaxSize);
258
259IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, AddChild);
260IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, RemoveChild);
261
4d2962b1 262IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, ShouldInheritColours);
d43da706 263IMP_PYCALLBACK__COLOUR(wxPyPanel, wxPanel, ApplyParentThemeBackground);
d14a1e28
RD
264%}
265
266// And now the one for SWIG to see
267class wxPyPanel : public wxPanel
268{
269public:
2b9048c5 270 %pythonAppend wxPyPanel "self._setOORInfo(self); self._setCallbackInfo(self, PyPanel)"
d43da706 271 %pythonAppend wxPyPanel() ""
d14a1e28
RD
272
273 wxPyPanel(wxWindow* parent, const wxWindowID id,
274 const wxPoint& pos = wxDefaultPosition,
275 const wxSize& size = wxDefaultSize,
276 long style = 0,
277 const wxString& name = wxPyPanelNameStr);
278
d43da706
RD
279 %name(PrePyPanel) wxPyPanel();
280
281 void _setCallbackInfo(PyObject* self, PyObject* _class);
282
283
284 void base_DoMoveWindow(int x, int y, int width, int height);
285 void base_DoSetSize(int x, int y, int width, int height,
286 int sizeFlags = wxSIZE_AUTO);
287 void base_DoSetClientSize(int width, int height);
288 void base_DoSetVirtualSize( int x, int y );
289
290 DocDeclA(
291 void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const,
292 "base_DoGetSize() -> (width, height)");
293 DocDeclA(
294 void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
295 "base_DoGetClientSize() -> (width, height)");
296 DocDeclA(
297 void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
298 "base_DoGetPosition() -> (x,y)");
299
300 wxSize base_DoGetVirtualSize() const;
301 wxSize base_DoGetBestSize() const;
302
303 void base_InitDialog();
304 bool base_TransferDataToWindow();
305 bool base_TransferDataFromWindow();
306 bool base_Validate();
307
308 bool base_AcceptsFocus() const;
309 bool base_AcceptsFocusFromKeyboard() const;
310 wxSize base_GetMaxSize() const;
311
312 void base_AddChild(wxWindow* child);
313 void base_RemoveChild(wxWindow* child);
314
315 bool base_ShouldInheritColours();
316 void base_ApplyParentThemeBackground(const wxColour& c);
317};
318
319//---------------------------------------------------------------------------
320// and for wxScrolledWindow
321
322%{ // C++ version of Python aware wxScrolledWindow
323class wxPyScrolledWindow : public wxScrolledWindow
324{
325 DECLARE_DYNAMIC_CLASS(wxPyScrolledWindow)
326public:
327 wxPyScrolledWindow() : wxScrolledWindow() {}
328 wxPyScrolledWindow(wxWindow* parent, const wxWindowID id,
329 const wxPoint& pos = wxDefaultPosition,
330 const wxSize& size = wxDefaultSize,
331 long style = 0,
332 const wxString& name = wxPyPanelNameStr)
333 : wxScrolledWindow(parent, id, pos, size, style, name) {}
334
335
336 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
337 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
338 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
339 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
340
341 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
342 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
343 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
344
345 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
346 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
347
348 DEC_PYCALLBACK__(InitDialog);
349 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
350 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
351 DEC_PYCALLBACK_BOOL_(Validate);
352
353 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
354 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
355 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
356
357 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
358 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
359
360 DEC_PYCALLBACK_BOOL_(ShouldInheritColours);
361 DEC_PYCALLBACK__COLOUR(ApplyParentThemeBackground);
362
363 PYPRIVATE;
364};
365
366IMPLEMENT_DYNAMIC_CLASS(wxPyScrolledWindow, wxScrolledWindow);
367
368IMP_PYCALLBACK_VOID_INT4(wxPyScrolledWindow, wxScrolledWindow, DoMoveWindow);
369IMP_PYCALLBACK_VOID_INT5(wxPyScrolledWindow, wxScrolledWindow, DoSetSize);
370IMP_PYCALLBACK_VOID_INTINT(wxPyScrolledWindow, wxScrolledWindow, DoSetClientSize);
371IMP_PYCALLBACK_VOID_INTINT(wxPyScrolledWindow, wxScrolledWindow, DoSetVirtualSize);
372
373IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyScrolledWindow, wxScrolledWindow, DoGetSize);
374IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyScrolledWindow, wxScrolledWindow, DoGetClientSize);
375IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyScrolledWindow, wxScrolledWindow, DoGetPosition);
376
377IMP_PYCALLBACK_SIZE_const(wxPyScrolledWindow, wxScrolledWindow, DoGetVirtualSize);
378IMP_PYCALLBACK_SIZE_const(wxPyScrolledWindow, wxScrolledWindow, DoGetBestSize);
379
380IMP_PYCALLBACK__(wxPyScrolledWindow, wxScrolledWindow, InitDialog);
381IMP_PYCALLBACK_BOOL_(wxPyScrolledWindow, wxScrolledWindow, TransferDataFromWindow);
382IMP_PYCALLBACK_BOOL_(wxPyScrolledWindow, wxScrolledWindow, TransferDataToWindow);
383IMP_PYCALLBACK_BOOL_(wxPyScrolledWindow, wxScrolledWindow, Validate);
384
385IMP_PYCALLBACK_BOOL_const(wxPyScrolledWindow, wxScrolledWindow, AcceptsFocus);
386IMP_PYCALLBACK_BOOL_const(wxPyScrolledWindow, wxScrolledWindow, AcceptsFocusFromKeyboard);
387IMP_PYCALLBACK_SIZE_const(wxPyScrolledWindow, wxScrolledWindow, GetMaxSize);
388
389IMP_PYCALLBACK_VOID_WXWINBASE(wxPyScrolledWindow, wxScrolledWindow, AddChild);
390IMP_PYCALLBACK_VOID_WXWINBASE(wxPyScrolledWindow, wxScrolledWindow, RemoveChild);
391
392IMP_PYCALLBACK_BOOL_(wxPyScrolledWindow, wxScrolledWindow, ShouldInheritColours);
393IMP_PYCALLBACK__COLOUR(wxPyScrolledWindow, wxScrolledWindow, ApplyParentThemeBackground);
394%}
395
396// And now the one for SWIG to see
397class wxPyScrolledWindow : public wxScrolledWindow
398{
399public:
400 %pythonAppend wxPyScrolledWindow "self._setOORInfo(self); self._setCallbackInfo(self, PyPanel)"
401 %pythonAppend wxPyScrolledWindow() ""
402
403 wxPyScrolledWindow(wxWindow* parent, const wxWindowID id,
404 const wxPoint& pos = wxDefaultPosition,
405 const wxSize& size = wxDefaultSize,
406 long style = 0,
407 const wxString& name = wxPyPanelNameStr);
408
409 %name(PrePyScrolledWindow) wxPyScrolledWindow();
410
d14a1e28 411 void _setCallbackInfo(PyObject* self, PyObject* _class);
d14a1e28
RD
412
413
414 void base_DoMoveWindow(int x, int y, int width, int height);
415 void base_DoSetSize(int x, int y, int width, int height,
416 int sizeFlags = wxSIZE_AUTO);
417 void base_DoSetClientSize(int width, int height);
418 void base_DoSetVirtualSize( int x, int y );
419
322913ce
RD
420 DocDeclA(
421 void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const,
422 "base_DoGetSize() -> (width, height)");
423 DocDeclA(
424 void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
425 "base_DoGetClientSize() -> (width, height)");
426 DocDeclA(
427 void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
428 "base_DoGetPosition() -> (x,y)");
d14a1e28
RD
429
430 wxSize base_DoGetVirtualSize() const;
431 wxSize base_DoGetBestSize() const;
432
433 void base_InitDialog();
434 bool base_TransferDataToWindow();
435 bool base_TransferDataFromWindow();
436 bool base_Validate();
437
438 bool base_AcceptsFocus() const;
439 bool base_AcceptsFocusFromKeyboard() const;
440 wxSize base_GetMaxSize() const;
441
442 void base_AddChild(wxWindow* child);
443 void base_RemoveChild(wxWindow* child);
d43da706
RD
444
445 bool base_ShouldInheritColours();
446 void base_ApplyParentThemeBackground(const wxColour& c);
d14a1e28
RD
447};
448
449
450//---------------------------------------------------------------------------
451//---------------------------------------------------------------------------