]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/windows3.i
added renderer.h/.cpp
[wxWidgets.git] / wxPython / src / windows3.i
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>
19 #include <wx/popupwin.h>
20 #include <wx/tipwin.h>
21 %}
22
23 //----------------------------------------------------------------------
24
25 %include typemaps.i
26 %include my_typemaps.i
27
28 // Import some definitions of other classes, etc.
29 %import _defs.i
30 %import misc.i
31 %import gdi.i
32 %import windows.i
33 %import windows2.i
34 %import mdi.i
35 %import events.i
36
37 %pragma(python) code = "import wx"
38
39 //----------------------------------------------------------------------
40
41 %{
42 // Put some wx default wxChar* values into wxStrings.
43 static const wxChar* wxSashNameStr = wxT("sashWindow");
44 DECLARE_DEF_STRING(SashNameStr);
45 static const wxChar* wxSashLayoutNameStr = wxT("layoutWindow");
46 DECLARE_DEF_STRING(SashLayoutNameStr);
47 %}
48 //---------------------------------------------------------------------------
49
50 enum wxSashEdgePosition {
51 wxSASH_TOP = 0,
52 wxSASH_RIGHT,
53 wxSASH_BOTTOM,
54 wxSASH_LEFT,
55 wxSASH_NONE = 100
56 };
57
58 enum {
59 wxEVT_SASH_DRAGGED,
60 wxSW_3D,
61 wxSW_3DSASH,
62 wxSW_3DBORDER,
63 wxSW_BORDER
64 };
65
66 enum wxSashDragStatus
67 {
68 wxSASH_STATUS_OK,
69 wxSASH_STATUS_OUT_OF_RANGE
70 };
71
72
73 class wxSashEvent : public wxCommandEvent {
74 public:
75 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
76
77 void SetEdge(wxSashEdgePosition edge);
78 wxSashEdgePosition GetEdge();
79 void SetDragRect(const wxRect& rect);
80 wxRect GetDragRect();
81 void SetDragStatus(wxSashDragStatus status);
82 wxSashDragStatus GetDragStatus();
83 };
84
85
86
87 class wxSashWindow: public wxWindow {
88 public:
89 wxSashWindow(wxWindow* parent, wxWindowID id,
90 const wxPoint& pos = wxDefaultPosition,
91 const wxSize& size = wxDefaultSize,
92 long style = wxCLIP_CHILDREN | wxSW_3D,
93 const wxString& name = wxPySashNameStr);
94 %name(wxPreSashWindow)wxSashWindow();
95
96 bool Create(wxWindow* parent, wxWindowID id,
97 const wxPoint& pos = wxDefaultPosition,
98 const wxSize& size = wxDefaultSize,
99 long style = wxCLIP_CHILDREN | wxSW_3D,
100 const wxString& name = wxPySashNameStr);
101
102 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
103 %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)"
104
105 bool GetSashVisible(wxSashEdgePosition edge);
106 int GetDefaultBorderSize();
107 int GetEdgeMargin(wxSashEdgePosition edge);
108 int GetExtraBorderSize();
109 int GetMaximumSizeX();
110 int GetMaximumSizeY();
111 int GetMinimumSizeX();
112 int GetMinimumSizeY();
113 bool HasBorder(wxSashEdgePosition edge);
114 void SetDefaultBorderSize(int width);
115 void SetExtraBorderSize(int width);
116 void SetMaximumSizeX(int min);
117 void SetMaximumSizeY(int min);
118 void SetMinimumSizeX(int min);
119 void SetMinimumSizeY(int min);
120 void SetSashVisible(wxSashEdgePosition edge, bool visible);
121 void SetSashBorder(wxSashEdgePosition edge, bool hasBorder);
122
123 };
124
125
126 //---------------------------------------------------------------------------
127
128 enum wxLayoutOrientation {
129 wxLAYOUT_HORIZONTAL,
130 wxLAYOUT_VERTICAL
131 };
132
133 enum wxLayoutAlignment {
134 wxLAYOUT_NONE,
135 wxLAYOUT_TOP,
136 wxLAYOUT_LEFT,
137 wxLAYOUT_RIGHT,
138 wxLAYOUT_BOTTOM,
139 };
140
141
142 enum {
143 wxEVT_QUERY_LAYOUT_INFO,
144 wxEVT_CALCULATE_LAYOUT,
145 };
146
147
148 class wxQueryLayoutInfoEvent: public wxEvent {
149 public:
150 wxQueryLayoutInfoEvent(wxWindowID id = 0);
151
152 void SetRequestedLength(int length);
153 int GetRequestedLength();
154 void SetFlags(int flags);
155 int GetFlags();
156 void SetSize(const wxSize& size);
157 wxSize GetSize();
158 void SetOrientation(wxLayoutOrientation orient);
159 wxLayoutOrientation GetOrientation();
160 void SetAlignment(wxLayoutAlignment align);
161 wxLayoutAlignment GetAlignment();
162 };
163
164
165
166 class wxCalculateLayoutEvent: public wxEvent {
167 public:
168 wxCalculateLayoutEvent(wxWindowID id = 0);
169
170 void SetFlags(int flags);
171 int GetFlags();
172 void SetRect(const wxRect& rect);
173 wxRect GetRect();
174 };
175
176
177 class wxSashLayoutWindow: public wxSashWindow {
178 public:
179 wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
180 const wxPoint& pos = wxDefaultPosition,
181 const wxSize& size = wxDefaultSize,
182 long style = wxCLIP_CHILDREN | wxSW_3D,
183 const wxString& name = wxPySashLayoutNameStr);
184 %name(wxPreSashLayoutWindow)wxSashLayoutWindow();
185
186 bool Create(wxWindow* parent, wxWindowID id,
187 const wxPoint& pos = wxDefaultPosition,
188 const wxSize& size = wxDefaultSize,
189 long style = wxCLIP_CHILDREN | wxSW_3D,
190 const wxString& name = wxPySashLayoutNameStr);
191
192 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
193 %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)"
194
195 wxLayoutAlignment GetAlignment();
196 wxLayoutOrientation GetOrientation();
197 void SetAlignment(wxLayoutAlignment alignment);
198 void SetDefaultSize(const wxSize& size);
199 void SetOrientation(wxLayoutOrientation orientation);
200 };
201
202 //---------------------------------------------------------------------------
203
204 class wxLayoutAlgorithm : public wxObject {
205 public:
206 wxLayoutAlgorithm();
207 ~wxLayoutAlgorithm();
208
209 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
210 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
211 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
212 };
213
214
215 //---------------------------------------------------------------------------
216 #ifndef __WXMAC__
217
218 // wxPopupWindow: a special kind of top level window used for popup menus,
219 // combobox popups and such.
220 class wxPopupWindow : public wxWindow {
221 public:
222 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
223 %name(wxPrePopupWindow)wxPopupWindow();
224
225 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
226 %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(val)"
227
228 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
229
230 // the point must be given in screen coordinates!
231 void Position(const wxPoint& ptOrigin,
232 const wxSize& size);
233 };
234
235
236 %{
237 class wxPyPopupTransientWindow : public wxPopupTransientWindow
238 {
239 public:
240 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
241 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
242 : wxPopupTransientWindow(parent, style) {}
243
244 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
245 DEC_PYCALLBACK__(OnDismiss);
246 DEC_PYCALLBACK_BOOL_(CanDismiss);
247 PYPRIVATE;
248 };
249
250 IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
251 IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
252 IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
253 %}
254
255
256
257 // wxPopupTransientWindow: a wxPopupWindow which disappears automatically
258 // when the user clicks mouse outside it or if it loses focus in any other way
259 %name(wxPopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
260 {
261 public:
262 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
263 %name(wxPrePopupTransientWindow)wxPyPopupTransientWindow();
264
265 void _setCallbackInfo(PyObject* self, PyObject* _class);
266 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPopupTransientWindow)"
267
268 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
269 %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(val)"
270
271 // popup the window (this will show it too) and keep focus at winFocus
272 // (or itself if it's NULL), dismiss the popup if we lose focus
273 virtual void Popup(wxWindow *focus = NULL);
274
275 // hide the window
276 virtual void Dismiss();
277 };
278
279 //---------------------------------------------------------------------------
280
281 class wxTipWindow : public wxPyPopupTransientWindow
282 {
283 public:
284 %addmethods {
285 wxTipWindow(wxWindow *parent,
286 const wxString* text,
287 wxCoord maxLength = 100,
288 wxRect* rectBound = NULL) {
289 wxString tmp = *text;
290 return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound);
291 }
292 }
293
294 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
295
296 // If rectBound is not NULL, the window will disappear automatically when
297 // the mouse leave the specified rect: note that rectBound should be in the
298 // screen coordinates!
299 void SetBoundingRect(const wxRect& rectBound);
300
301 // Hide and destroy the window
302 void Close();
303 };
304
305 #endif // ! __WXMAC__
306
307 //---------------------------------------------------------------------------
308
309 #ifdef __WXMAC__
310
311 %import frames.i
312
313 class wxTipWindow : public wxFrame
314 {
315 public:
316 %addmethods {
317 wxTipWindow(wxWindow *parent,
318 const wxString* text,
319 wxCoord maxLength = 100,
320 wxRect* rectBound = NULL) {
321 wxString tmp = *text;
322 return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound);
323 }
324 }
325
326 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
327
328 // If rectBound is not NULL, the window will disappear automatically when
329 // the mouse leave the specified rect: note that rectBound should be in the
330 // screen coordinates!
331 void SetBoundingRect(const wxRect& rectBound);
332
333 // Hide and destroy the window
334 void Close();
335 };
336
337 #endif // __WXMAC__
338
339 //---------------------------------------------------------------------------
340