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 //---------------------------------------------------------------------------
43 enum wxSashEdgePosition {
62 wxSASH_STATUS_OUT_OF_RANGE
66 class wxSashEvent : public wxCommandEvent {
68 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
70 void SetEdge(wxSashEdgePosition edge);
71 wxSashEdgePosition GetEdge();
72 void SetDragRect(const wxRect& rect);
74 void SetDragStatus(wxSashDragStatus status);
75 wxSashDragStatus GetDragStatus();
80 class wxSashWindow: public wxWindow {
82 wxSashWindow(wxWindow* parent, wxWindowID id,
83 const wxPoint& pos = wxDefaultPosition,
84 const wxSize& size = wxDefaultSize,
85 long style = wxCLIP_CHILDREN | wxSW_3D,
86 const char* name = "sashWindow");
87 %name(wxPreSashWindow)wxSashWindow();
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");
95 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
96 %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)"
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);
119 //---------------------------------------------------------------------------
121 enum wxLayoutOrientation {
126 enum wxLayoutAlignment {
136 wxEVT_QUERY_LAYOUT_INFO,
137 wxEVT_CALCULATE_LAYOUT,
141 class wxQueryLayoutInfoEvent: public wxEvent {
143 wxQueryLayoutInfoEvent(wxWindowID id = 0);
145 void SetRequestedLength(int length);
146 int GetRequestedLength();
147 void SetFlags(int flags);
149 void SetSize(const wxSize& size);
151 void SetOrientation(wxLayoutOrientation orient);
152 wxLayoutOrientation GetOrientation();
153 void SetAlignment(wxLayoutAlignment align);
154 wxLayoutAlignment GetAlignment();
159 class wxCalculateLayoutEvent: public wxEvent {
161 wxCalculateLayoutEvent(wxWindowID id = 0);
163 void SetFlags(int flags);
165 void SetRect(const wxRect& rect);
170 class wxSashLayoutWindow: public wxSashWindow {
172 wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
173 const wxPoint& pos = wxDefaultPosition,
174 const wxSize& size = wxDefaultSize,
175 long style = wxCLIP_CHILDREN | wxSW_3D,
176 const char* name = "layoutWindow");
177 %name(wxPreSashLayoutWindow)wxSashLayoutWindow();
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");
185 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
186 %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)"
188 wxLayoutAlignment GetAlignment();
189 wxLayoutOrientation GetOrientation();
190 void SetAlignment(wxLayoutAlignment alignment);
191 void SetDefaultSize(const wxSize& size);
192 void SetOrientation(wxLayoutOrientation orientation);
195 //---------------------------------------------------------------------------
197 class wxLayoutAlgorithm : public wxObject {
200 ~wxLayoutAlgorithm();
202 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
203 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
204 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
208 //---------------------------------------------------------------------------
211 // wxPopupWindow: a special kind of top level window used for popup menus,
212 // combobox popups and such.
213 class wxPopupWindow : public wxWindow {
215 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
216 %name(wxPrePopupWindow)wxPopupWindow();
218 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
219 %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(val)"
221 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
223 // the point must be given in screen coordinates!
224 void Position(const wxPoint& ptOrigin,
230 class wxPyPopupTransientWindow : public wxPopupTransientWindow
233 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
234 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
235 : wxPopupTransientWindow(parent, style) {}
237 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
238 DEC_PYCALLBACK__(OnDismiss);
242 IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
243 IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
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
253 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
254 %name(wxPrePopupTransientWindow)wxPyPopupTransientWindow();
256 void _setCallbackInfo(PyObject* self, PyObject* _class);
257 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPopupTransientWindow)"
259 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
260 %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(val)"
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);
267 virtual void Dismiss();
270 //---------------------------------------------------------------------------
272 class wxTipWindow : public wxPyPopupTransientWindow
275 wxTipWindow(wxWindow *parent,
276 const wxString& text,
277 wxCoord maxLength = 100);
279 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
283 //---------------------------------------------------------------------------