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 //---------------------------------------------------------------------------
21 //---------------------------------------------------------------------------
23 %{ // C++ version of Python aware wxControl
24 class wxPyControl : public wxControl
26 DECLARE_DYNAMIC_CLASS(wxPyControl)
28 wxPyControl() : wxControl() {}
29 wxPyControl(wxWindow* parent, const wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
33 const wxValidator& validator=wxDefaultValidator,
34 const wxString& name = wxPyControlNameStr)
35 : wxControl(parent, id, pos, size, style, validator, name) {}
38 bool DoEraseBackground(wxDC* dc) {
40 return wxWindow::DoEraseBackground(dc->GetHDC());
42 dc->SetBackground(wxBrush(GetBackgroundColour()));
48 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
49 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
50 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
51 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
53 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
54 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
55 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
57 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
58 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
60 DEC_PYCALLBACK__(InitDialog);
61 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
62 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
63 DEC_PYCALLBACK_BOOL_(Validate);
65 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
66 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
67 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
69 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
70 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
72 DEC_PYCALLBACK_BOOL_const(ShouldInheritColours);
73 DEC_PYCALLBACK_VIZATTR_(GetDefaultAttributes);
75 DEC_PYCALLBACK_BOOL_(HasTransparentBackground);
77 DEC_PYCALLBACK_VOID_(OnInternalIdle);
82 IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl);
84 IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow);
85 IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize);
86 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize);
87 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize);
89 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize);
90 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize);
91 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition);
93 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize);
94 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize);
96 IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog);
97 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow);
98 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow);
99 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate);
101 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus);
102 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard);
103 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize);
105 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild);
106 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild);
108 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, ShouldInheritColours);
109 IMP_PYCALLBACK_VIZATTR_(wxPyControl, wxControl, GetDefaultAttributes);
111 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, HasTransparentBackground);
113 IMP_PYCALLBACK_VOID_(wxPyControl, wxControl, OnInternalIdle);
116 // And now the one for SWIG to see
117 MustHaveApp(wxPyControl);
118 class wxPyControl : public wxControl
121 %pythonAppend wxPyControl "self._setOORInfo(self); self._setCallbackInfo(self, PyControl)"
122 %pythonAppend wxPyControl() ""
124 wxPyControl(wxWindow* parent, const wxWindowID id=-1,
125 const wxPoint& pos = wxDefaultPosition,
126 const wxSize& size = wxDefaultSize,
128 const wxValidator& validator=wxDefaultValidator,
129 const wxString& name = wxPyControlNameStr);
131 %RenameCtor(PrePyControl, wxPyControl());
133 void _setCallbackInfo(PyObject* self, PyObject* _class);
135 bool DoEraseBackground(wxDC* dc);
137 void DoMoveWindow(int x, int y, int width, int height);
138 void DoSetSize(int x, int y, int width, int height,
139 int sizeFlags = wxSIZE_AUTO);
140 void DoSetClientSize(int width, int height);
141 void DoSetVirtualSize( int x, int y );
144 void, DoGetSize( int *OUTPUT, int *OUTPUT ) const,
145 "DoGetSize() -> (width, height)");
147 void, DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
148 "DoGetClientSize() -> (width, height)");
150 void, DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
151 "DoGetPosition() -> (x,y)");
153 wxSize DoGetVirtualSize() const;
154 wxSize DoGetBestSize() const;
157 bool TransferDataToWindow();
158 bool TransferDataFromWindow();
161 bool AcceptsFocus() const;
162 bool AcceptsFocusFromKeyboard() const;
163 wxSize GetMaxSize() const;
165 void AddChild(wxWindow* child);
166 void RemoveChild(wxWindow* child);
168 bool ShouldInheritColours() const;
169 wxVisualAttributes GetDefaultAttributes();
171 void OnInternalIdle();
173 %MAKE_BASE_FUNC(PyScrolledWindow, DoMoveWindow);
174 %MAKE_BASE_FUNC(PyScrolledWindow, DoSetSize);
175 %MAKE_BASE_FUNC(PyScrolledWindow, DoSetClientSize);
176 %MAKE_BASE_FUNC(PyScrolledWindow, DoSetVirtualSize);
177 %MAKE_BASE_FUNC(PyScrolledWindow, DoGetSize);
178 %MAKE_BASE_FUNC(PyScrolledWindow, DoGetClientSize);
179 %MAKE_BASE_FUNC(PyScrolledWindow, DoGetPosition);
180 %MAKE_BASE_FUNC(PyScrolledWindow, DoGetVirtualSize);
181 %MAKE_BASE_FUNC(PyScrolledWindow, DoGetBestSize);
182 %MAKE_BASE_FUNC(PyScrolledWindow, InitDialog);
183 %MAKE_BASE_FUNC(PyScrolledWindow, TransferDataToWindow);
184 %MAKE_BASE_FUNC(PyScrolledWindow, TransferDataFromWindow);
185 %MAKE_BASE_FUNC(PyScrolledWindow, Validate);
186 %MAKE_BASE_FUNC(PyScrolledWindow, AcceptsFocus);
187 %MAKE_BASE_FUNC(PyScrolledWindow, AcceptsFocusFromKeyboard);
188 %MAKE_BASE_FUNC(PyScrolledWindow, GetMaxSize);
189 %MAKE_BASE_FUNC(PyScrolledWindow, AddChild);
190 %MAKE_BASE_FUNC(PyScrolledWindow, RemoveChild);
191 %MAKE_BASE_FUNC(PyScrolledWindow, ShouldInheritColours);
192 %MAKE_BASE_FUNC(PyScrolledWindow, GetDefaultAttributes);
193 %MAKE_BASE_FUNC(PyScrolledWindow, OnInternalIdle);
198 //---------------------------------------------------------------------------
199 //---------------------------------------------------------------------------