1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions of MORE window classes
7 // Created: 22-Dec-1998
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 #include <wx/sashwin.h>
18 #include <wx/laywin.h>
20 #include <wx/popupwin.h>
21 #include <wx/tipwin.h>
25 //----------------------------------------------------------------------
28 %include my_typemaps.i
30 // Import some definitions of other classes, etc.
39 %pragma(python) code = "import wx"
41 //----------------------------------------------------------------------
44 // Put some wx default wxChar* values into wxStrings.
45 static const wxChar* wxSashNameStr = wxT("sashWindow");
46 DECLARE_DEF_STRING(SashNameStr);
47 static const wxChar* wxSashLayoutNameStr = wxT("layoutWindow");
48 DECLARE_DEF_STRING(SashLayoutNameStr);
50 //---------------------------------------------------------------------------
52 enum wxSashEdgePosition {
71 wxSASH_STATUS_OUT_OF_RANGE
75 class wxSashEvent : public wxCommandEvent {
77 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
79 void SetEdge(wxSashEdgePosition edge);
80 wxSashEdgePosition GetEdge();
81 void SetDragRect(const wxRect& rect);
83 void SetDragStatus(wxSashDragStatus status);
84 wxSashDragStatus GetDragStatus();
89 class wxSashWindow: public wxWindow {
91 wxSashWindow(wxWindow* parent, wxWindowID id,
92 const wxPoint& pos = wxDefaultPosition,
93 const wxSize& size = wxDefaultSize,
94 long style = wxCLIP_CHILDREN | wxSW_3D,
95 const wxString& name = wxPySashNameStr);
96 %name(wxPreSashWindow)wxSashWindow();
98 bool Create(wxWindow* parent, wxWindowID id,
99 const wxPoint& pos = wxDefaultPosition,
100 const wxSize& size = wxDefaultSize,
101 long style = wxCLIP_CHILDREN | wxSW_3D,
102 const wxString& name = wxPySashNameStr);
104 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
105 %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)"
107 bool GetSashVisible(wxSashEdgePosition edge);
108 int GetDefaultBorderSize();
109 int GetEdgeMargin(wxSashEdgePosition edge);
110 int GetExtraBorderSize();
111 int GetMaximumSizeX();
112 int GetMaximumSizeY();
113 int GetMinimumSizeX();
114 int GetMinimumSizeY();
115 bool HasBorder(wxSashEdgePosition edge);
116 void SetDefaultBorderSize(int width);
117 void SetExtraBorderSize(int width);
118 void SetMaximumSizeX(int min);
119 void SetMaximumSizeY(int min);
120 void SetMinimumSizeX(int min);
121 void SetMinimumSizeY(int min);
122 void SetSashVisible(wxSashEdgePosition edge, bool visible);
123 void SetSashBorder(wxSashEdgePosition edge, bool hasBorder);
128 //---------------------------------------------------------------------------
130 enum wxLayoutOrientation {
135 enum wxLayoutAlignment {
145 wxEVT_QUERY_LAYOUT_INFO,
146 wxEVT_CALCULATE_LAYOUT,
150 class wxQueryLayoutInfoEvent: public wxEvent {
152 wxQueryLayoutInfoEvent(wxWindowID id = 0);
154 void SetRequestedLength(int length);
155 int GetRequestedLength();
156 void SetFlags(int flags);
158 void SetSize(const wxSize& size);
160 void SetOrientation(wxLayoutOrientation orient);
161 wxLayoutOrientation GetOrientation();
162 void SetAlignment(wxLayoutAlignment align);
163 wxLayoutAlignment GetAlignment();
168 class wxCalculateLayoutEvent: public wxEvent {
170 wxCalculateLayoutEvent(wxWindowID id = 0);
172 void SetFlags(int flags);
174 void SetRect(const wxRect& rect);
179 class wxSashLayoutWindow: public wxSashWindow {
181 wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
182 const wxPoint& pos = wxDefaultPosition,
183 const wxSize& size = wxDefaultSize,
184 long style = wxCLIP_CHILDREN | wxSW_3D,
185 const wxString& name = wxPySashLayoutNameStr);
186 %name(wxPreSashLayoutWindow)wxSashLayoutWindow();
188 bool Create(wxWindow* parent, wxWindowID id,
189 const wxPoint& pos = wxDefaultPosition,
190 const wxSize& size = wxDefaultSize,
191 long style = wxCLIP_CHILDREN | wxSW_3D,
192 const wxString& name = wxPySashLayoutNameStr);
194 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
195 %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)"
197 wxLayoutAlignment GetAlignment();
198 wxLayoutOrientation GetOrientation();
199 void SetAlignment(wxLayoutAlignment alignment);
200 void SetDefaultSize(const wxSize& size);
201 void SetOrientation(wxLayoutOrientation orientation);
204 //---------------------------------------------------------------------------
206 class wxLayoutAlgorithm : public wxObject {
209 ~wxLayoutAlgorithm();
211 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
212 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
213 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
217 //---------------------------------------------------------------------------
220 // wxPopupWindow: a special kind of top level window used for popup menus,
221 // combobox popups and such.
222 class wxPopupWindow : public wxWindow {
224 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
225 %name(wxPrePopupWindow)wxPopupWindow();
227 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
228 %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(val)"
230 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
232 // the point must be given in screen coordinates!
233 void Position(const wxPoint& ptOrigin,
239 class wxPyPopupTransientWindow : public wxPopupTransientWindow
242 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
243 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
244 : wxPopupTransientWindow(parent, style) {}
246 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
247 DEC_PYCALLBACK__(OnDismiss);
248 DEC_PYCALLBACK_BOOL_(CanDismiss);
252 IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
253 IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
254 IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismiss);
259 // wxPopupTransientWindow: a wxPopupWindow which disappears automatically
260 // when the user clicks mouse outside it or if it loses focus in any other way
261 %name(wxPopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
264 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
265 %name(wxPrePopupTransientWindow)wxPyPopupTransientWindow();
267 void _setCallbackInfo(PyObject* self, PyObject* _class);
268 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPopupTransientWindow)"
270 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
271 %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(val)"
273 // popup the window (this will show it too) and keep focus at winFocus
274 // (or itself if it's NULL), dismiss the popup if we lose focus
275 virtual void Popup(wxWindow *focus = NULL);
278 virtual void Dismiss();
281 //---------------------------------------------------------------------------
283 class wxTipWindow : public wxPyPopupTransientWindow
287 wxTipWindow(wxWindow *parent,
288 const wxString* text,
289 wxCoord maxLength = 100,
290 wxRect* rectBound = NULL) {
291 wxString tmp = *text;
292 return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound);
296 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
298 // If rectBound is not NULL, the window will disappear automatically when
299 // the mouse leave the specified rect: note that rectBound should be in the
300 // screen coordinates!
301 void SetBoundingRect(const wxRect& rectBound);
303 // Hide and destroy the window
308 //---------------------------------------------------------------------------