]>
Commit | Line | Data |
---|---|---|
7bf85405 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: windows2.i | |
3 | // Purpose: SWIG definitions of MORE window classes | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 6/2/98 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 1998 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
03e9bead | 13 | %module windows2 |
7bf85405 | 14 | |
03e9bead | 15 | %{ |
7bf85405 | 16 | #include "helpers.h" |
f6bcfd97 | 17 | #ifdef OLD_GRID |
7bf85405 | 18 | #include <wx/grid.h> |
f6bcfd97 | 19 | #endif |
7bf85405 | 20 | #include <wx/notebook.h> |
9c039d08 | 21 | #include <wx/splitter.h> |
9416aa89 | 22 | #include <wx/imaglist.h> |
b639c3c5 RD |
23 | #ifdef __WXMSW__ |
24 | #include <wx/msw/taskbar.h> | |
25 | #endif | |
7bf85405 RD |
26 | %} |
27 | ||
28 | //---------------------------------------------------------------------- | |
29 | ||
137b5242 RD |
30 | %{ |
31 | // Put some wx default wxChar* values into wxStrings. | |
32 | DECLARE_DEF_STRING(NOTEBOOK_NAME); | |
0b85cc38 | 33 | DECLARE_DEF_STRING(PanelNameStr); |
b0e5c039 | 34 | DECLARE_DEF_STRING(ControlNameStr); |
137b5242 RD |
35 | |
36 | static const wxChar* wxSplitterNameStr = wxT("splitter"); | |
37 | DECLARE_DEF_STRING(SplitterNameStr); | |
38 | static const wxString wxPyEmptyString(wxT("")); | |
39 | %} | |
40 | ||
41 | //---------------------------------------------------------------------- | |
42 | ||
7bf85405 RD |
43 | %include typemaps.i |
44 | %include my_typemaps.i | |
45 | ||
46 | // Import some definitions of other classes, etc. | |
47 | %import _defs.i | |
48 | %import misc.i | |
49 | %import gdi.i | |
50 | %import windows.i | |
51 | %import controls.i | |
52 | %import events.i | |
53 | ||
b8b8dda7 | 54 | %pragma(python) code = "import wx" |
9c039d08 | 55 | |
7bf85405 RD |
56 | //--------------------------------------------------------------------------- |
57 | ||
1b62f00d RD |
58 | enum { |
59 | /* notebook control event types */ | |
60 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, | |
61 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, | |
62 | }; | |
63 | ||
64 | ||
bb0054cd | 65 | class wxNotebookEvent : public wxNotifyEvent { |
7bf85405 | 66 | public: |
09f3d4e6 RD |
67 | wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, |
68 | int nSel = -1, int nOldSel = -1); | |
69 | ||
7bf85405 RD |
70 | int GetSelection(); |
71 | int GetOldSelection(); | |
bb0054cd RD |
72 | void SetOldSelection(int page); |
73 | void SetSelection(int page); | |
7bf85405 RD |
74 | }; |
75 | ||
76 | ||
77 | ||
78 | class wxNotebook : public wxControl { | |
79 | public: | |
80 | wxNotebook(wxWindow *parent, | |
81 | wxWindowID id, | |
b68dc582 RD |
82 | const wxPoint& pos = wxDefaultPosition, |
83 | const wxSize& size = wxDefaultSize, | |
7bf85405 | 84 | long style = 0, |
137b5242 | 85 | const wxString& name = wxPyNOTEBOOK_NAME); |
09f3d4e6 | 86 | %name(wxPreNotebook)wxNotebook(); |
7bf85405 | 87 | |
09f3d4e6 RD |
88 | bool Create(wxWindow *parent, |
89 | wxWindowID id, | |
90 | const wxPoint& pos = wxDefaultPosition, | |
91 | const wxSize& size = wxDefaultSize, | |
92 | long style = 0, | |
137b5242 | 93 | const wxString& name = wxPyNOTEBOOK_NAME); |
9c039d08 | 94 | |
0122b7e3 | 95 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 96 | %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)" |
0122b7e3 | 97 | |
7bf85405 RD |
98 | int GetPageCount(); |
99 | int SetSelection(int nPage); | |
100 | void AdvanceSelection(bool bForward = TRUE); | |
101 | int GetSelection(); | |
102 | bool SetPageText(int nPage, const wxString& strText); | |
103 | wxString GetPageText(int nPage) const; | |
949853a4 | 104 | |
7bf85405 | 105 | void SetImageList(wxImageList* imageList); |
949853a4 RD |
106 | void AssignImageList(wxImageList *imageList) ; |
107 | %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0" | |
108 | ||
7bf85405 RD |
109 | wxImageList* GetImageList(); |
110 | int GetPageImage(int nPage); | |
111 | bool SetPageImage(int nPage, int nImage); | |
112 | int GetRowCount(); | |
113 | ||
c368d904 RD |
114 | void SetPageSize(const wxSize& size); |
115 | void SetPadding(const wxSize& padding); | |
7bf85405 | 116 | bool DeletePage(int nPage); |
cf694132 | 117 | bool RemovePage(int nPage); |
7bf85405 RD |
118 | bool DeleteAllPages(); |
119 | bool AddPage(/*wxNotebookPage*/ wxWindow *pPage, | |
120 | const wxString& strText, | |
cf694132 | 121 | int bSelect = FALSE, |
7bf85405 RD |
122 | int imageId = -1); |
123 | bool InsertPage(int nPage, | |
124 | /*wxNotebookPage*/ wxWindow *pPage, | |
125 | const wxString& strText, | |
126 | bool bSelect = FALSE, | |
127 | int imageId = -1); | |
bb0054cd | 128 | /*wxNotebookPage*/ wxWindow *GetPage(int nPage); |
7bf85405 | 129 | |
cf694132 RD |
130 | %addmethods { |
131 | void ResizeChildren() { | |
132 | wxSizeEvent evt(self->GetClientSize()); | |
4cd9591a | 133 | self->GetEventHandler()->ProcessEvent(evt); |
cf694132 RD |
134 | } |
135 | } | |
136 | ||
137 | ||
7bf85405 RD |
138 | }; |
139 | ||
9c039d08 RD |
140 | //--------------------------------------------------------------------------- |
141 | ||
f6bcfd97 | 142 | |
1b62f00d RD |
143 | enum { |
144 | /* splitter window events */ | |
145 | wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, | |
146 | wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, | |
147 | wxEVT_COMMAND_SPLITTER_UNSPLIT, | |
148 | wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, | |
149 | }; | |
150 | ||
151 | ||
f6bcfd97 BP |
152 | enum |
153 | { | |
154 | wxSPLIT_HORIZONTAL, | |
155 | wxSPLIT_VERTICAL, | |
156 | wxSPLIT_DRAG_NONE, | |
157 | wxSPLIT_DRAG_DRAGGING, | |
158 | wxSPLIT_DRAG_LEFT_DOWN | |
f6bcfd97 BP |
159 | }; |
160 | ||
161 | ||
756ed80c | 162 | class wxSplitterEvent : public wxNotifyEvent { |
bb0054cd | 163 | public: |
09f3d4e6 RD |
164 | wxSplitterEvent(wxEventType type = wxEVT_NULL, |
165 | wxSplitterWindow *splitter = NULL); | |
166 | ||
bb0054cd RD |
167 | int GetSashPosition(); |
168 | int GetX(); | |
169 | int GetY(); | |
170 | wxWindow* GetWindowBeingRemoved(); | |
171 | void SetSashPosition(int pos); | |
172 | } | |
173 | ||
174 | ||
175 | ||
176 | ||
9c039d08 RD |
177 | class wxSplitterWindow : public wxWindow { |
178 | public: | |
179 | wxSplitterWindow(wxWindow* parent, wxWindowID id, | |
b68dc582 RD |
180 | const wxPoint& point = wxDefaultPosition, |
181 | const wxSize& size = wxDefaultSize, | |
b639c3c5 | 182 | long style=wxSP_3D|wxCLIP_CHILDREN, |
137b5242 | 183 | const wxString& name = wxPySplitterNameStr); |
09f3d4e6 | 184 | %name(wxPreSplitterWindow)wxSplitterWindow(); |
9c039d08 | 185 | |
09f3d4e6 RD |
186 | bool Create(wxWindow* parent, wxWindowID id, |
187 | const wxPoint& point = wxDefaultPosition, | |
188 | const wxSize& size = wxDefaultSize, | |
189 | long style=wxSP_3D|wxCLIP_CHILDREN, | |
137b5242 | 190 | const wxString& name = wxPySplitterNameStr); |
9c039d08 | 191 | |
0122b7e3 | 192 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 193 | %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)" |
09f3d4e6 RD |
194 | |
195 | // Gets the only or left/top pane | |
196 | wxWindow *GetWindow1(); | |
197 | ||
198 | // Gets the right/bottom pane | |
199 | wxWindow *GetWindow2(); | |
200 | ||
201 | // Sets the split mode | |
202 | void SetSplitMode(int mode); | |
203 | ||
204 | // Gets the split mode | |
9c039d08 | 205 | int GetSplitMode(); |
09f3d4e6 RD |
206 | |
207 | // Initialize with one window | |
208 | void Initialize(wxWindow *window); | |
209 | ||
210 | // Associates the given window with window 2, drawing the appropriate sash | |
211 | // and changing the split mode. | |
212 | // Does nothing and returns FALSE if the window is already split. | |
213 | // A sashPosition of 0 means choose a default sash position, | |
214 | // negative sashPosition specifies the size of right/lower pane as it's | |
215 | // absolute value rather than the size of left/upper pane. | |
216 | virtual bool SplitVertically(wxWindow *window1, | |
217 | wxWindow *window2, | |
218 | int sashPosition = 0); | |
219 | virtual bool SplitHorizontally(wxWindow *window1, | |
220 | wxWindow *window2, | |
221 | int sashPosition = 0); | |
222 | ||
223 | // Removes the specified (or second) window from the view | |
224 | // Doesn't actually delete the window. | |
225 | bool Unsplit(wxWindow *toRemove = NULL); | |
226 | ||
227 | // Replaces one of the windows with another one (neither old nor new | |
228 | // parameter should be NULL) | |
229 | bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew); | |
230 | ||
231 | // Is the window split? | |
9c039d08 RD |
232 | bool IsSplit(); |
233 | ||
09f3d4e6 | 234 | // Sets the sash size |
b639c3c5 | 235 | void SetSashSize(int width); |
09f3d4e6 RD |
236 | |
237 | // Sets the border size | |
238 | void SetBorderSize(int width); | |
239 | ||
240 | // Gets the sash size | |
241 | int GetSashSize(); | |
242 | ||
243 | // Gets the border size | |
244 | int GetBorderSize(); | |
245 | ||
246 | // Set the sash position | |
247 | void SetSashPosition(int position, bool redraw = TRUE); | |
248 | ||
249 | // Gets the sash position | |
250 | int GetSashPosition(); | |
251 | ||
252 | // If this is zero, we can remove panes by dragging the sash. | |
253 | void SetMinimumPaneSize(int min); | |
254 | int GetMinimumPaneSize(); | |
255 | ||
3bd1e033 RD |
256 | // Resizes subwindows |
257 | virtual void SizeWindows(); | |
258 | ||
259 | void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; } | |
260 | bool GetNeedUpdating() const { return m_needUpdating ; } | |
261 | ||
9c039d08 RD |
262 | }; |
263 | ||
264 | //--------------------------------------------------------------------------- | |
265 | ||
b639c3c5 RD |
266 | #ifdef __WXMSW__ |
267 | ||
268 | enum { | |
269 | wxEVT_TASKBAR_MOVE, | |
270 | wxEVT_TASKBAR_LEFT_DOWN, | |
271 | wxEVT_TASKBAR_LEFT_UP, | |
272 | wxEVT_TASKBAR_RIGHT_DOWN, | |
273 | wxEVT_TASKBAR_RIGHT_UP, | |
274 | wxEVT_TASKBAR_LEFT_DCLICK, | |
275 | wxEVT_TASKBAR_RIGHT_DCLICK | |
276 | }; | |
9c039d08 RD |
277 | |
278 | ||
b639c3c5 RD |
279 | class wxTaskBarIcon : public wxEvtHandler { |
280 | public: | |
281 | wxTaskBarIcon(); | |
282 | ~wxTaskBarIcon(); | |
283 | ||
0122b7e3 RD |
284 | //%pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
285 | ||
c368d904 | 286 | // We still use the magic methods here since that is the way it is documented... |
b8b8dda7 RD |
287 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnMouseMove', wxEVT_TASKBAR_MOVE)" |
288 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDown', wxEVT_TASKBAR_LEFT_DOWN)" | |
289 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonUp', wxEVT_TASKBAR_LEFT_UP)" | |
290 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDown', wxEVT_TASKBAR_RIGHT_DOWN)" | |
291 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonUp', wxEVT_TASKBAR_RIGHT_UP)" | |
292 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLButtonDClick',wxEVT_TASKBAR_LEFT_DCLICK)" | |
293 | %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnRButtonDClick',wxEVT_TASKBAR_RIGHT_DCLICK)" | |
b639c3c5 | 294 | |
137b5242 | 295 | bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString); |
b639c3c5 | 296 | bool RemoveIcon(void); |
be4d9c1f | 297 | bool PopupMenu(wxMenu *menu); |
c368d904 RD |
298 | bool IsIconInstalled(); |
299 | bool IsOK(); | |
b639c3c5 RD |
300 | }; |
301 | #endif | |
302 | ||
0b85cc38 RD |
303 | //--------------------------------------------------------------------------- |
304 | //--------------------------------------------------------------------------- | |
305 | // wxPyWindow derives from wxWindow and adds support for overriding many of | |
306 | // the virtual methods in Python derived classes. | |
307 | ||
efe12e95 | 308 | // Which (any?) of these should be done also??? |
b0e5c039 RD |
309 | // Destroy |
310 | // DoCaptureMouse | |
311 | // DoClientToScreen | |
312 | // DoHitTest | |
313 | // DoMoveWindow | |
314 | // DoPopupMenu | |
315 | // DoReleaseMouse | |
316 | // DoScreenToClient | |
317 | // DoSetToolTip | |
0b85cc38 | 318 | // Enable |
b0e5c039 RD |
319 | // Fit |
320 | // GetCharHeight | |
321 | // GetCharWidth | |
322 | // GetClientAreaOrigin | |
0b85cc38 | 323 | // GetDefaultItem |
0b85cc38 | 324 | // IsTopLevel |
0b85cc38 | 325 | // SetBackgroundColour |
b0e5c039 RD |
326 | // SetDefaultItem |
327 | // SetFocus | |
328 | // SetFocusFromKbd | |
0b85cc38 | 329 | // SetForegroundColour |
b0e5c039 RD |
330 | // SetSizeHints |
331 | // SetVirtualSizeHints | |
332 | // Show | |
333 | ||
334 | ||
335 | %{ // C++ version of Python aware wxWindow | |
336 | class wxPyWindow : public wxWindow | |
337 | { | |
338 | DECLARE_DYNAMIC_CLASS(wxPyWindow) | |
339 | public: | |
340 | wxPyWindow() : wxWindow() {} | |
341 | wxPyWindow(wxWindow* parent, const wxWindowID id, | |
342 | const wxPoint& pos = wxDefaultPosition, | |
343 | const wxSize& size = wxDefaultSize, | |
344 | long style = 0, | |
345 | const wxString& name = wxPyPanelNameStr) | |
346 | : wxWindow(parent, id, pos, size, style, name) {} | |
347 | ||
348 | ||
349 | DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); | |
350 | DEC_PYCALLBACK_VOID_INT5(DoSetSize); | |
351 | DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize); | |
352 | DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize); | |
353 | ||
354 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize); | |
355 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize); | |
356 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition); | |
357 | ||
358 | DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize); | |
359 | DEC_PYCALLBACK_SIZE_const(DoGetBestSize); | |
360 | ||
361 | DEC_PYCALLBACK__(InitDialog); | |
362 | DEC_PYCALLBACK_BOOL_(TransferDataFromWindow); | |
363 | DEC_PYCALLBACK_BOOL_(TransferDataToWindow); | |
364 | DEC_PYCALLBACK_BOOL_(Validate); | |
365 | ||
366 | DEC_PYCALLBACK_BOOL_const(AcceptsFocus); | |
367 | DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); | |
368 | DEC_PYCALLBACK_SIZE_const(GetMaxSize); | |
369 | ||
aaad759f RD |
370 | DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); |
371 | DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); | |
372 | ||
b0e5c039 RD |
373 | PYPRIVATE; |
374 | }; | |
0b85cc38 | 375 | |
b0e5c039 | 376 | IMPLEMENT_DYNAMIC_CLASS(wxPyWindow, wxWindow); |
0b85cc38 | 377 | |
b0e5c039 RD |
378 | IMP_PYCALLBACK_VOID_INT4(wxPyWindow, wxWindow, DoMoveWindow); |
379 | IMP_PYCALLBACK_VOID_INT5(wxPyWindow, wxWindow, DoSetSize); | |
380 | IMP_PYCALLBACK_VOID_INTINT(wxPyWindow, wxWindow, DoSetClientSize); | |
381 | IMP_PYCALLBACK_VOID_INTINT(wxPyWindow, wxWindow, DoSetVirtualSize); | |
0b85cc38 | 382 | |
b0e5c039 RD |
383 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyWindow, wxWindow, DoGetSize); |
384 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyWindow, wxWindow, DoGetClientSize); | |
385 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyWindow, wxWindow, DoGetPosition); | |
0b85cc38 | 386 | |
b0e5c039 RD |
387 | IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, DoGetVirtualSize); |
388 | IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, DoGetBestSize); | |
0b85cc38 | 389 | |
b0e5c039 RD |
390 | IMP_PYCALLBACK__(wxPyWindow, wxWindow, InitDialog); |
391 | IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, TransferDataFromWindow); | |
392 | IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, TransferDataToWindow); | |
393 | IMP_PYCALLBACK_BOOL_(wxPyWindow, wxWindow, Validate); | |
394 | ||
395 | IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocus); | |
396 | IMP_PYCALLBACK_BOOL_const(wxPyWindow, wxWindow, AcceptsFocusFromKeyboard); | |
397 | IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, GetMaxSize); | |
398 | ||
aaad759f RD |
399 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, AddChild); |
400 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, RemoveChild); | |
401 | ||
b0e5c039 RD |
402 | %} |
403 | ||
404 | // And now the one for SWIG to see | |
405 | class wxPyWindow : public wxWindow | |
406 | { | |
407 | public: | |
408 | wxPyWindow(wxWindow* parent, const wxWindowID id, | |
409 | const wxPoint& pos = wxDefaultPosition, | |
410 | const wxSize& size = wxDefaultSize, | |
411 | long style = 0, | |
412 | const wxString& name = wxPyPanelNameStr); | |
413 | ||
414 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
415 | %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyWindow)" | |
416 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
417 | ||
418 | ||
419 | void base_DoMoveWindow(int x, int y, int width, int height); | |
420 | void base_DoSetSize(int x, int y, int width, int height, | |
421 | int sizeFlags = wxSIZE_AUTO); | |
422 | void base_DoSetClientSize(int width, int height); | |
423 | void base_DoSetVirtualSize( int x, int y ); | |
424 | ||
425 | void base_DoGetSize( int *OUTPUT, int *OUTPUT ) const; | |
426 | void base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const; | |
427 | void base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const; | |
428 | ||
429 | wxSize base_DoGetVirtualSize() const; | |
430 | wxSize base_DoGetBestSize() const; | |
431 | ||
432 | void base_InitDialog(); | |
433 | bool base_TransferDataToWindow(); | |
434 | bool base_TransferDataFromWindow(); | |
435 | bool base_Validate(); | |
436 | ||
437 | bool base_AcceptsFocus() const; | |
438 | bool base_AcceptsFocusFromKeyboard() const; | |
439 | wxSize base_GetMaxSize() const; | |
aaad759f RD |
440 | |
441 | void base_AddChild(wxWindow* child); | |
442 | void base_RemoveChild(wxWindow* child); | |
b0e5c039 RD |
443 | } |
444 | ||
445 | //--------------------------------------------------------------------------- | |
446 | // Do the same thing for wxControl | |
447 | ||
448 | ||
449 | %{ // C++ version of Python aware wxControl | |
450 | class wxPyControl : public wxControl | |
451 | { | |
452 | DECLARE_DYNAMIC_CLASS(wxPyControl) | |
453 | public: | |
454 | wxPyControl() : wxControl() {} | |
455 | wxPyControl(wxWindow* parent, const wxWindowID id, | |
456 | const wxPoint& pos = wxDefaultPosition, | |
457 | const wxSize& size = wxDefaultSize, | |
458 | long style = 0, | |
459 | const wxValidator& validator=wxDefaultValidator, | |
460 | const wxString& name = wxPyControlNameStr) | |
461 | : wxControl(parent, id, pos, size, style, validator, name) {} | |
462 | ||
463 | ||
464 | DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); | |
465 | DEC_PYCALLBACK_VOID_INT5(DoSetSize); | |
466 | DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize); | |
467 | DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize); | |
468 | ||
469 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize); | |
470 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize); | |
471 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition); | |
472 | ||
473 | DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize); | |
474 | DEC_PYCALLBACK_SIZE_const(DoGetBestSize); | |
475 | ||
476 | DEC_PYCALLBACK__(InitDialog); | |
477 | DEC_PYCALLBACK_BOOL_(TransferDataFromWindow); | |
478 | DEC_PYCALLBACK_BOOL_(TransferDataToWindow); | |
479 | DEC_PYCALLBACK_BOOL_(Validate); | |
480 | ||
481 | DEC_PYCALLBACK_BOOL_const(AcceptsFocus); | |
482 | DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); | |
483 | DEC_PYCALLBACK_SIZE_const(GetMaxSize); | |
484 | ||
aaad759f RD |
485 | DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); |
486 | DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); | |
487 | ||
b0e5c039 RD |
488 | PYPRIVATE; |
489 | }; | |
490 | ||
491 | IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl); | |
492 | ||
493 | IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow); | |
494 | IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize); | |
495 | IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize); | |
496 | IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize); | |
497 | ||
498 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize); | |
499 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize); | |
500 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition); | |
501 | ||
502 | IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize); | |
503 | IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize); | |
504 | ||
505 | IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog); | |
506 | IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow); | |
507 | IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow); | |
508 | IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate); | |
509 | ||
510 | IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus); | |
511 | IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard); | |
512 | IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize); | |
513 | ||
aaad759f RD |
514 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild); |
515 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild); | |
516 | ||
b0e5c039 RD |
517 | %} |
518 | ||
519 | // And now the one for SWIG to see | |
520 | class wxPyControl : public wxControl | |
521 | { | |
522 | public: | |
523 | wxPyControl(wxWindow* parent, const wxWindowID id, | |
524 | const wxPoint& pos = wxDefaultPosition, | |
525 | const wxSize& size = wxDefaultSize, | |
526 | long style = 0, | |
527 | const wxValidator& validator=wxDefaultValidator, | |
528 | const wxString& name = wxPyControlNameStr); | |
529 | ||
530 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
531 | %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyControl)" | |
532 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
533 | ||
534 | ||
535 | void base_DoMoveWindow(int x, int y, int width, int height); | |
536 | void base_DoSetSize(int x, int y, int width, int height, | |
537 | int sizeFlags = wxSIZE_AUTO); | |
538 | void base_DoSetClientSize(int width, int height); | |
539 | void base_DoSetVirtualSize( int x, int y ); | |
540 | ||
541 | void base_DoGetSize( int *OUTPUT, int *OUTPUT ) const; | |
542 | void base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const; | |
543 | void base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const; | |
544 | ||
545 | wxSize base_DoGetVirtualSize() const; | |
546 | wxSize base_DoGetBestSize() const; | |
547 | ||
548 | void base_InitDialog(); | |
549 | bool base_TransferDataToWindow(); | |
550 | bool base_TransferDataFromWindow(); | |
551 | bool base_Validate(); | |
552 | ||
553 | bool base_AcceptsFocus() const; | |
554 | bool base_AcceptsFocusFromKeyboard() const; | |
555 | wxSize base_GetMaxSize() const; | |
aaad759f RD |
556 | |
557 | void base_AddChild(wxWindow* child); | |
558 | void base_RemoveChild(wxWindow* child); | |
b0e5c039 | 559 | } |
0b85cc38 | 560 | |
86a12675 RD |
561 | //--------------------------------------------------------------------------- |
562 | // and for wxPanel | |
563 | ||
564 | %{ // C++ version of Python aware wxPanel | |
565 | class wxPyPanel : public wxPanel | |
566 | { | |
567 | DECLARE_DYNAMIC_CLASS(wxPyPanel) | |
568 | public: | |
569 | wxPyPanel() : wxPanel() {} | |
570 | wxPyPanel(wxWindow* parent, const wxWindowID id, | |
571 | const wxPoint& pos = wxDefaultPosition, | |
572 | const wxSize& size = wxDefaultSize, | |
573 | long style = 0, | |
574 | const wxString& name = wxPyPanelNameStr) | |
575 | : wxPanel(parent, id, pos, size, style, name) {} | |
576 | ||
577 | ||
578 | DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); | |
579 | DEC_PYCALLBACK_VOID_INT5(DoSetSize); | |
580 | DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize); | |
581 | DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize); | |
582 | ||
583 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize); | |
584 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize); | |
585 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition); | |
586 | ||
587 | DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize); | |
588 | DEC_PYCALLBACK_SIZE_const(DoGetBestSize); | |
589 | ||
590 | DEC_PYCALLBACK__(InitDialog); | |
591 | DEC_PYCALLBACK_BOOL_(TransferDataFromWindow); | |
592 | DEC_PYCALLBACK_BOOL_(TransferDataToWindow); | |
593 | DEC_PYCALLBACK_BOOL_(Validate); | |
594 | ||
595 | DEC_PYCALLBACK_BOOL_const(AcceptsFocus); | |
596 | DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); | |
597 | DEC_PYCALLBACK_SIZE_const(GetMaxSize); | |
598 | ||
aaad759f RD |
599 | DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); |
600 | DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); | |
601 | ||
86a12675 RD |
602 | PYPRIVATE; |
603 | }; | |
604 | ||
605 | IMPLEMENT_DYNAMIC_CLASS(wxPyPanel, wxPanel); | |
606 | ||
607 | IMP_PYCALLBACK_VOID_INT4(wxPyPanel, wxPanel, DoMoveWindow); | |
608 | IMP_PYCALLBACK_VOID_INT5(wxPyPanel, wxPanel, DoSetSize); | |
609 | IMP_PYCALLBACK_VOID_INTINT(wxPyPanel, wxPanel, DoSetClientSize); | |
610 | IMP_PYCALLBACK_VOID_INTINT(wxPyPanel, wxPanel, DoSetVirtualSize); | |
611 | ||
612 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyPanel, wxPanel, DoGetSize); | |
613 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyPanel, wxPanel, DoGetClientSize); | |
614 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyPanel, wxPanel, DoGetPosition); | |
615 | ||
616 | IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, DoGetVirtualSize); | |
617 | IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, DoGetBestSize); | |
618 | ||
619 | IMP_PYCALLBACK__(wxPyPanel, wxPanel, InitDialog); | |
620 | IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, TransferDataFromWindow); | |
621 | IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, TransferDataToWindow); | |
622 | IMP_PYCALLBACK_BOOL_(wxPyPanel, wxPanel, Validate); | |
623 | ||
624 | IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocus); | |
625 | IMP_PYCALLBACK_BOOL_const(wxPyPanel, wxPanel, AcceptsFocusFromKeyboard); | |
626 | IMP_PYCALLBACK_SIZE_const(wxPyPanel, wxPanel, GetMaxSize); | |
627 | ||
aaad759f RD |
628 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, AddChild); |
629 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, RemoveChild); | |
630 | ||
86a12675 RD |
631 | %} |
632 | ||
633 | // And now the one for SWIG to see | |
634 | class wxPyPanel : public wxPanel | |
635 | { | |
636 | public: | |
637 | wxPyPanel(wxWindow* parent, const wxWindowID id, | |
638 | const wxPoint& pos = wxDefaultPosition, | |
639 | const wxSize& size = wxDefaultSize, | |
640 | long style = 0, | |
641 | const wxString& name = wxPyPanelNameStr); | |
642 | ||
643 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
644 | %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyPanel)" | |
645 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
646 | ||
647 | ||
648 | void base_DoMoveWindow(int x, int y, int width, int height); | |
649 | void base_DoSetSize(int x, int y, int width, int height, | |
650 | int sizeFlags = wxSIZE_AUTO); | |
651 | void base_DoSetClientSize(int width, int height); | |
652 | void base_DoSetVirtualSize( int x, int y ); | |
653 | ||
654 | void base_DoGetSize( int *OUTPUT, int *OUTPUT ) const; | |
655 | void base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const; | |
656 | void base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const; | |
657 | ||
658 | wxSize base_DoGetVirtualSize() const; | |
659 | wxSize base_DoGetBestSize() const; | |
660 | ||
661 | void base_InitDialog(); | |
662 | bool base_TransferDataToWindow(); | |
663 | bool base_TransferDataFromWindow(); | |
664 | bool base_Validate(); | |
665 | ||
666 | bool base_AcceptsFocus() const; | |
667 | bool base_AcceptsFocusFromKeyboard() const; | |
668 | wxSize base_GetMaxSize() const; | |
aaad759f RD |
669 | |
670 | void base_AddChild(wxWindow* child); | |
671 | void base_RemoveChild(wxWindow* child); | |
eb67b703 | 672 | }; |
86a12675 RD |
673 | |
674 | ||
7bf85405 | 675 | //--------------------------------------------------------------------------- |