1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for wxPyControl, See also _pywindows.i
7 // Created: 2-June-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
20 // TODO: Virtualize ShouldInheritColours
22 //---------------------------------------------------------------------------
24 %{ // C++ version of Python aware wxControl
25 class wxPyControl : public wxControl
27 DECLARE_DYNAMIC_CLASS(wxPyControl)
29 wxPyControl() : wxControl() {}
30 wxPyControl(wxWindow* parent, const wxWindowID id,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
34 const wxValidator& validator=wxDefaultValidator,
35 const wxString& name = wxPyControlNameStr)
36 : wxControl(parent, id, pos, size, style, validator, name) {}
39 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
40 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
41 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
42 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
44 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
45 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
46 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
48 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
49 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
51 DEC_PYCALLBACK__(InitDialog);
52 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
53 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
54 DEC_PYCALLBACK_BOOL_(Validate);
56 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
57 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
58 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
60 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
61 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
63 DEC_PYCALLBACK_BOOL_(ShouldInheritColours);
68 IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl);
70 IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow);
71 IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize);
72 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize);
73 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize);
75 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize);
76 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize);
77 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition);
79 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize);
80 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize);
82 IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog);
83 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow);
84 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow);
85 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate);
87 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus);
88 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard);
89 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize);
91 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild);
92 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild);
94 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, ShouldInheritColours);
97 // And now the one for SWIG to see
98 class wxPyControl : public wxControl
101 %pythonAppend wxPyControl "self._setOORInfo(self); self._setCallbackInfo(self, PyControl)"
103 wxPyControl(wxWindow* parent, const wxWindowID id,
104 const wxPoint& pos = wxDefaultPosition,
105 const wxSize& size = wxDefaultSize,
107 const wxValidator& validator=wxDefaultValidator,
108 const wxString& name = wxPyControlNameStr);
110 void _setCallbackInfo(PyObject* self, PyObject* _class);
111 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyControl)"
112 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
115 void base_DoMoveWindow(int x, int y, int width, int height);
116 void base_DoSetSize(int x, int y, int width, int height,
117 int sizeFlags = wxSIZE_AUTO);
118 void base_DoSetClientSize(int width, int height);
119 void base_DoSetVirtualSize( int x, int y );
122 void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const,
123 "base_DoGetSize() -> (width, height)");
125 void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
126 "base_DoGetClientSize() -> (width, height)");
128 void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
129 "base_DoGetPosition() -> (x,y)");
131 wxSize base_DoGetVirtualSize() const;
132 wxSize base_DoGetBestSize() const;
134 void base_InitDialog();
135 bool base_TransferDataToWindow();
136 bool base_TransferDataFromWindow();
137 bool base_Validate();
139 bool base_AcceptsFocus() const;
140 bool base_AcceptsFocusFromKeyboard() const;
141 wxSize base_GetMaxSize() const;
143 void base_AddChild(wxWindow* child);
144 void base_RemoveChild(wxWindow* child);
148 //---------------------------------------------------------------------------
149 //---------------------------------------------------------------------------