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) {}
37 void SetBestSize(const wxSize& size) { wxControl::SetBestSize(size); }
39 bool DoEraseBackground(wxDC* dc) {
41 return wxWindow::DoEraseBackground(dc->GetHDC());
43 dc->SetBackground(wxBrush(GetBackgroundColour()));
49 DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
50 DEC_PYCALLBACK_VOID_INT5(DoSetSize);
51 DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
52 DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
54 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
55 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
56 DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
58 DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
59 DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
61 DEC_PYCALLBACK__(InitDialog);
62 DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
63 DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
64 DEC_PYCALLBACK_BOOL_(Validate);
66 DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
67 DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
68 DEC_PYCALLBACK_SIZE_const(GetMaxSize);
70 DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
71 DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
73 DEC_PYCALLBACK_BOOL_const(ShouldInheritColours);
74 DEC_PYCALLBACK_VIZATTR_(GetDefaultAttributes);
76 DEC_PYCALLBACK_BOOL_(HasTransparentBackground);
81 IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl);
83 IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow);
84 IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize);
85 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize);
86 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize);
88 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize);
89 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize);
90 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition);
92 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize);
93 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize);
95 IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog);
96 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow);
97 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow);
98 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate);
100 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus);
101 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard);
102 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize);
104 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild);
105 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild);
107 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, ShouldInheritColours);
108 IMP_PYCALLBACK_VIZATTR_(wxPyControl, wxControl, GetDefaultAttributes);
110 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, HasTransparentBackground);
113 // And now the one for SWIG to see
114 MustHaveApp(wxPyControl);
115 class wxPyControl : public wxControl
118 %pythonAppend wxPyControl "self._setOORInfo(self); self._setCallbackInfo(self, PyControl)"
119 %pythonAppend wxPyControl() ""
121 wxPyControl(wxWindow* parent, const wxWindowID id=-1,
122 const wxPoint& pos = wxDefaultPosition,
123 const wxSize& size = wxDefaultSize,
125 const wxValidator& validator=wxDefaultValidator,
126 const wxString& name = wxPyControlNameStr);
128 %RenameCtor(PrePyControl, wxPyControl());
130 void _setCallbackInfo(PyObject* self, PyObject* _class);
132 void SetBestSize(const wxSize& size);
133 bool DoEraseBackground(wxDC* dc);
135 void base_DoMoveWindow(int x, int y, int width, int height);
136 void base_DoSetSize(int x, int y, int width, int height,
137 int sizeFlags = wxSIZE_AUTO);
138 void base_DoSetClientSize(int width, int height);
139 void base_DoSetVirtualSize( int x, int y );
142 void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const,
143 "base_DoGetSize() -> (width, height)");
145 void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
146 "base_DoGetClientSize() -> (width, height)");
148 void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
149 "base_DoGetPosition() -> (x,y)");
151 wxSize base_DoGetVirtualSize() const;
152 wxSize base_DoGetBestSize() const;
154 void base_InitDialog();
155 bool base_TransferDataToWindow();
156 bool base_TransferDataFromWindow();
157 bool base_Validate();
159 bool base_AcceptsFocus() const;
160 bool base_AcceptsFocusFromKeyboard() const;
161 wxSize base_GetMaxSize() const;
163 void base_AddChild(wxWindow* child);
164 void base_RemoveChild(wxWindow* child);
166 bool base_ShouldInheritColours() const;
167 wxVisualAttributes base_GetDefaultAttributes();
171 //---------------------------------------------------------------------------
172 //---------------------------------------------------------------------------