]>
git.saurik.com Git - wxWidgets.git/blob - interface/sashwin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSashWindow
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 wxSashWindow allows any of its edges to have a sash which can be dragged
14 to resize the window. The actual content window will be created by the
16 as a child of wxSashWindow. The window (or an ancestor) will be notified of a
18 via a wxSashEvent notification.
22 Draws a 3D effect sash and border.
24 Draws a 3D effect sash.
25 @style{wxSW_3DBORDER}:
26 Draws a 3D effect border.
28 Draws a thin black border.
32 @event{EVT_SASH_DRAGGED(id, func)}:
33 Process a wxEVT_SASH_DRAGGED event, when the user has finished
35 @event{EVT_SASH_DRAGGED_RANGE(id1, id2, func)}:
36 Process a wxEVT_SASH_DRAGGED_RANGE event, when the user has
37 finished dragging a sash. The event handler is called when windows
38 with ids in the given range have their sashes dragged.
44 @see wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandlingoverview
46 class wxSashWindow
: public wxWindow
51 Constructs a sash window, which can be a child of a frame, dialog or any other
55 Pointer to a parent window.
57 Window identifier. If -1, will automatically create an identifier.
59 Window position. wxDefaultPosition is (-1, -1) which indicates that
61 should generate a default position for the window. If using the
62 wxSashWindow class directly, supply
65 Window size. wxDefaultSize is (-1, -1) which indicates that wxSashWindows
66 should generate a default size for the window.
68 Window style. For window styles, please see wxSashWindow.
73 wxSashWindow(wxWindow
* parent
, wxWindowID id
,
74 const wxPoint
& pos
= wxDefaultPosition
,
75 const wxSize
& size
= wxDefaultSize
,
76 long style
= wxCLIP_CHILDREN
| wxSW_3D
,
77 const wxString
& name
= "sashWindow");
86 Gets the maximum window size in the x direction.
88 int GetMaximumSizeX() const;
91 Gets the maximum window size in the y direction.
93 int GetMaximumSizeY() const;
96 Gets the minimum window size in the x direction.
98 int GetMinimumSizeX();
101 Gets the minimum window size in the y direction.
103 int GetMinimumSizeY() const;
106 Returns @true if a sash is visible on the given edge, @false otherwise.
109 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
111 @see SetSashVisible()
113 bool GetSashVisible(wxSashEdgePosition edge
) const;
116 Returns @true if the sash has a border, @false otherwise.
117 This function is obsolete since the sash border property is unused.
120 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
124 bool HasBorder(wxSashEdgePosition edge
) const;
127 Sets the maximum window size in the x direction.
129 void SetMaximumSizeX(int min
);
132 Sets the maximum window size in the y direction.
134 void SetMaximumSizeY(int min
);
137 Sets the minimum window size in the x direction.
139 void SetMinimumSizeX(int min
);
142 Sets the minimum window size in the y direction.
144 void SetMinimumSizeY(int min
);
147 Call this function to give the sash a border, or remove the border.
148 This function is obsolete since the sash border property is unused.
151 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
153 @true to give the sash a border visible, @false to remove it.
155 void SetSashBorder(wxSashEdgePosition edge
, bool hasBorder
);
158 Call this function to make a sash visible or invisible on a particular edge.
161 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
163 @true to make the sash visible, @false to make it invisible.
165 @see GetSashVisible()
167 void SetSashVisible(wxSashEdgePosition edge
, bool visible
);
176 A sash event is sent when the sash of a wxSashWindow has been
182 @see wxSashWindow, @ref overview_eventhandlingoverview
184 class wxSashEvent
: public wxCommandEvent
190 wxSashEvent(int id
= 0, wxSashEdgePosition edge
= wxSASH_NONE
);
193 Returns the rectangle representing the new size the window would be if the
194 resize was applied. It is
195 up to the application to set the window size if required.
197 wxRect
GetDragRect() const;
200 Returns the status of the sash: one of wxSASH_STATUS_OK,
201 wxSASH_STATUS_OUT_OF_RANGE.
202 If the drag caused the notional bounding box of the window to flip over, for
203 example, the drag will be out of rage.
205 wxSashDragStatus
GetDragStatus() const;
208 Returns the dragged edge. The return value is one of wxSASH_TOP, wxSASH_RIGHT,
209 wxSASH_BOTTOM, wxSASH_LEFT.
211 wxSashEdgePosition
GetEdge() const;