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