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