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
119 enum wxSashDragStatus
122 wxSASH_STATUS_OUT_OF_RANGE
125 class wxSashEvent: public wxCommandEvent
128 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
130 void SetEdge(wxSashEdgePosition edge);
131 wxSashEdgePosition GetEdge() const;
133 //// The rectangle formed by the drag operation
134 void SetDragRect(const wxRect& rect);
135 wxRect GetDragRect() const;
137 //// Whether the drag caused the rectangle to be reversed (e.g.
138 //// dragging the top below the bottom)
139 void SetDragStatus(wxSashDragStatus status);
140 wxSashDragStatus GetDragStatus() const;
145 %constant wxEventType wxEVT_SASH_DRAGGED;
148 EVT_SASH_DRAGGED = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 1 )
149 EVT_SASH_DRAGGED_RANGE = wx.PyEventBinder( wxEVT_SASH_DRAGGED, 2 )
155 //---------------------------------------------------------------------------
160 enum wxLayoutOrientation
166 enum wxLayoutAlignment
183 %constant wxEventType wxEVT_QUERY_LAYOUT_INFO;
184 %constant wxEventType wxEVT_CALCULATE_LAYOUT;
187 // This event is used to get information about window alignment,
188 // orientation and size.
189 class wxQueryLayoutInfoEvent: public wxEvent
192 wxQueryLayoutInfoEvent(wxWindowID id = 0);
195 void SetRequestedLength(int length);
196 int GetRequestedLength() const;
198 void SetFlags(int flags);
199 int GetFlags() const;
202 void SetSize(const wxSize& size);
203 wxSize GetSize() const;
205 void SetOrientation(wxLayoutOrientation orient);
206 wxLayoutOrientation GetOrientation() const;
208 void SetAlignment(wxLayoutAlignment align);
209 wxLayoutAlignment GetAlignment() const;
213 // This event is used to take a bite out of the available client area.
214 class wxCalculateLayoutEvent: public wxEvent
217 wxCalculateLayoutEvent(wxWindowID id = 0);
220 void SetFlags(int flags);
221 int GetFlags() const;
224 void SetRect(const wxRect& rect);
225 wxRect GetRect() const;
227 %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
228 %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
234 EVT_QUERY_LAYOUT_INFO = wx.PyEventBinder( wxEVT_QUERY_LAYOUT_INFO )
235 EVT_CALCULATE_LAYOUT = wx.PyEventBinder( wxEVT_CALCULATE_LAYOUT )
240 // This is window that can remember alignment/orientation, does its own layout,
241 // and can provide sashes too. Useful for implementing docked windows with sashes in
242 // an IDE-style interface.
243 MustHaveApp(wxSashLayoutWindow);
245 class wxSashLayoutWindow: public wxSashWindow
248 %pythonAppend wxSashLayoutWindow "self._setOORInfo(self)"
249 %pythonAppend wxSashLayoutWindow() ""
251 wxSashLayoutWindow(wxWindow* parent, wxWindowID id=-1,
252 const wxPoint& pos = wxDefaultPosition,
253 const wxSize& size = wxDefaultSize,
254 long style = wxCLIP_CHILDREN | wxSW_3D,
255 const wxString& name = wxPySashLayoutNameStr);
256 %RenameCtor(PreSashLayoutWindow, wxSashLayoutWindow());
258 bool Create(wxWindow* parent, wxWindowID id=-1,
259 const wxPoint& pos = wxDefaultPosition,
260 const wxSize& size = wxDefaultSize,
261 long style = wxCLIP_CHILDREN | wxSW_3D,
262 const wxString& name = wxPySashLayoutNameStr);
264 wxLayoutAlignment GetAlignment();
265 wxLayoutOrientation GetOrientation();
266 void SetAlignment(wxLayoutAlignment alignment);
267 void SetDefaultSize(const wxSize& size);
268 void SetOrientation(wxLayoutOrientation orientation);
273 class wxLayoutAlgorithm : public wxObject {
276 ~wxLayoutAlgorithm();
278 bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
279 bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
280 bool LayoutWindow(wxWindow* parent, wxWindow* mainWindow = NULL);
284 //---------------------------------------------------------------------------