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 //---------------------------------------------------------------------------
19 static const wxChar* wxSashNameStr = wxT("sashWindow");
20 DECLARE_DEF_STRING(SashNameStr);
21 static const wxChar* wxSashLayoutNameStr = wxT("layoutWindow");
22 DECLARE_DEF_STRING(SashLayoutNameStr);
25 //---------------------------------------------------------------------------
32 wxSASH_DRAG_LEFT_DOWN,
42 enum wxSashEdgePosition {
52 // wxSashWindow allows any of its edges to have a sash which can be dragged
53 // to resize the window. The actual content window will be created as a child
55 class wxSashWindow: public wxWindow
58 %addtofunc wxSashWindow "self._setOORInfo(self)"
59 %addtofunc wxSashWindow() ""
61 wxSashWindow(wxWindow* parent, wxWindowID id,
62 const wxPoint& pos = wxDefaultPosition,
63 const wxSize& size = wxDefaultSize,
64 long style = wxCLIP_CHILDREN | wxSW_3D,
65 const wxString& name = wxPySashNameStr);
66 %name(PreSashWindow)wxSashWindow();
68 bool Create(wxWindow* parent, wxWindowID id,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& size = wxDefaultSize,
71 long style = wxCLIP_CHILDREN | wxSW_3D,
72 const wxString& name = wxPySashNameStr);
75 // Set whether there's a sash in this position
76 void SetSashVisible(wxSashEdgePosition edge, bool sash);
78 // Get whether there's a sash in this position
79 bool GetSashVisible(wxSashEdgePosition edge) const;
81 // Set whether there's a border in this position
82 void SetSashBorder(wxSashEdgePosition edge, bool border);
84 // Get whether there's a border in this position
85 bool HasBorder(wxSashEdgePosition edge) const;
88 int GetEdgeMargin(wxSashEdgePosition edge) const;
90 // Sets the default sash border size
91 void SetDefaultBorderSize(int width);
93 // Gets the default sash border size
94 int GetDefaultBorderSize() const;
96 // Sets the addition border size between child and sash window
97 void SetExtraBorderSize(int width);
99 // Gets the addition border size between child and sash window
100 int GetExtraBorderSize() const;
102 virtual void SetMinimumSizeX(int min);
103 virtual void SetMinimumSizeY(int min);
104 virtual int GetMinimumSizeX() const;
105 virtual int GetMinimumSizeY() const;
107 virtual void SetMaximumSizeX(int max);
108 virtual void SetMaximumSizeY(int max);
109 virtual int GetMaximumSizeX() const;
110 virtual int GetMaximumSizeY() const;
112 // Tests for x, y over sash
113 wxSashEdgePosition SashHitTest(int x, int y, int tolerance = 2);
115 // Resizes subwindows
121 enum wxSashDragStatus
124 wxSASH_STATUS_OUT_OF_RANGE
127 class wxSashEvent: public wxCommandEvent
130 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
132 void SetEdge(wxSashEdgePosition edge);
133 wxSashEdgePosition GetEdge() const;
135 //// The rectangle formed by the drag operation
136 void SetDragRect(const wxRect& rect);
137 wxRect GetDragRect() const;
139 //// Whether the drag caused the rectangle to be reversed (e.g.
140 //// dragging the top below the bottom)
141 void SetDragStatus(wxSashDragStatus status);
142 wxSashDragStatus GetDragStatus() const;
147 %constant wxEventType wxEVT_SASH_DRAGGED;
150 EVT_SASH_DRAGGED = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 1 )
151 EVT_SASH_DRAGGED_RANGE = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 2 )
157 //---------------------------------------------------------------------------
162 enum wxLayoutOrientation
168 enum wxLayoutAlignment
185 %constant wxEventType wxEVT_QUERY_LAYOUT_INFO;
186 %constant wxEventType wxEVT_CALCULATE_LAYOUT;
189 // This event is used to get information about window alignment,
190 // orientation and size.
191 class wxQueryLayoutInfoEvent: public wxEvent
194 wxQueryLayoutInfoEvent(wxWindowID id = 0);
197 void SetRequestedLength(int length);
198 int GetRequestedLength() const;
200 void SetFlags(int flags);
201 int GetFlags() const;
204 void SetSize(const wxSize& size);
205 wxSize GetSize() const;
207 void SetOrientation(wxLayoutOrientation orient);
208 wxLayoutOrientation GetOrientation() const;
210 void SetAlignment(wxLayoutAlignment align);
211 wxLayoutAlignment GetAlignment() const;
215 // This event is used to take a bite out of the available client area.
216 class wxCalculateLayoutEvent: public wxEvent
219 wxCalculateLayoutEvent(wxWindowID id = 0);
222 void SetFlags(int flags);
223 int GetFlags() const;
226 void SetRect(const wxRect& rect);
227 wxRect GetRect() const;
232 EVT_QUERY_LAYOUT_INFO = wx.PyEventBinder( wxEVT_QUERY_LAYOUT_INFO )
233 EVT_CALCULATE_LAYOUT = wx.PyEventBinder( wxEVT_CALCULATE_LAYOUT )
238 // This is window that can remember alignment/orientation, does its own layout,
239 // and can provide sashes too. Useful for implementing docked windows with sashes in
240 // an IDE-style interface.
241 class wxSashLayoutWindow: public wxSashWindow
244 %addtofunc wxSashLayoutWindow "self._setOORInfo(self)"
245 %addtofunc wxSashLayoutWindow() ""
247 wxSashLayoutWindow(wxWindow* parent, wxWindowID id,
248 const wxPoint& pos = wxDefaultPosition,
249 const wxSize& size = wxDefaultSize,
250 long style = wxCLIP_CHILDREN | wxSW_3D,
251 const wxString& name = wxPySashLayoutNameStr);
252 %name(PreSashLayoutWindow)wxSashLayoutWindow();
254 bool Create(wxWindow* parent, wxWindowID id,
255 const wxPoint& pos = wxDefaultPosition,
256 const wxSize& size = wxDefaultSize,
257 long style = wxCLIP_CHILDREN | wxSW_3D,
258 const wxString& name = wxPySashLayoutNameStr);
260 wxLayoutAlignment GetAlignment();
261 wxLayoutOrientation GetOrientation();
262 void SetAlignment(wxLayoutAlignment alignment);
263 void SetDefaultSize(const wxSize& size);
264 void SetOrientation(wxLayoutOrientation orientation);
269 class wxLayoutAlgorithm : public wxObject {
272 ~wxLayoutAlgorithm();
274 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
275 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
276 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
280 //---------------------------------------------------------------------------