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