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