]> git.saurik.com Git - wxWidgets.git/blame - interface/sashwin.h
make it callable from any path
[wxWidgets.git] / interface / sashwin.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: sashwin.h
3// Purpose: documentation for wxSashWindow class
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxSashWindow
11 @wxheader{sashwin.h}
12
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
15 application
16 as a child of wxSashWindow. The window (or an ancestor) will be notified of a
17 drag
18 via a wxSashEvent notification.
19
20 @beginStyleTable
21 @style{wxSW_3D}:
22 Draws a 3D effect sash and border.
23 @style{wxSW_3DSASH}:
24 Draws a 3D effect sash.
25 @style{wxSW_3DBORDER}:
26 Draws a 3D effect border.
27 @style{wxSW_BORDER}:
28 Draws a thin black border.
29 @endStyleTable
30
31 @beginEventTable
32 @event{EVT_SASH_DRAGGED(id\, func)}:
33 Process a wxEVT_SASH_DRAGGED event, when the user has finished
34 dragging a sash.
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.
39 @endEventTable
40
41 @library{wxadv}
42 @category{miscwnd}
43
44 @seealso
45 wxSashEvent, wxSashLayoutWindow, @ref overview_eventhandlingoverview "Event
46 handling overview"
47*/
48class wxSashWindow : public wxWindow
49{
50public:
51 //@{
52 /**
53 Constructs a sash window, which can be a child of a frame, dialog or any other
54 non-control window.
55
56 @param parent
57 Pointer to a parent window.
58
59 @param id
60 Window identifier. If -1, will automatically create an identifier.
61
62 @param pos
63 Window position. wxDefaultPosition is (-1, -1) which indicates that
64 wxSashWindows
65 should generate a default position for the window. If using the wxSashWindow
66 class directly, supply
67 an actual position.
68
69 @param size
70 Window size. wxDefaultSize is (-1, -1) which indicates that wxSashWindows
71 should generate a default size for the window.
72
73 @param style
74 Window style. For window styles, please see wxSashWindow.
75
76 @param name
77 Window name.
78 */
79 wxSashWindow();
80 wxSashWindow(wxWindow* parent, wxWindowID id,
81 const wxPoint& pos = wxDefaultPosition,
82 const wxSize& size = wxDefaultSize,
83 long style = wxCLIP_CHILDREN | wxSW_3D,
84 const wxString& name = "sashWindow");
85 //@}
86
87 /**
88 Destructor.
89 */
90 ~wxSashWindow();
91
92 /**
93 Gets the maximum window size in the x direction.
94 */
95 int GetMaximumSizeX();
96
97 /**
98 Gets the maximum window size in the y direction.
99 */
100 int GetMaximumSizeY();
101
102 /**
103 Gets the minimum window size in the x direction.
104 */
105 int GetMinimumSizeX();
106
107 /**
108 Gets the minimum window size in the y direction.
109 */
110 int GetMinimumSizeY();
111
112 /**
113 Returns @true if a sash is visible on the given edge, @false otherwise.
114
115 @param edge
116 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
117
118 @sa SetSashVisible()
119 */
120 bool GetSashVisible(wxSashEdgePosition edge);
121
122 /**
123 Returns @true if the sash has a border, @false otherwise.
124 This function is obsolete since the sash border property is unused.
125
126 @param edge
127 Edge. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
128
129 @sa SetSashBorder()
130 */
131 bool HasBorder(wxSashEdgePosition edge);
132
133 /**
134 Sets the maximum window size in the x direction.
135 */
136 void SetMaximumSizeX(int min);
137
138 /**
139 Sets the maximum window size in the y direction.
140 */
141 void SetMaximumSizeY(int min);
142
143 /**
144 Sets the minimum window size in the x direction.
145 */
146 void SetMinimumSizeX(int min);
147
148 /**
149 Sets the minimum window size in the y direction.
150 */
151 void SetMinimumSizeY(int min);
152
153 /**
154 Call this function to give the sash a border, or remove the border.
155 This function is obsolete since the sash border property is unused.
156
157 @param edge
158 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
159
160 @param hasBorder
161 @true to give the sash a border visible, @false to remove it.
162 */
163 void SetSashBorder(wxSashEdgePosition edge, bool hasBorder);
164
165 /**
166 Call this function to make a sash visible or invisible on a particular edge.
167
168 @param edge
169 Edge to change. One of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.
170
171 @param visible
172 @true to make the sash visible, @false to make it invisible.
173
174 @sa GetSashVisible()
175 */
176 void SetSashVisible(wxSashEdgePosition edge, bool visible);
177};
178
179
180/**
181 @class wxSashEvent
182 @wxheader{sashwin.h}
183
184 A sash event is sent when the sash of a wxSashWindow has been
185 dragged by the user.
186
187 @library{wxadv}
188 @category{FIXME}
189
190 @seealso
191 wxSashWindow, @ref overview_eventhandlingoverview "Event handling overview"
192*/
193class wxSashEvent : public wxCommandEvent
194{
195public:
196 /**
197 Constructor.
198 */
199 wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE);
200
201 /**
202 Returns the rectangle representing the new size the window would be if the
203 resize was applied. It is
204 up to the application to set the window size if required.
205 */
206 wxRect GetDragRect();
207
208 /**
209 Returns the status of the sash: one of wxSASH_STATUS_OK,
210 wxSASH_STATUS_OUT_OF_RANGE.
211 If the drag caused the notional bounding box of the window to flip over, for
212 example, the drag will be out of rage.
213 */
214 wxSashDragStatus GetDragStatus();
215
216 /**
217 Returns the dragged edge. The return value is one of wxSASH_TOP, wxSASH_RIGHT,
218 wxSASH_BOTTOM, wxSASH_LEFT.
219 */
220 wxSashEdgePosition GetEdge();
221};