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>
24 //----------------------------------------------------------------------
27 %include my_typemaps.i
29 // Import some definitions of other classes, etc.
38 %pragma(python) code = "import wx"
40 //---------------------------------------------------------------------------
42 enum wxSashEdgePosition {
61 wxSASH_STATUS_OUT_OF_RANGE
65 class wxSashEvent : public wxCommandEvent {
67 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
69 void SetEdge(wxSashEdgePosition edge);
70 wxSashEdgePosition GetEdge();
71 void SetDragRect(const wxRect& rect);
73 void SetDragStatus(wxSashDragStatus status);
74 wxSashDragStatus GetDragStatus();
79 class wxSashWindow: public wxWindow {
81 wxSashWindow(wxWindow* parent, wxWindowID id,
82 const wxPoint& pos = wxDefaultPosition,
83 const wxSize& size = wxDefaultSize,
84 long style = wxCLIP_CHILDREN | wxSW_3D,
85 const char* name = "sashWindow");
86 %name(wxPreSashWindow)wxSashWindow();
88 bool Create(wxWindow* parent, wxWindowID id,
89 const wxPoint& pos = wxDefaultPosition,
90 const wxSize& size = wxDefaultSize,
91 long style = wxCLIP_CHILDREN | wxSW_3D,
92 const char* name = "sashWindow");
94 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
95 %pragma(python) addtomethod = "wxPreSashWindow:val._setOORInfo(val)"
97 bool GetSashVisible(wxSashEdgePosition edge);
98 int GetDefaultBorderSize();
99 int GetEdgeMargin(wxSashEdgePosition edge);
100 int GetExtraBorderSize();
101 int GetMaximumSizeX();
102 int GetMaximumSizeY();
103 int GetMinimumSizeX();
104 int GetMinimumSizeY();
105 bool HasBorder(wxSashEdgePosition edge);
106 void SetDefaultBorderSize(int width);
107 void SetExtraBorderSize(int width);
108 void SetMaximumSizeX(int min);
109 void SetMaximumSizeY(int min);
110 void SetMinimumSizeX(int min);
111 void SetMinimumSizeY(int min);
112 void SetSashVisible(wxSashEdgePosition edge, bool visible);
113 void SetSashBorder(wxSashEdgePosition edge, bool hasBorder);
118 //---------------------------------------------------------------------------
120 enum wxLayoutOrientation {
125 enum wxLayoutAlignment {
135 wxEVT_QUERY_LAYOUT_INFO,
136 wxEVT_CALCULATE_LAYOUT,
140 class wxQueryLayoutInfoEvent: public wxEvent {
142 wxQueryLayoutInfoEvent(wxWindowID id = 0);
144 void SetRequestedLength(int length);
145 int GetRequestedLength();
146 void SetFlags(int flags);
148 void SetSize(const wxSize& size);
150 void SetOrientation(wxLayoutOrientation orient);
151 wxLayoutOrientation GetOrientation();
152 void SetAlignment(wxLayoutAlignment align);
153 wxLayoutAlignment GetAlignment();
158 class wxCalculateLayoutEvent: public wxEvent {
160 wxCalculateLayoutEvent(wxWindowID id = 0);
162 void SetFlags(int flags);
164 void SetRect(const wxRect& rect);
169 class wxSashLayoutWindow: public wxSashWindow {
171 wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
172 const wxPoint& pos = wxDefaultPosition,
173 const wxSize& size = wxDefaultSize,
174 long style = wxCLIP_CHILDREN | wxSW_3D,
175 const char* name = "layoutWindow");
176 %name(wxPreSashLayoutWindow)wxSashLayoutWindow();
178 bool Create(wxWindow* parent, wxWindowID id,
179 const wxPoint& pos = wxDefaultPosition,
180 const wxSize& size = wxDefaultSize,
181 long style = wxCLIP_CHILDREN | wxSW_3D,
182 const char* name = "layoutWindow");
184 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
185 %pragma(python) addtomethod = "wxPreSashLayoutWindow:val._setOORInfo(val)"
187 wxLayoutAlignment GetAlignment();
188 wxLayoutOrientation GetOrientation();
189 void SetAlignment(wxLayoutAlignment alignment);
190 void SetDefaultSize(const wxSize& size);
191 void SetOrientation(wxLayoutOrientation orientation);
194 //---------------------------------------------------------------------------
196 class wxLayoutAlgorithm : public wxObject {
199 ~wxLayoutAlgorithm();
201 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
202 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
203 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
207 //---------------------------------------------------------------------------
210 // wxPopupWindow: a special kind of top level window used for popup menus,
211 // combobox popups and such.
212 class wxPopupWindow : public wxWindow {
214 wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE);
215 %name(wxPrePopupWindow)wxPopupWindow();
217 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
218 %pragma(python) addtomethod = "wxPrePopupWindow:val._setOORInfo(val)"
220 bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
222 // the point must be given in screen coordinates!
223 void Position(const wxPoint& ptOrigin,
229 class wxPyPopupTransientWindow : public wxPopupTransientWindow
232 wxPyPopupTransientWindow() : wxPopupTransientWindow() {}
233 wxPyPopupTransientWindow(wxWindow* parent, int style = wxBORDER_NONE)
234 : wxPopupTransientWindow(parent, style) {}
236 DEC_PYCALLBACK_BOOL_ME(ProcessLeftDown);
237 DEC_PYCALLBACK__(OnDismiss);
241 IMP_PYCALLBACK_BOOL_ME(wxPyPopupTransientWindow, wxPopupTransientWindow, ProcessLeftDown);
242 IMP_PYCALLBACK__(wxPyPopupTransientWindow, wxPopupTransientWindow, OnDismiss);
247 // wxPopupTransientWindow: a wxPopupWindow which disappears automatically
248 // when the user clicks mouse outside it or if it loses focus in any other way
249 %name(wxPopupTransientWindow) class wxPyPopupTransientWindow : public wxPopupWindow
252 wxPyPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
253 %name(wxPrePopupTransientWindow)wxPyPopupTransientWindow();
255 void _setCallbackInfo(PyObject* self, PyObject* _class);
256 %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPopupTransientWindow)"
258 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
259 %pragma(python) addtomethod = "wxPrePopupTransientWindow:val._setOORInfo(val)"
261 // popup the window (this will show it too) and keep focus at winFocus
262 // (or itself if it's NULL), dismiss the popup if we lose focus
263 virtual void Popup(wxWindow *focus = NULL);
266 virtual void Dismiss();
270 //---------------------------------------------------------------------------