]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/windows2.i
another update for newest bakefile
[wxWidgets.git] / wxPython / src / windows2.i
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
13 %module windows2
14
15 %{
16 #include "helpers.h"
17 #include <wx/notebook.h>
18 #include <wx/splitter.h>
19 #include <wx/imaglist.h>
20 #ifdef __WXMSW__
21 #include <wx/taskbar.h>
22 #endif
23 %}
24
25 //----------------------------------------------------------------------
26
27 %{
28 // Put some wx default wxChar* values into wxStrings.
29 DECLARE_DEF_STRING(NOTEBOOK_NAME);
30 DECLARE_DEF_STRING(PanelNameStr);
31 DECLARE_DEF_STRING(ControlNameStr);
32
33 static const wxChar* wxSplitterNameStr = wxT("splitter");
34 DECLARE_DEF_STRING(SplitterNameStr);
35 static const wxString wxPyEmptyString(wxT(""));
36 %}
37
38 //----------------------------------------------------------------------
39
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
51 %pragma(python) code = "import wx"
52
53 //---------------------------------------------------------------------------
54
55 enum {
56 // notebook control event types
57 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
58 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
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
74 };
75
76
77 class wxNotebookEvent : public wxNotifyEvent {
78 public:
79 wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
80 int sel = -1, int oldSel = -1);
81
82 int GetSelection();
83 int GetOldSelection();
84 void SetOldSelection(int page);
85 void SetSelection(int page);
86 };
87
88
89
90 class wxNotebook : public wxControl {
91 public:
92 wxNotebook(wxWindow *parent,
93 wxWindowID id,
94 const wxPoint& pos = wxDefaultPosition,
95 const wxSize& size = wxDefaultSize,
96 long style = 0,
97 const wxString& name = wxPyNOTEBOOK_NAME);
98 %name(wxPreNotebook)wxNotebook();
99
100 bool Create(wxWindow *parent,
101 wxWindowID id,
102 const wxPoint& pos = wxDefaultPosition,
103 const wxSize& size = wxDefaultSize,
104 long style = 0,
105 const wxString& name = wxPyNOTEBOOK_NAME);
106
107 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
108 %pragma(python) addtomethod = "wxPreNotebook:val._setOORInfo(val)"
109
110
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);
130 %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0"
131
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);
178
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);
191
192 };
193
194 //---------------------------------------------------------------------------
195
196
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,
203
204 wxSPLIT_HORIZONTAL,
205 wxSPLIT_VERTICAL,
206 wxSPLIT_DRAG_NONE,
207 wxSPLIT_DRAG_DRAGGING,
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
222 };
223
224
225 class wxSplitterEvent : public wxNotifyEvent {
226 public:
227 wxSplitterEvent(wxEventType type = wxEVT_NULL,
228 wxSplitterWindow *splitter = NULL);
229
230 int GetSashPosition();
231 int GetX();
232 int GetY();
233 wxWindow* GetWindowBeingRemoved();
234 void SetSashPosition(int pos);
235 }
236
237
238
239
240 class wxSplitterWindow : public wxWindow {
241 public:
242 wxSplitterWindow(wxWindow* parent, wxWindowID id,
243 const wxPoint& point = wxDefaultPosition,
244 const wxSize& size = wxDefaultSize,
245 long style=wxSP_3D|wxCLIP_CHILDREN,
246 const wxString& name = wxPySplitterNameStr);
247 %name(wxPreSplitterWindow)wxSplitterWindow();
248
249 bool Create(wxWindow* parent, wxWindowID id,
250 const wxPoint& point = wxDefaultPosition,
251 const wxSize& size = wxDefaultSize,
252 long style=wxSP_3D|wxCLIP_CHILDREN,
253 const wxString& name = wxPySplitterNameStr);
254
255 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
256 %pragma(python) addtomethod = "wxPreSplitterWindow:val._setOORInfo(val)"
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
268 int GetSplitMode();
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?
295 bool IsSplit();
296
297 // Sets the sash size
298 void SetSashSize(int width);
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
319 // Resizes subwindows
320 virtual void SizeWindows();
321
322 void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; }
323 bool GetNeedUpdating() const { return m_needUpdating ; }
324
325 };
326
327 //---------------------------------------------------------------------------
328
329 // TODO: This should be usable on wxGTK now too...
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 };
341
342
343 class wxTaskBarIconEvent : public wxEvent
344 {
345 public:
346 wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon);
347 };
348
349
350 class wxTaskBarIcon : public wxEvtHandler {
351 public:
352 wxTaskBarIcon();
353 ~wxTaskBarIcon();
354
355 //%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
356
357 // We still use the magic methods here since that is the way it is documented...
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)"
365
366 bool SetIcon(const wxIcon& icon, const wxString& tooltip = wxPyEmptyString);
367 bool RemoveIcon(void);
368 bool PopupMenu(wxMenu *menu);
369 bool IsIconInstalled();
370 bool IsOK();
371 };
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
399 #endif
400
401 //---------------------------------------------------------------------------
402 //---------------------------------------------------------------------------
403 // wxPyWindow derives from wxWindow and adds support for overriding many of
404 // the virtual methods in Python derived classes.
405
406 // Which (any?) of these should be done also???
407 // Destroy
408 // DoCaptureMouse
409 // DoClientToScreen
410 // DoHitTest
411 // DoMoveWindow
412 // DoPopupMenu
413 // DoReleaseMouse
414 // DoScreenToClient
415 // DoSetToolTip
416 // Enable
417 // Fit
418 // GetCharHeight
419 // GetCharWidth
420 // GetClientAreaOrigin
421 // GetDefaultItem
422 // IsTopLevel
423 // SetBackgroundColour
424 // SetDefaultItem
425 // SetFocus
426 // SetFocusFromKbd
427 // SetForegroundColour
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
468 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
469 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
470
471 PYPRIVATE;
472 };
473
474 IMPLEMENT_DYNAMIC_CLASS(wxPyWindow, wxWindow);
475
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);
480
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);
484
485 IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, DoGetVirtualSize);
486 IMP_PYCALLBACK_SIZE_const(wxPyWindow, wxWindow, DoGetBestSize);
487
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
497 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, AddChild);
498 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyWindow, wxWindow, RemoveChild);
499
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;
538
539 void base_AddChild(wxWindow* child);
540 void base_RemoveChild(wxWindow* child);
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
583 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
584 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
585
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
612 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild);
613 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild);
614
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;
654
655 void base_AddChild(wxWindow* child);
656 void base_RemoveChild(wxWindow* child);
657 }
658
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
697 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
698 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
699
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
726 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, AddChild);
727 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyPanel, wxPanel, RemoveChild);
728
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;
767
768 void base_AddChild(wxWindow* child);
769 void base_RemoveChild(wxWindow* child);
770 };
771
772
773 //---------------------------------------------------------------------------