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 class wxSashWindow: public wxWindow
54 %pythonAppend wxSashWindow "self._setOORInfo(self)"
55 %pythonAppend wxSashWindow() ""
57 wxSashWindow(wxWindow* parent, wxWindowID id,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
60 long style = wxCLIP_CHILDREN | wxSW_3D,
61 const wxString& name = wxPySashNameStr);
62 %name(PreSashWindow)wxSashWindow();
64 bool Create(wxWindow* parent, wxWindowID id,
65 const wxPoint& pos = wxDefaultPosition,
66 const wxSize& size = wxDefaultSize,
67 long style = wxCLIP_CHILDREN | wxSW_3D,
68 const wxString& name = wxPySashNameStr);
71 // Set whether there's a sash in this position
72 void SetSashVisible(wxSashEdgePosition edge, bool sash);
74 // Get whether there's a sash in this position
75 bool GetSashVisible(wxSashEdgePosition edge) const;
77 // Set whether there's a border in this position
78 void SetSashBorder(wxSashEdgePosition edge, bool border);
80 // Get whether there's a border in this position
81 bool HasBorder(wxSashEdgePosition edge) const;
84 int GetEdgeMargin(wxSashEdgePosition edge) const;
86 // Sets the default sash border size
87 void SetDefaultBorderSize(int width);
89 // Gets the default sash border size
90 int GetDefaultBorderSize() const;
92 // Sets the addition border size between child and sash window
93 void SetExtraBorderSize(int width);
95 // Gets the addition border size between child and sash window
96 int GetExtraBorderSize() const;
98 virtual void SetMinimumSizeX(int min);
99 virtual void SetMinimumSizeY(int min);
100 virtual int GetMinimumSizeX() const;
101 virtual int GetMinimumSizeY() const;
103 virtual void SetMaximumSizeX(int max);
104 virtual void SetMaximumSizeY(int max);
105 virtual int GetMaximumSizeX() const;
106 virtual int GetMaximumSizeY() const;
108 // Tests for x, y over sash
109 wxSashEdgePosition SashHitTest(int x, int y, int tolerance = 2);
111 // Resizes subwindows
117 enum wxSashDragStatus
120 wxSASH_STATUS_OUT_OF_RANGE
123 class wxSashEvent: public wxCommandEvent
126 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
128 void SetEdge(wxSashEdgePosition edge);
129 wxSashEdgePosition GetEdge() const;
131 //// The rectangle formed by the drag operation
132 void SetDragRect(const wxRect& rect);
133 wxRect GetDragRect() const;
135 //// Whether the drag caused the rectangle to be reversed (e.g.
136 //// dragging the top below the bottom)
137 void SetDragStatus(wxSashDragStatus status);
138 wxSashDragStatus GetDragStatus() const;
143 %constant wxEventType wxEVT_SASH_DRAGGED;
146 EVT_SASH_DRAGGED = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 1 )
147 EVT_SASH_DRAGGED_RANGE = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 2 )
153 //---------------------------------------------------------------------------
158 enum wxLayoutOrientation
164 enum wxLayoutAlignment
181 %constant wxEventType wxEVT_QUERY_LAYOUT_INFO;
182 %constant wxEventType wxEVT_CALCULATE_LAYOUT;
185 // This event is used to get information about window alignment,
186 // orientation and size.
187 class wxQueryLayoutInfoEvent: public wxEvent
190 wxQueryLayoutInfoEvent(wxWindowID id = 0);
193 void SetRequestedLength(int length);
194 int GetRequestedLength() const;
196 void SetFlags(int flags);
197 int GetFlags() const;
200 void SetSize(const wxSize& size);
201 wxSize GetSize() const;
203 void SetOrientation(wxLayoutOrientation orient);
204 wxLayoutOrientation GetOrientation() const;
206 void SetAlignment(wxLayoutAlignment align);
207 wxLayoutAlignment GetAlignment() const;
211 // This event is used to take a bite out of the available client area.
212 class wxCalculateLayoutEvent: public wxEvent
215 wxCalculateLayoutEvent(wxWindowID id = 0);
218 void SetFlags(int flags);
219 int GetFlags() const;
222 void SetRect(const wxRect& rect);
223 wxRect GetRect() const;
228 EVT_QUERY_LAYOUT_INFO = wx.PyEventBinder( wxEVT_QUERY_LAYOUT_INFO )
229 EVT_CALCULATE_LAYOUT = wx.PyEventBinder( wxEVT_CALCULATE_LAYOUT )
234 // This is window that can remember alignment/orientation, does its own layout,
235 // and can provide sashes too. Useful for implementing docked windows with sashes in
236 // an IDE-style interface.
237 class wxSashLayoutWindow: public wxSashWindow
240 %pythonAppend wxSashLayoutWindow "self._setOORInfo(self)"
241 %pythonAppend wxSashLayoutWindow() ""
243 wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
244 const wxPoint& pos = wxDefaultPosition,
245 const wxSize& size = wxDefaultSize,
246 long style = wxCLIP_CHILDREN | wxSW_3D,
247 const wxString& name = wxPySashLayoutNameStr);
248 %name(PreSashLayoutWindow)wxSashLayoutWindow();
250 bool Create(wxWindow* parent, wxWindowID id,
251 const wxPoint& pos = wxDefaultPosition,
252 const wxSize& size = wxDefaultSize,
253 long style = wxCLIP_CHILDREN | wxSW_3D,
254 const wxString& name = wxPySashLayoutNameStr);
256 wxLayoutAlignment GetAlignment();
257 wxLayoutOrientation GetOrientation();
258 void SetAlignment(wxLayoutAlignment alignment);
259 void SetDefaultSize(const wxSize& size);
260 void SetOrientation(wxLayoutOrientation orientation);
265 class wxLayoutAlgorithm : public wxObject {
268 ~wxLayoutAlgorithm();
270 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
271 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
272 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
276 //---------------------------------------------------------------------------