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