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