]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: _pywindows.i | |
3 | // Purpose: SWIG interface for wxPyControl, See also _pywindows.i | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 2-June-1998 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 2003 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | // Not a %module | |
14 | ||
15 | ||
16 | //--------------------------------------------------------------------------- | |
17 | %newgroup | |
18 | ||
19 | ||
20 | ||
21 | //--------------------------------------------------------------------------- | |
22 | ||
23 | %{ // C++ version of Python aware wxControl | |
24 | class wxPyControl : public wxControl | |
25 | { | |
26 | DECLARE_DYNAMIC_CLASS(wxPyControl) | |
27 | public: | |
28 | wxPyControl() : wxControl() {} | |
29 | wxPyControl(wxWindow* parent, const wxWindowID id, | |
30 | const wxPoint& pos = wxDefaultPosition, | |
31 | const wxSize& size = wxDefaultSize, | |
32 | long style = 0, | |
33 | const wxValidator& validator=wxDefaultValidator, | |
34 | const wxString& name = wxPyControlNameStr) | |
35 | : wxControl(parent, id, pos, size, style, validator, name) {} | |
36 | ||
37 | void SetBestSize(const wxSize& size) { wxControl::SetBestSize(size); } | |
38 | ||
39 | DEC_PYCALLBACK_VOID_INT4(DoMoveWindow); | |
40 | DEC_PYCALLBACK_VOID_INT5(DoSetSize); | |
41 | DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize); | |
42 | DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize); | |
43 | ||
44 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize); | |
45 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize); | |
46 | DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition); | |
47 | ||
48 | DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize); | |
49 | DEC_PYCALLBACK_SIZE_const(DoGetBestSize); | |
50 | ||
51 | DEC_PYCALLBACK__(InitDialog); | |
52 | DEC_PYCALLBACK_BOOL_(TransferDataFromWindow); | |
53 | DEC_PYCALLBACK_BOOL_(TransferDataToWindow); | |
54 | DEC_PYCALLBACK_BOOL_(Validate); | |
55 | ||
56 | DEC_PYCALLBACK_BOOL_const(AcceptsFocus); | |
57 | DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard); | |
58 | DEC_PYCALLBACK_SIZE_const(GetMaxSize); | |
59 | ||
60 | DEC_PYCALLBACK_VOID_WXWINBASE(AddChild); | |
61 | DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild); | |
62 | ||
63 | DEC_PYCALLBACK_BOOL_const(ShouldInheritColours); | |
64 | DEC_PYCALLBACK__COLOUR(ApplyParentThemeBackground); | |
65 | DEC_PYCALLBACK_VIZATTR_(GetDefaultAttributes); | |
66 | ||
67 | PYPRIVATE; | |
68 | }; | |
69 | ||
70 | IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl); | |
71 | ||
72 | IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow); | |
73 | IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize); | |
74 | IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize); | |
75 | IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize); | |
76 | ||
77 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize); | |
78 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize); | |
79 | IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition); | |
80 | ||
81 | IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize); | |
82 | IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize); | |
83 | ||
84 | IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog); | |
85 | IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow); | |
86 | IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow); | |
87 | IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate); | |
88 | ||
89 | IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus); | |
90 | IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard); | |
91 | IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize); | |
92 | ||
93 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild); | |
94 | IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild); | |
95 | ||
96 | IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, ShouldInheritColours); | |
97 | IMP_PYCALLBACK__COLOUR(wxPyControl, wxControl, ApplyParentThemeBackground); | |
98 | IMP_PYCALLBACK_VIZATTR_(wxPyControl, wxControl, GetDefaultAttributes); | |
99 | %} | |
100 | ||
101 | // And now the one for SWIG to see | |
102 | MustHaveApp(wxPyControl); | |
103 | class wxPyControl : public wxControl | |
104 | { | |
105 | public: | |
106 | %pythonAppend wxPyControl "self._setOORInfo(self); self._setCallbackInfo(self, PyControl)" | |
107 | %pythonAppend wxPyControl() "" | |
108 | ||
109 | wxPyControl(wxWindow* parent, const wxWindowID id=-1, | |
110 | const wxPoint& pos = wxDefaultPosition, | |
111 | const wxSize& size = wxDefaultSize, | |
112 | long style = 0, | |
113 | const wxValidator& validator=wxDefaultValidator, | |
114 | const wxString& name = wxPyControlNameStr); | |
115 | ||
116 | %name(PrePyControl) wxPyControl(); | |
117 | ||
118 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
119 | ||
120 | void SetBestSize(const wxSize& size); | |
121 | ||
122 | void base_DoMoveWindow(int x, int y, int width, int height); | |
123 | void base_DoSetSize(int x, int y, int width, int height, | |
124 | int sizeFlags = wxSIZE_AUTO); | |
125 | void base_DoSetClientSize(int width, int height); | |
126 | void base_DoSetVirtualSize( int x, int y ); | |
127 | ||
128 | DocDeclA( | |
129 | void, base_DoGetSize( int *OUTPUT, int *OUTPUT ) const, | |
130 | "base_DoGetSize() -> (width, height)"); | |
131 | DocDeclA( | |
132 | void, base_DoGetClientSize( int *OUTPUT, int *OUTPUT ) const, | |
133 | "base_DoGetClientSize() -> (width, height)"); | |
134 | DocDeclA( | |
135 | void, base_DoGetPosition( int *OUTPUT, int *OUTPUT ) const, | |
136 | "base_DoGetPosition() -> (x,y)"); | |
137 | ||
138 | wxSize base_DoGetVirtualSize() const; | |
139 | wxSize base_DoGetBestSize() const; | |
140 | ||
141 | void base_InitDialog(); | |
142 | bool base_TransferDataToWindow(); | |
143 | bool base_TransferDataFromWindow(); | |
144 | bool base_Validate(); | |
145 | ||
146 | bool base_AcceptsFocus() const; | |
147 | bool base_AcceptsFocusFromKeyboard() const; | |
148 | wxSize base_GetMaxSize() const; | |
149 | ||
150 | void base_AddChild(wxWindow* child); | |
151 | void base_RemoveChild(wxWindow* child); | |
152 | ||
153 | bool base_ShouldInheritColours() const; | |
154 | void base_ApplyParentThemeBackground(const wxColour& c); | |
155 | wxVisualAttributes base_GetDefaultAttributes(); | |
156 | }; | |
157 | ||
158 | ||
159 | //--------------------------------------------------------------------------- | |
160 | //--------------------------------------------------------------------------- |