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