]>
Commit | Line | Data |
---|---|---|
08127323 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: windows3.i | |
3 | // Purpose: SWIG definitions of MORE window classes | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 22-Dec-1998 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 1998 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | %module windows3 | |
14 | ||
15 | %{ | |
16 | #include "helpers.h" | |
17 | #include <wx/sashwin.h> | |
18 | #include <wx/laywin.h> | |
e6056257 | 19 | #ifndef __WXMAC__ |
0122b7e3 | 20 | #include <wx/popupwin.h> |
e6056257 | 21 | #endif |
08127323 RD |
22 | %} |
23 | ||
24 | //---------------------------------------------------------------------- | |
25 | ||
26 | %include typemaps.i | |
27 | %include my_typemaps.i | |
28 | ||
29 | // Import some definitions of other classes, etc. | |
30 | %import _defs.i | |
31 | %import misc.i | |
32 | %import gdi.i | |
33 | %import windows.i | |
34 | %import windows2.i | |
35 | %import mdi.i | |
36 | %import events.i | |
37 | ||
38 | %pragma(python) code = "import wx" | |
39 | ||
40 | //--------------------------------------------------------------------------- | |
41 | ||
42 | enum wxSashEdgePosition { | |
43 | wxSASH_TOP = 0, | |
44 | wxSASH_RIGHT, | |
45 | wxSASH_BOTTOM, | |
46 | wxSASH_LEFT, | |
47 | wxSASH_NONE = 100 | |
48 | }; | |
49 | ||
50 | enum { | |
51 | wxEVT_SASH_DRAGGED, | |
52 | wxSW_3D, | |
1b62f00d RD |
53 | wxSW_3DSASH, |
54 | wxSW_3DBORDER, | |
55 | wxSW_BORDER | |
08127323 RD |
56 | }; |
57 | ||
58 | enum wxSashDragStatus | |
59 | { | |
60 | wxSASH_STATUS_OK, | |
61 | wxSASH_STATUS_OUT_OF_RANGE | |
62 | }; | |
63 | ||
64 | ||
65 | class wxSashEvent : public wxCommandEvent { | |
66 | public: | |
09f3d4e6 RD |
67 | wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE); |
68 | ||
08127323 RD |
69 | void SetEdge(wxSashEdgePosition edge); |
70 | wxSashEdgePosition GetEdge(); | |
71 | void SetDragRect(const wxRect& rect); | |
72 | wxRect GetDragRect(); | |
73 | void SetDragStatus(wxSashDragStatus status); | |
74 | wxSashDragStatus GetDragStatus(); | |
75 | }; | |
76 | ||
77 | ||
78 | ||
79 | class wxSashWindow: public wxWindow { | |
80 | public: | |
81 | wxSashWindow(wxWindow* parent, wxWindowID id, | |
b68dc582 RD |
82 | const wxPoint& pos = wxDefaultPosition, |
83 | const wxSize& size = wxDefaultSize, | |
08127323 RD |
84 | long style = wxCLIP_CHILDREN | wxSW_3D, |
85 | const char* name = "sashWindow"); | |
09f3d4e6 | 86 | %name(wxPreSashWindow)wxSashWindow(); |
08127323 | 87 | |
09f3d4e6 RD |
88 | bool Create(wxWindow* parent, wxWindowID id, |
89 | const wxPoint& pos = wxDefaultPosition, | |
90 | const wxSize& size = wxDefaultSize, | |
91 | long style = wxCLIP_CHILDREN | wxSW_3D, | |
92 | const char* name = "sashWindow"); | |
08127323 | 93 | |
0122b7e3 | 94 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 95 | %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)" |
0122b7e3 | 96 | |
08127323 RD |
97 | bool GetSashVisible(wxSashEdgePosition edge); |
98 | int GetDefaultBorderSize(); | |
99 | int GetEdgeMargin(wxSashEdgePosition edge); | |
100 | int GetExtraBorderSize(); | |
101 | int GetMaximumSizeX(); | |
102 | int GetMaximumSizeY(); | |
103 | int GetMinimumSizeX(); | |
104 | int GetMinimumSizeY(); | |
105 | bool HasBorder(wxSashEdgePosition edge); | |
106 | void SetDefaultBorderSize(int width); | |
107 | void SetExtraBorderSize(int width); | |
108 | void SetMaximumSizeX(int min); | |
109 | void SetMaximumSizeY(int min); | |
110 | void SetMinimumSizeX(int min); | |
111 | void SetMinimumSizeY(int min); | |
112 | void SetSashVisible(wxSashEdgePosition edge, bool visible); | |
113 | void SetSashBorder(wxSashEdgePosition edge, bool hasBorder); | |
114 | ||
115 | }; | |
116 | ||
117 | ||
118 | //--------------------------------------------------------------------------- | |
119 | ||
120 | enum wxLayoutOrientation { | |
121 | wxLAYOUT_HORIZONTAL, | |
122 | wxLAYOUT_VERTICAL | |
123 | }; | |
124 | ||
125 | enum wxLayoutAlignment { | |
126 | wxLAYOUT_NONE, | |
127 | wxLAYOUT_TOP, | |
128 | wxLAYOUT_LEFT, | |
129 | wxLAYOUT_RIGHT, | |
130 | wxLAYOUT_BOTTOM, | |
131 | }; | |
132 | ||
133 | ||
134 | enum { | |
135 | wxEVT_QUERY_LAYOUT_INFO, | |
136 | wxEVT_CALCULATE_LAYOUT, | |
137 | }; | |
138 | ||
139 | ||
140 | class wxQueryLayoutInfoEvent: public wxEvent { | |
141 | public: | |
09f3d4e6 | 142 | wxQueryLayoutInfoEvent(wxWindowID id = 0); |
08127323 RD |
143 | |
144 | void SetRequestedLength(int length); | |
145 | int GetRequestedLength(); | |
146 | void SetFlags(int flags); | |
147 | int GetFlags(); | |
148 | void SetSize(const wxSize& size); | |
149 | wxSize GetSize(); | |
150 | void SetOrientation(wxLayoutOrientation orient); | |
151 | wxLayoutOrientation GetOrientation(); | |
152 | void SetAlignment(wxLayoutAlignment align); | |
153 | wxLayoutAlignment GetAlignment(); | |
154 | }; | |
155 | ||
156 | ||
157 | ||
158 | class wxCalculateLayoutEvent: public wxEvent { | |
159 | public: | |
09f3d4e6 RD |
160 | wxCalculateLayoutEvent(wxWindowID id = 0); |
161 | ||
08127323 RD |
162 | void SetFlags(int flags); |
163 | int GetFlags(); | |
164 | void SetRect(const wxRect& rect); | |
165 | wxRect GetRect(); | |
166 | }; | |
167 | ||
168 | ||
169 | class wxSashLayoutWindow: public wxSashWindow { | |
170 | public: | |
171 | wxSashLayoutWindow(wxWindow* parent, wxWindowID id, | |
b68dc582 RD |
172 | const wxPoint& pos = wxDefaultPosition, |
173 | const wxSize& size = wxDefaultSize, | |
08127323 RD |
174 | long style = wxCLIP_CHILDREN | wxSW_3D, |
175 | const char* name = "layoutWindow"); | |
09f3d4e6 | 176 | %name(wxPreSashLayoutWindow)wxSashLayoutWindow(); |
08127323 | 177 | |
09f3d4e6 RD |
178 | bool Create(wxWindow* parent, wxWindowID id, |
179 | const wxPoint& pos = wxDefaultPosition, | |
180 | const wxSize& size = wxDefaultSize, | |
181 | long style = wxCLIP_CHILDREN | wxSW_3D, | |
182 | const char* name = "layoutWindow"); | |
08127323 | 183 | |
0122b7e3 | 184 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" |
17c0e08c | 185 | %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)" |
0122b7e3 | 186 | |
08127323 RD |
187 | wxLayoutAlignment GetAlignment(); |
188 | wxLayoutOrientation GetOrientation(); | |
189 | void SetAlignment(wxLayoutAlignment alignment); | |
190 | void SetDefaultSize(const wxSize& size); | |
191 | void SetOrientation(wxLayoutOrientation orientation); | |
192 | }; | |
193 | ||
194 | //--------------------------------------------------------------------------- | |
195 | ||
9416aa89 | 196 | class wxLayoutAlgorithm : public wxObject { |
08127323 RD |
197 | public: |
198 | wxLayoutAlgorithm(); | |
199 | ~wxLayoutAlgorithm(); | |
200 | ||
201 | bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL); | |
202 | bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL); | |
cf694132 | 203 | bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL); |
08127323 RD |
204 | }; |
205 | ||
206 | ||
207 | //--------------------------------------------------------------------------- | |
e6056257 | 208 | #ifndef __WXMAC__ |
2abc0a0f | 209 | |
0122b7e3 RD |
210 | // wxPopupWindow: a special kind of top level window used for popup menus, |
211 | // combobox popups and such. | |
212 | class wxPopupWindow : public wxWindow { | |
213 | public: | |
214 | wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE); | |
215 | %name(wxPrePopupWindow)wxPopupWindow(); | |
216 | ||
217 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
17c0e08c | 218 | %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(val)" |
0122b7e3 RD |
219 | |
220 | bool Create(wxWindow *parent, int flags = wxBORDER_NONE); | |
221 | ||
98624b49 | 222 | // the point must be given in screen coordinates! |
0122b7e3 RD |
223 | void Position(const wxPoint& ptOrigin, |
224 | const wxSize& size); | |
225 | }; | |
226 | ||
227 | ||
228 | %{ | |
229 | class wxPyPopupTransientWindow : public wxPopupTransientWindow | |
230 | { | |
231 | public: | |
232 | wxPyPopupTransientWindow() : wxPopupTransientWindow() {} | |
233 | wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE) | |
234 | : wxPopupTransientWindow(parent, style) {} | |
235 | ||
236 | DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown); | |
a57d56d6 | 237 | DEC_PYCALLBACK__(OnDismiss); |
0122b7e3 RD |
238 | PYPRIVATE; |
239 | }; | |
240 | ||
241 | IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown); | |
a57d56d6 | 242 | IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss); |
0122b7e3 RD |
243 | %} |
244 | ||
245 | ||
246 | ||
247 | // wxPopupTransientWindow: a wxPopupWindow which disappears automatically | |
248 | // when the user clicks mouse outside it or if it loses focus in any other way | |
249 | %name(wxPopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow | |
250 | { | |
251 | public: | |
252 | wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE); | |
253 | %name(wxPrePopupTransientWindow)wxPyPopupTransientWindow(); | |
254 | ||
255 | void _setCallbackInfo(PyObject* self, PyObject* _class); | |
256 | %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPopupTransientWindow)" | |
257 | ||
258 | %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" | |
17c0e08c | 259 | %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(val)" |
0122b7e3 RD |
260 | |
261 | // popup the window (this will show it too) and keep focus at winFocus | |
262 | // (or itself if it's NULL), dismiss the popup if we lose focus | |
263 | virtual void Popup(wxWindow *focus = NULL); | |
264 | ||
265 | // hide the window | |
266 | virtual void Dismiss(); | |
267 | }; | |
268 | ||
e6056257 | 269 | #endif |
0122b7e3 RD |
270 | //--------------------------------------------------------------------------- |
271 |