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