1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxSashWindow and wxSashLayoutWindow
7 // Created: 22-Dec-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
18 MAKE_CONST_WXSTRING2(SashNameStr, wxT("sashWindow"));
19 MAKE_CONST_WXSTRING2(SashLayoutNameStr, wxT("layoutWindow"));
21 //---------------------------------------------------------------------------
28 wxSASH_DRAG_LEFT_DOWN,
38 enum wxSashEdgePosition {
48 // wxSashWindow allows any of its edges to have a sash which can be dragged
49 // to resize the window. The actual content window will be created as a child
51 MustHaveApp(wxSashWindow);
53 class wxSashWindow: public wxWindow
56 %pythonAppend wxSashWindow "self._setOORInfo(self)"
57 %pythonAppend wxSashWindow() ""
59 wxSashWindow(wxWindow* parent, wxWindowID id=-1,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 long style = wxCLIP_CHILDREN | wxSW_3D,
63 const wxString& name = wxPySashNameStr);
64 %RenameCtor(PreSashWindow, wxSashWindow());
66 bool Create(wxWindow* parent, wxWindowID id=-1,
67 const wxPoint& pos = wxDefaultPosition,
68 const wxSize& size = wxDefaultSize,
69 long style = wxCLIP_CHILDREN | wxSW_3D,
70 const wxString& name = wxPySashNameStr);
73 // Set whether there's a sash in this position
74 void SetSashVisible(wxSashEdgePosition edge, bool sash);
76 // Get whether there's a sash in this position
77 bool GetSashVisible(wxSashEdgePosition edge) const;
79 // Set whether there's a border in this position
80 void SetSashBorder(wxSashEdgePosition edge, bool border);
82 // Get whether there's a border in this position
83 bool HasBorder(wxSashEdgePosition edge) const;
86 int GetEdgeMargin(wxSashEdgePosition edge) const;
88 // Sets the default sash border size
89 void SetDefaultBorderSize(int width);
91 // Gets the default sash border size
92 int GetDefaultBorderSize() const;
94 // Sets the addition border size between child and sash window
95 void SetExtraBorderSize(int width);
97 // Gets the addition border size between child and sash window
98 int GetExtraBorderSize() const;
100 virtual void SetMinimumSizeX(int min);
101 virtual void SetMinimumSizeY(int min);
102 virtual int GetMinimumSizeX() const;
103 virtual int GetMinimumSizeY() const;
105 virtual void SetMaximumSizeX(int max);
106 virtual void SetMaximumSizeY(int max);
107 virtual int GetMaximumSizeX() const;
108 virtual int GetMaximumSizeY() const;
110 // Tests for x, y over sash
111 wxSashEdgePosition SashHitTest(int x, int y, int tolerance = 2);
113 // Resizes subwindows
116 %property(DefaultBorderSize, GetDefaultBorderSize, SetDefaultBorderSize, doc="See `GetDefaultBorderSize` and `SetDefaultBorderSize`");
117 %property(ExtraBorderSize, GetExtraBorderSize, SetExtraBorderSize, doc="See `GetExtraBorderSize` and `SetExtraBorderSize`");
118 %property(MaximumSizeX, GetMaximumSizeX, SetMaximumSizeX, doc="See `GetMaximumSizeX` and `SetMaximumSizeX`");
119 %property(MaximumSizeY, GetMaximumSizeY, SetMaximumSizeY, doc="See `GetMaximumSizeY` and `SetMaximumSizeY`");
120 %property(MinimumSizeX, GetMinimumSizeX, SetMinimumSizeX, doc="See `GetMinimumSizeX` and `SetMinimumSizeX`");
121 %property(MinimumSizeY, GetMinimumSizeY, SetMinimumSizeY, doc="See `GetMinimumSizeY` and `SetMinimumSizeY`");
126 enum wxSashDragStatus
129 wxSASH_STATUS_OUT_OF_RANGE
132 class wxSashEvent: public wxCommandEvent
135 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
137 void SetEdge(wxSashEdgePosition edge);
138 wxSashEdgePosition GetEdge() const;
140 //// The rectangle formed by the drag operation
141 void SetDragRect(const wxRect& rect);
142 wxRect GetDragRect() const;
144 //// Whether the drag caused the rectangle to be reversed (e.g.
145 //// dragging the top below the bottom)
146 void SetDragStatus(wxSashDragStatus status);
147 wxSashDragStatus GetDragStatus() const;
149 %property(DragRect, GetDragRect, SetDragRect, doc="See `GetDragRect` and `SetDragRect`");
150 %property(DragStatus, GetDragStatus, SetDragStatus, doc="See `GetDragStatus` and `SetDragStatus`");
151 %property(Edge, GetEdge, SetEdge, doc="See `GetEdge` and `SetEdge`");
156 %constant wxEventType wxEVT_SASH_DRAGGED;
159 EVT_SASH_DRAGGED = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 1 )
160 EVT_SASH_DRAGGED_RANGE = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 2 )
166 //---------------------------------------------------------------------------
171 enum wxLayoutOrientation
177 enum wxLayoutAlignment
194 %constant wxEventType wxEVT_QUERY_LAYOUT_INFO;
195 %constant wxEventType wxEVT_CALCULATE_LAYOUT;
198 // This event is used to get information about window alignment,
199 // orientation and size.
200 class wxQueryLayoutInfoEvent: public wxEvent
203 wxQueryLayoutInfoEvent(wxWindowID id = 0);
206 void SetRequestedLength(int length);
207 int GetRequestedLength() const;
209 void SetFlags(int flags);
210 int GetFlags() const;
213 void SetSize(const wxSize& size);
214 wxSize GetSize() const;
216 void SetOrientation(wxLayoutOrientation orient);
217 wxLayoutOrientation GetOrientation() const;
219 void SetAlignment(wxLayoutAlignment align);
220 wxLayoutAlignment GetAlignment() const;
222 %property(Alignment, GetAlignment, SetAlignment, doc="See `GetAlignment` and `SetAlignment`");
223 %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
224 %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`");
225 %property(RequestedLength, GetRequestedLength, SetRequestedLength, doc="See `GetRequestedLength` and `SetRequestedLength`");
226 %property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`");
230 // This event is used to take a bite out of the available client area.
231 class wxCalculateLayoutEvent: public wxEvent
234 wxCalculateLayoutEvent(wxWindowID id = 0);
237 void SetFlags(int flags);
238 int GetFlags() const;
241 void SetRect(const wxRect& rect);
242 wxRect GetRect() const;
244 %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
245 %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
250 EVT_QUERY_LAYOUT_INFO = wx.PyEventBinder( wxEVT_QUERY_LAYOUT_INFO )
251 EVT_CALCULATE_LAYOUT = wx.PyEventBinder( wxEVT_CALCULATE_LAYOUT )
256 // This is window that can remember alignment/orientation, does its own layout,
257 // and can provide sashes too. Useful for implementing docked windows with sashes in
258 // an IDE-style interface.
259 MustHaveApp(wxSashLayoutWindow);
261 class wxSashLayoutWindow: public wxSashWindow
264 %pythonAppend wxSashLayoutWindow "self._setOORInfo(self)"
265 %pythonAppend wxSashLayoutWindow() ""
267 wxSashLayoutWindow(wxWindow* parent, wxWindowID id=-1,
268 const wxPoint& pos = wxDefaultPosition,
269 const wxSize& size = wxDefaultSize,
270 long style = wxCLIP_CHILDREN | wxSW_3D,
271 const wxString& name = wxPySashLayoutNameStr);
272 %RenameCtor(PreSashLayoutWindow, wxSashLayoutWindow());
274 bool Create(wxWindow* parent, wxWindowID id=-1,
275 const wxPoint& pos = wxDefaultPosition,
276 const wxSize& size = wxDefaultSize,
277 long style = wxCLIP_CHILDREN | wxSW_3D,
278 const wxString& name = wxPySashLayoutNameStr);
280 wxLayoutAlignment GetAlignment();
281 wxLayoutOrientation GetOrientation();
282 void SetAlignment(wxLayoutAlignment alignment);
283 void SetDefaultSize(const wxSize& size);
284 void SetOrientation(wxLayoutOrientation orientation);
286 %property(Alignment, GetAlignment, SetAlignment, doc="See `GetAlignment` and `SetAlignment`");
287 %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`");
292 class wxLayoutAlgorithm : public wxObject {
295 ~wxLayoutAlgorithm();
297 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
298 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
299 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
303 //---------------------------------------------------------------------------