]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: aui/aui.h | |
e54c96f1 | 3 | // Purpose: interface of wxAuiManager |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
526954c5 | 6 | // Licence: wxWindows licence |
23324ae1 FM |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
47d602c1 FM |
9 | |
10 | /** | |
ea6e8ec5 | 11 | @todo wxAuiPaneInfo dock direction types used with wxAuiManager. |
47d602c1 FM |
12 | */ |
13 | enum wxAuiManagerDock | |
14 | { | |
15 | wxAUI_DOCK_NONE = 0, | |
16 | wxAUI_DOCK_TOP = 1, | |
17 | wxAUI_DOCK_RIGHT = 2, | |
18 | wxAUI_DOCK_BOTTOM = 3, | |
19 | wxAUI_DOCK_LEFT = 4, | |
20 | wxAUI_DOCK_CENTER = 5, | |
21 | wxAUI_DOCK_CENTRE = wxAUI_DOCK_CENTER | |
22 | }; | |
23 | ||
24 | ||
25 | /** | |
4c51a665 | 26 | @todo wxAuiManager behaviour style flags. |
47d602c1 FM |
27 | */ |
28 | enum wxAuiManagerOption | |
29 | { | |
30 | wxAUI_MGR_ALLOW_FLOATING = 1 << 0, | |
31 | wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1, | |
32 | wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2, | |
33 | wxAUI_MGR_TRANSPARENT_HINT = 1 << 3, | |
34 | wxAUI_MGR_VENETIAN_BLINDS_HINT = 1 << 4, | |
35 | wxAUI_MGR_RECTANGLE_HINT = 1 << 5, | |
36 | wxAUI_MGR_HINT_FADE = 1 << 6, | |
37 | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE = 1 << 7, | |
68030cae | 38 | wxAUI_MGR_LIVE_RESIZE = 1 << 8, |
47d602c1 FM |
39 | |
40 | wxAUI_MGR_DEFAULT = wxAUI_MGR_ALLOW_FLOATING | | |
41 | wxAUI_MGR_TRANSPARENT_HINT | | |
42 | wxAUI_MGR_HINT_FADE | | |
43 | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE | |
44 | }; | |
45 | ||
23324ae1 FM |
46 | /** |
47 | @class wxAuiManager | |
7c913512 | 48 | |
23324ae1 | 49 | wxAuiManager is the central class of the wxAUI class framework. |
7c913512 | 50 | |
47d602c1 FM |
51 | wxAuiManager manages the panes associated with it for a particular wxFrame, |
52 | using a pane's wxAuiPaneInfo information to determine each pane's docking | |
4c51a665 | 53 | and floating behaviour. |
7c913512 | 54 | |
ea6e8ec5 BP |
55 | wxAuiManager uses wxWidgets' sizer mechanism to plan the layout of each |
56 | frame. It uses a replaceable dock art class to do all drawing, so all | |
57 | drawing is localized in one area, and may be customized depending on an | |
58 | application's specific needs. | |
7c913512 | 59 | |
23324ae1 FM |
60 | wxAuiManager works as follows: the programmer adds panes to the class, |
61 | or makes changes to existing pane properties (dock position, floating | |
62 | state, show state, etc.). To apply these changes, wxAuiManager's | |
63 | Update() function is called. This batch processing can be used to avoid | |
64 | flicker, by modifying more than one pane at a time, and then "committing" | |
65 | all of the changes at once by calling Update(). | |
7c913512 | 66 | |
23324ae1 | 67 | Panes can be added quite easily: |
7c913512 | 68 | |
23324ae1 FM |
69 | @code |
70 | wxTextCtrl* text1 = new wxTextCtrl(this, -1); | |
71 | wxTextCtrl* text2 = new wxTextCtrl(this, -1); | |
f8ebb70d FM |
72 | m_mgr.AddPane(text1, wxLEFT, "Pane Caption"); |
73 | m_mgr.AddPane(text2, wxBOTTOM, "Pane Caption"); | |
23324ae1 FM |
74 | m_mgr.Update(); |
75 | @endcode | |
7c913512 | 76 | |
23324ae1 FM |
77 | Later on, the positions can be modified easily. The following will float |
78 | an existing pane in a tool window: | |
7c913512 | 79 | |
23324ae1 FM |
80 | @code |
81 | m_mgr.GetPane(text1).Float(); | |
82 | @endcode | |
7c913512 | 83 | |
47d602c1 | 84 | |
3a74a290 | 85 | @section auimanager_layers Layers, Rows and Directions, Positions |
47d602c1 | 86 | |
8d483c9b | 87 | Inside wxAUI, the docking layout is figured out by checking several pane |
ea6e8ec5 BP |
88 | parameters. Four of these are important for determining where a pane will |
89 | end up: | |
90 | ||
91 | @li Direction: Each docked pane has a direction, Top, Bottom, Left, Right, | |
92 | or Center. This is fairly self-explanatory. The pane will be placed in | |
93 | the location specified by this variable. | |
94 | @li Position: More than one pane can be placed inside of a dock. Imagine | |
95 | two panes being docked on the left side of a window. One pane can be | |
96 | placed over another. In proportionally managed docks, the pane | |
97 | position indicates its sequential position, starting with zero. So, in | |
98 | our scenario with two panes docked on the left side, the top pane in | |
99 | the dock would have position 0, and the second one would occupy | |
47d602c1 | 100 | position 1. |
ea6e8ec5 BP |
101 | @li Row: A row can allow for two docks to be placed next to each other. |
102 | One of the most common places for this to happen is in the toolbar. | |
103 | Multiple toolbar rows are allowed, the first row being row 0, and the | |
104 | second row 1. Rows can also be used on vertically docked panes. | |
105 | @li Layer: A layer is akin to an onion. Layer 0 is the very center of the | |
106 | managed pane. Thus, if a pane is in layer 0, it will be closest to the | |
107 | center window (also sometimes known as the "content window"). | |
108 | Increasing layers "swallow up" all layers of a lower value. This can | |
109 | look very similar to multiple rows, but is different because all panes | |
110 | in a lower level yield to panes in higher levels. The best way to | |
111 | understand layers is by running the wxAUI sample. | |
112 | ||
113 | ||
3051a44a | 114 | @beginEventEmissionTable{wxAuiManagerEvent} |
ea6e8ec5 BP |
115 | @event{EVT_AUI_PANE_BUTTON(func)} |
116 | Triggered when any button is pressed for any docked panes. | |
117 | @event{EVT_AUI_PANE_CLOSE(func)} | |
118 | Triggered when a docked or floating pane is closed. | |
119 | @event{EVT_AUI_PANE_MAXIMIZE(func)} | |
120 | Triggered when a pane is maximized. | |
121 | @event{EVT_AUI_PANE_RESTORE(func)} | |
122 | Triggered when a pane is restored. | |
123 | @event{EVT_AUI_RENDER(func)} | |
124 | This event can be caught to override the default renderer in order to | |
125 | custom draw your wxAuiManager window (not recommended). | |
126 | @endEventTable | |
47d602c1 | 127 | |
23324ae1 FM |
128 | @library{wxbase} |
129 | @category{aui} | |
7c913512 | 130 | |
ea6e8ec5 | 131 | @see @ref overview_aui, wxAuiNotebook, wxAuiDockArt, wxAuiPaneInfo |
23324ae1 FM |
132 | */ |
133 | class wxAuiManager : public wxEvtHandler | |
134 | { | |
135 | public: | |
136 | /** | |
4cc4bfaf | 137 | Constructor. @a managed_wnd specifies the wxFrame which should be managed. |
4c51a665 | 138 | @a flags specifies options which allow the frame management behaviour |
23324ae1 FM |
139 | to be modified. |
140 | */ | |
4cc4bfaf | 141 | wxAuiManager(wxWindow* managed_wnd = NULL, |
23324ae1 FM |
142 | unsigned int flags = wxAUI_MGR_DEFAULT); |
143 | ||
144 | /** | |
47d602c1 | 145 | Dtor. |
23324ae1 | 146 | */ |
8d483c9b | 147 | virtual ~wxAuiManager(); |
23324ae1 FM |
148 | |
149 | //@{ | |
150 | /** | |
47d602c1 FM |
151 | AddPane() tells the frame manager to start managing a child window. |
152 | There are several versions of this function. The first version allows | |
153 | the full spectrum of pane parameter possibilities. The second version is | |
154 | used for simpler user interfaces which do not require as much configuration. | |
155 | The last version allows a drop position to be specified, which will determine | |
156 | where the pane will be added. | |
23324ae1 FM |
157 | */ |
158 | bool AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info); | |
7c913512 FM |
159 | bool AddPane(wxWindow* window, int direction = wxLEFT, |
160 | const wxString& caption = wxEmptyString); | |
161 | bool AddPane(wxWindow* window, | |
162 | const wxAuiPaneInfo& pane_info, | |
163 | const wxPoint& drop_pos); | |
23324ae1 FM |
164 | //@} |
165 | ||
166 | /** | |
167 | Tells the wxAuiManager to stop managing the pane specified by window. | |
168 | The window, if in a floated frame, is reparented to the frame managed | |
169 | by wxAuiManager. | |
170 | */ | |
171 | bool DetachPane(wxWindow* window); | |
172 | ||
173 | /** | |
174 | Returns an array of all panes managed by the frame manager. | |
175 | */ | |
d2aa927a | 176 | wxAuiPaneInfoArray& GetAllPanes(); |
23324ae1 FM |
177 | |
178 | /** | |
179 | Returns the current art provider being used. | |
47d602c1 | 180 | @see wxAuiDockArt. |
23324ae1 | 181 | */ |
328f5751 | 182 | wxAuiDockArt* GetArtProvider() const; |
23324ae1 FM |
183 | |
184 | /** | |
47d602c1 FM |
185 | Returns the current dock constraint values. |
186 | See SetDockSizeConstraint() for more information. | |
23324ae1 | 187 | */ |
d2aa927a | 188 | void GetDockSizeConstraint(double* widthpct, double* heightpct) const; |
23324ae1 FM |
189 | |
190 | /** | |
191 | Returns the current manager's flags. | |
192 | */ | |
328f5751 | 193 | unsigned int GetFlags() const; |
23324ae1 FM |
194 | |
195 | /** | |
196 | Returns the frame currently being managed by wxAuiManager. | |
197 | */ | |
328f5751 | 198 | wxWindow* GetManagedWindow() const; |
23324ae1 FM |
199 | |
200 | /** | |
47d602c1 | 201 | Calling this method will return the wxAuiManager for a given window. |
8d483c9b | 202 | The @a window parameter should specify any child window or sub-child |
47d602c1 FM |
203 | window of the frame or window managed by wxAuiManager. |
204 | ||
4cc4bfaf | 205 | The @a window parameter need not be managed by the manager itself, nor does it |
47d602c1 FM |
206 | even need to be a child or sub-child of a managed window. It must however |
207 | be inside the window hierarchy underneath the managed window. | |
23324ae1 FM |
208 | */ |
209 | static wxAuiManager* GetManager(wxWindow* window); | |
210 | ||
211 | //@{ | |
212 | /** | |
47d602c1 FM |
213 | GetPane() is used to lookup a wxAuiPaneInfo object either by window pointer |
214 | or by pane name, which acts as a unique id for a window pane. | |
215 | ||
216 | The returned wxAuiPaneInfo object may then be modified to change a pane's | |
8d483c9b FM |
217 | look, state or position. After one or more modifications to wxAuiPaneInfo, |
218 | wxAuiManager::Update() should be called to commit the changes to the user | |
219 | interface. If the lookup failed (meaning the pane could not be found in the | |
47d602c1 | 220 | manager), a call to the returned wxAuiPaneInfo's IsOk() method will return @false. |
23324ae1 | 221 | */ |
882678eb FM |
222 | wxAuiPaneInfo& GetPane(wxWindow* window); |
223 | wxAuiPaneInfo& GetPane(const wxString& name); | |
23324ae1 FM |
224 | //@} |
225 | ||
226 | /** | |
227 | HideHint() hides any docking hint that may be visible. | |
228 | */ | |
d2aa927a | 229 | virtual void HideHint(); |
23324ae1 FM |
230 | |
231 | /** | |
232 | This method is used to insert either a previously unmanaged pane window | |
7c913512 | 233 | into the frame manager, or to insert a currently managed pane somewhere |
47d602c1 FM |
234 | else. InsertPane() will push all panes, rows, or docks aside and |
235 | insert the window into the position specified by @a insert_location. | |
236 | ||
4cc4bfaf | 237 | Because @a insert_location can specify either a pane, dock row, or dock |
47d602c1 FM |
238 | layer, the @a insert_level parameter is used to disambiguate this. |
239 | The parameter @a insert_level can take a value of wxAUI_INSERT_PANE, | |
240 | wxAUI_INSERT_ROW or wxAUI_INSERT_DOCK. | |
23324ae1 FM |
241 | */ |
242 | bool InsertPane(wxWindow* window, | |
243 | const wxAuiPaneInfo& insert_location, | |
244 | int insert_level = wxAUI_INSERT_PANE); | |
245 | ||
246 | /** | |
57ab6f23 | 247 | LoadPaneInfo() is similar to LoadPerspective, with the exception that it |
47d602c1 FM |
248 | only loads information about a single pane. It is used in combination with |
249 | SavePaneInfo(). | |
23324ae1 FM |
250 | */ |
251 | void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo& pane); | |
252 | ||
253 | /** | |
254 | Loads a saved perspective. If update is @true, wxAuiManager::Update() | |
255 | is automatically invoked, thus realizing the saved perspective on screen. | |
256 | */ | |
257 | bool LoadPerspective(const wxString& perspective, | |
4cc4bfaf | 258 | bool update = true); |
23324ae1 | 259 | |
23324ae1 FM |
260 | /** |
261 | SavePaneInfo() is similar to SavePerspective, with the exception that it only | |
47d602c1 FM |
262 | saves information about a single pane. It is used in combination with |
263 | LoadPaneInfo(). | |
23324ae1 FM |
264 | */ |
265 | wxString SavePaneInfo(wxAuiPaneInfo& pane); | |
266 | ||
267 | /** | |
268 | Saves the entire user interface layout into an encoded wxString, which | |
47d602c1 FM |
269 | can then be stored by the application (probably using wxConfig). |
270 | ||
271 | When a perspective is restored using LoadPerspective(), the entire user | |
23324ae1 FM |
272 | interface will return to the state it was when the perspective was saved. |
273 | */ | |
274 | wxString SavePerspective(); | |
275 | ||
276 | /** | |
277 | Instructs wxAuiManager to use art provider specified by parameter | |
8d483c9b | 278 | @a art_provider for all drawing calls. |
47d602c1 FM |
279 | This allows plugable look-and-feel features. The previous art provider object, |
280 | if any, will be deleted by wxAuiManager. | |
281 | ||
282 | @see wxAuiDockArt. | |
23324ae1 FM |
283 | */ |
284 | void SetArtProvider(wxAuiDockArt* art_provider); | |
285 | ||
286 | /** | |
287 | When a user creates a new dock by dragging a window into a docked position, | |
47d602c1 | 288 | often times the large size of the window will create a dock that is unwieldly |
8d483c9b | 289 | large. wxAuiManager by default limits the size of any new dock to 1/3 of the |
47d602c1 FM |
290 | window size. For horizontal docks, this would be 1/3 of the window height. |
291 | For vertical docks, 1/3 of the width. | |
292 | ||
293 | Calling this function will adjust this constraint value. The numbers must be | |
294 | between 0.0 and 1.0. For instance, calling SetDockSizeContraint with | |
295 | 0.5, 0.5 will cause new docks to be limited to half of the size of the | |
296 | entire managed window. | |
23324ae1 FM |
297 | */ |
298 | void SetDockSizeConstraint(double widthpct, double heightpct); | |
299 | ||
300 | /** | |
47d602c1 | 301 | This method is used to specify wxAuiManager's settings flags. @a flags |
4c51a665 | 302 | specifies options which allow the frame management behaviour to be modified. |
23324ae1 | 303 | */ |
d56f17d8 | 304 | void SetFlags(unsigned int flags); |
23324ae1 FM |
305 | |
306 | /** | |
7c913512 | 307 | Called to specify the frame or window which is to be managed by wxAuiManager. |
47d602c1 FM |
308 | Frame management is not restricted to just frames. Child windows or custom |
309 | controls are also allowed. | |
23324ae1 FM |
310 | */ |
311 | void SetManagedWindow(wxWindow* managed_wnd); | |
312 | ||
313 | /** | |
314 | This function is used by controls to explicitly show a hint window at the | |
47d602c1 | 315 | specified rectangle. It is rarely called, and is mostly used by controls |
8d483c9b | 316 | implementing custom pane drag/drop behaviour. |
47d602c1 | 317 | The specified rectangle should be in screen coordinates. |
23324ae1 | 318 | */ |
d2aa927a | 319 | virtual void ShowHint(const wxRect& rect); |
23324ae1 FM |
320 | |
321 | /** | |
322 | Uninitializes the framework and should be called before a managed frame or | |
8d483c9b FM |
323 | window is destroyed. UnInit() is usually called in the managed wxFrame's |
324 | destructor. It is necessary to call this function before the managed frame | |
325 | or window is destroyed, otherwise the manager cannot remove its custom event | |
47d602c1 | 326 | handlers from a window. |
23324ae1 FM |
327 | */ |
328 | void UnInit(); | |
329 | ||
330 | /** | |
331 | This method is called after any number of changes are | |
332 | made to any of the managed panes. Update() must be invoked after | |
333 | AddPane() or InsertPane() are called in order to "realize" or "commit" | |
334 | the changes. In addition, any number of changes may be made to | |
335 | wxAuiPaneInfo structures (retrieved with wxAuiManager::GetPane), but to | |
336 | realize the changes, Update() must be called. This construction allows | |
337 | pane flicker to be avoided by updating the whole layout at one time. | |
338 | */ | |
339 | void Update(); | |
1d497b99 FM |
340 | |
341 | protected: | |
342 | ||
343 | /** | |
344 | ProcessDockResult() is a protected member of the wxAUI layout manager. | |
345 | It can be overridden by derived classes to provide custom docking calculations. | |
346 | */ | |
347 | virtual bool ProcessDockResult(wxAuiPaneInfo& target, | |
348 | const wxAuiPaneInfo& new_pos); | |
23324ae1 FM |
349 | }; |
350 | ||
351 | ||
e54c96f1 | 352 | |
23324ae1 FM |
353 | /** |
354 | @class wxAuiPaneInfo | |
7c913512 | 355 | |
23324ae1 | 356 | wxAuiPaneInfo is part of the wxAUI class framework. |
47d602c1 | 357 | See also @ref overview_aui. |
7c913512 | 358 | |
23324ae1 | 359 | wxAuiPaneInfo specifies all the parameters for a pane. |
47d602c1 FM |
360 | These parameters specify where the pane is on the screen, whether it is docked |
361 | or floating, or hidden. | |
8d483c9b | 362 | In addition, these parameters specify the pane's docked position, floating |
47d602c1 | 363 | position, preferred size, minimum size, caption text among many other parameters. |
7c913512 | 364 | |
23324ae1 FM |
365 | @library{wxbase} |
366 | @category{aui} | |
7c913512 | 367 | |
e54c96f1 | 368 | @see wxAuiManager, wxAuiDockArt |
23324ae1 | 369 | */ |
7c913512 | 370 | class wxAuiPaneInfo |
23324ae1 FM |
371 | { |
372 | public: | |
47d602c1 FM |
373 | wxAuiPaneInfo(); |
374 | ||
23324ae1 FM |
375 | /** |
376 | Copy constructor. | |
377 | */ | |
7c913512 | 378 | wxAuiPaneInfo(const wxAuiPaneInfo& c); |
23324ae1 FM |
379 | |
380 | //@{ | |
381 | /** | |
382 | BestSize() sets the ideal size for the pane. The docking manager will attempt | |
383 | to use this size as much as possible when docking or floating the pane. | |
384 | */ | |
882678eb FM |
385 | wxAuiPaneInfo& BestSize(const wxSize& size); |
386 | wxAuiPaneInfo& BestSize(int x, int y); | |
23324ae1 FM |
387 | //@} |
388 | ||
389 | /** | |
390 | Bottom() sets the pane dock position to the bottom side of the frame. This is | |
391 | the same thing as calling Direction(wxAUI_DOCK_BOTTOM). | |
392 | */ | |
d2aa927a | 393 | wxAuiPaneInfo& Bottom(); |
23324ae1 FM |
394 | |
395 | /** | |
396 | BottomDockable() indicates whether a pane can be docked at the bottom of the | |
397 | frame. | |
398 | */ | |
d2aa927a | 399 | wxAuiPaneInfo& BottomDockable(bool b = true); |
23324ae1 FM |
400 | |
401 | /** | |
402 | Caption() sets the caption of the pane. | |
403 | */ | |
d2aa927a | 404 | wxAuiPaneInfo& Caption(const wxString& c); |
23324ae1 FM |
405 | |
406 | /** | |
407 | CaptionVisible indicates that a pane caption should be visible. If @false, no | |
408 | pane caption is drawn. | |
409 | */ | |
d2aa927a | 410 | wxAuiPaneInfo& CaptionVisible(bool visible = true); |
23324ae1 FM |
411 | |
412 | //@{ | |
413 | /** | |
414 | Center() sets the pane dock position to the left side of the frame. | |
415 | The centre pane is the space in the middle after all border panes (left, top, | |
416 | right, bottom) are subtracted from the layout. | |
23324ae1 FM |
417 | This is the same thing as calling Direction(wxAUI_DOCK_CENTRE). |
418 | */ | |
382f12e4 FM |
419 | wxAuiPaneInfo& Centre(); |
420 | wxAuiPaneInfo& Center(); | |
23324ae1 FM |
421 | //@} |
422 | ||
423 | //@{ | |
424 | /** | |
425 | CentrePane() specifies that the pane should adopt the default center pane | |
8d483c9b | 426 | settings. Centre panes usually do not have caption bars. |
47d602c1 FM |
427 | This function provides an easy way of preparing a pane to be displayed in |
428 | the center dock position. | |
23324ae1 | 429 | */ |
382f12e4 FM |
430 | wxAuiPaneInfo& CentrePane(); |
431 | wxAuiPaneInfo& CenterPane(); | |
23324ae1 FM |
432 | //@} |
433 | ||
434 | /** | |
435 | CloseButton() indicates that a close button should be drawn for the pane. | |
436 | */ | |
d2aa927a | 437 | wxAuiPaneInfo& CloseButton(bool visible = true); |
23324ae1 FM |
438 | |
439 | /** | |
440 | DefaultPane() specifies that the pane should adopt the default pane settings. | |
441 | */ | |
d2aa927a | 442 | wxAuiPaneInfo& DefaultPane(); |
23324ae1 FM |
443 | |
444 | /** | |
57ab6f23 | 445 | DestroyOnClose() indicates whether a pane should be destroyed when it is closed. |
8d483c9b | 446 | Normally a pane is simply hidden when the close button is clicked. |
47d602c1 FM |
447 | Setting DestroyOnClose to @true will cause the window to be destroyed when |
448 | the user clicks the pane's close button. | |
23324ae1 | 449 | */ |
d2aa927a | 450 | wxAuiPaneInfo& DestroyOnClose(bool b = true); |
23324ae1 FM |
451 | |
452 | /** | |
453 | Direction() determines the direction of the docked pane. It is functionally the | |
47d602c1 FM |
454 | same as calling Left(), Right(), Top() or Bottom(), except that docking direction |
455 | may be specified programmatically via the parameter. | |
23324ae1 | 456 | */ |
d2aa927a | 457 | wxAuiPaneInfo& Direction(int direction); |
23324ae1 FM |
458 | |
459 | /** | |
460 | Dock() indicates that a pane should be docked. It is the opposite of Float(). | |
461 | */ | |
d2aa927a | 462 | wxAuiPaneInfo& Dock(); |
23324ae1 FM |
463 | |
464 | /** | |
465 | DockFixed() causes the containing dock to have no resize sash. This is useful | |
8d483c9b | 466 | for creating panes that span the entire width or height of a dock, but should |
47d602c1 | 467 | not be resizable in the other direction. |
23324ae1 | 468 | */ |
d2aa927a | 469 | wxAuiPaneInfo& DockFixed(bool b = true); |
23324ae1 FM |
470 | |
471 | /** | |
472 | Dockable() specifies whether a frame can be docked or not. It is the same as | |
473 | specifying TopDockable(b).BottomDockable(b).LeftDockable(b).RightDockable(b). | |
474 | */ | |
d2aa927a | 475 | wxAuiPaneInfo& Dockable(bool b = true); |
23324ae1 FM |
476 | |
477 | /** | |
478 | Fixed() forces a pane to be fixed size so that it cannot be resized. After | |
479 | calling Fixed(), IsFixed() will return @true. | |
480 | */ | |
d2aa927a | 481 | wxAuiPaneInfo& Fixed(); |
23324ae1 FM |
482 | |
483 | /** | |
484 | Float() indicates that a pane should be floated. It is the opposite of Dock(). | |
485 | */ | |
d2aa927a | 486 | wxAuiPaneInfo& Float(); |
23324ae1 FM |
487 | |
488 | /** | |
489 | Floatable() sets whether the user will be able to undock a pane and turn it | |
490 | into a floating window. | |
491 | */ | |
d2aa927a | 492 | wxAuiPaneInfo& Floatable(bool b = true); |
23324ae1 FM |
493 | |
494 | //@{ | |
495 | /** | |
496 | FloatingPosition() sets the position of the floating pane. | |
497 | */ | |
882678eb FM |
498 | wxAuiPaneInfo& FloatingPosition(const wxPoint& pos); |
499 | wxAuiPaneInfo& FloatingPosition(int x, int y); | |
23324ae1 FM |
500 | //@} |
501 | ||
502 | //@{ | |
503 | /** | |
504 | FloatingSize() sets the size of the floating pane. | |
505 | */ | |
882678eb FM |
506 | wxAuiPaneInfo& FloatingSize(const wxSize& size); |
507 | wxAuiPaneInfo& FloatingSize(int x, int y); | |
23324ae1 FM |
508 | //@} |
509 | ||
510 | /** | |
511 | Gripper() indicates that a gripper should be drawn for the pane. | |
512 | */ | |
d2aa927a | 513 | wxAuiPaneInfo& Gripper(bool visible = true); |
23324ae1 FM |
514 | |
515 | /** | |
516 | GripperTop() indicates that a gripper should be drawn at the top of the pane. | |
517 | */ | |
d2aa927a | 518 | wxAuiPaneInfo& GripperTop(bool attop = true); |
23324ae1 FM |
519 | |
520 | /** | |
521 | HasBorder() returns @true if the pane displays a border. | |
522 | */ | |
328f5751 | 523 | bool HasBorder() const; |
23324ae1 FM |
524 | |
525 | /** | |
526 | HasCaption() returns @true if the pane displays a caption. | |
527 | */ | |
328f5751 | 528 | bool HasCaption() const; |
23324ae1 FM |
529 | |
530 | /** | |
531 | HasCloseButton() returns @true if the pane displays a button to close the pane. | |
532 | */ | |
328f5751 | 533 | bool HasCloseButton() const; |
23324ae1 FM |
534 | |
535 | /** | |
e227438f VZ |
536 | HasFlag() returns @true if the property specified by flag is active for |
537 | the pane. | |
23324ae1 | 538 | */ |
e227438f | 539 | bool HasFlag(int flag) const; |
23324ae1 FM |
540 | |
541 | /** | |
542 | HasGripper() returns @true if the pane displays a gripper. | |
543 | */ | |
328f5751 | 544 | bool HasGripper() const; |
23324ae1 FM |
545 | |
546 | /** | |
547 | HasGripper() returns @true if the pane displays a gripper at the top. | |
548 | */ | |
328f5751 | 549 | bool HasGripperTop() const; |
23324ae1 FM |
550 | |
551 | /** | |
552 | HasMaximizeButton() returns @true if the pane displays a button to maximize the | |
553 | pane. | |
554 | */ | |
328f5751 | 555 | bool HasMaximizeButton() const; |
23324ae1 FM |
556 | |
557 | /** | |
558 | HasMinimizeButton() returns @true if the pane displays a button to minimize the | |
559 | pane. | |
560 | */ | |
328f5751 | 561 | bool HasMinimizeButton() const; |
23324ae1 FM |
562 | |
563 | /** | |
564 | HasPinButton() returns @true if the pane displays a button to float the pane. | |
565 | */ | |
328f5751 | 566 | bool HasPinButton() const; |
23324ae1 FM |
567 | |
568 | /** | |
569 | Hide() indicates that a pane should be hidden. | |
570 | */ | |
d2aa927a | 571 | wxAuiPaneInfo& Hide(); |
23324ae1 | 572 | |
4254f672 VZ |
573 | /** |
574 | Icon() sets the icon of the pane. | |
575 | ||
576 | Notice that the height of the icon should be smaller than the value | |
577 | returned by wxAuiDockArt::GetMetric(wxAUI_DOCKART_CAPTION_SIZE) to | |
578 | ensure that it appears correctly. | |
579 | ||
580 | @since 2.9.2 | |
581 | */ | |
582 | wxAuiPaneInfo& Icon(const wxBitmap& b); | |
583 | ||
23324ae1 FM |
584 | /** |
585 | IsBottomDockable() returns @true if the pane can be docked at the bottom of the | |
586 | managed frame. | |
ab84bafe VZ |
587 | |
588 | @see IsDockable() | |
23324ae1 | 589 | */ |
328f5751 | 590 | bool IsBottomDockable() const; |
23324ae1 FM |
591 | |
592 | /** | |
ab84bafe VZ |
593 | Returns @true if the pane can be docked at any side. |
594 | ||
595 | @see IsTopDockable(), IsBottomDockable(), IsLeftDockable(), IsRightDockable() | |
596 | ||
597 | @since 2.9.2 | |
598 | */ | |
599 | bool IsDockable() const; | |
600 | ||
601 | /** | |
602 | IsDocked() returns @true if the pane is currently docked. | |
23324ae1 | 603 | */ |
328f5751 | 604 | bool IsDocked() const; |
23324ae1 FM |
605 | |
606 | /** | |
607 | IsFixed() returns @true if the pane cannot be resized. | |
608 | */ | |
328f5751 | 609 | bool IsFixed() const; |
23324ae1 FM |
610 | |
611 | /** | |
612 | IsFloatable() returns @true if the pane can be undocked and displayed as a | |
613 | floating window. | |
614 | */ | |
328f5751 | 615 | bool IsFloatable() const; |
23324ae1 FM |
616 | |
617 | /** | |
618 | IsFloating() returns @true if the pane is floating. | |
619 | */ | |
328f5751 | 620 | bool IsFloating() const; |
23324ae1 FM |
621 | |
622 | /** | |
623 | IsLeftDockable() returns @true if the pane can be docked on the left of the | |
624 | managed frame. | |
ab84bafe VZ |
625 | |
626 | @see IsDockable() | |
23324ae1 | 627 | */ |
328f5751 | 628 | bool IsLeftDockable() const; |
23324ae1 FM |
629 | |
630 | /** | |
631 | IsMoveable() returns @true if the docked frame can be undocked or moved to | |
632 | another dock position. | |
633 | */ | |
328f5751 | 634 | bool IsMovable() const; |
23324ae1 FM |
635 | |
636 | /** | |
637 | IsOk() returns @true if the wxAuiPaneInfo structure is valid. A pane structure | |
638 | is valid if it has an associated window. | |
639 | */ | |
328f5751 | 640 | bool IsOk() const; |
23324ae1 FM |
641 | |
642 | /** | |
643 | IsResizable() returns @true if the pane can be resized. | |
644 | */ | |
328f5751 | 645 | bool IsResizable() const; |
23324ae1 FM |
646 | |
647 | /** | |
648 | IsRightDockable() returns @true if the pane can be docked on the right of the | |
649 | managed frame. | |
ab84bafe VZ |
650 | |
651 | @see IsDockable() | |
23324ae1 | 652 | */ |
328f5751 | 653 | bool IsRightDockable() const; |
23324ae1 FM |
654 | |
655 | /** | |
656 | IsShown() returns @true if the pane is currently shown. | |
657 | */ | |
328f5751 | 658 | bool IsShown() const; |
23324ae1 FM |
659 | |
660 | /** | |
661 | IsToolbar() returns @true if the pane contains a toolbar. | |
662 | */ | |
328f5751 | 663 | bool IsToolbar() const; |
23324ae1 FM |
664 | |
665 | /** | |
666 | IsTopDockable() returns @true if the pane can be docked at the top of the | |
667 | managed frame. | |
ab84bafe VZ |
668 | |
669 | @see IsDockable() | |
23324ae1 | 670 | */ |
328f5751 | 671 | bool IsTopDockable() const; |
23324ae1 FM |
672 | |
673 | /** | |
674 | Layer() determines the layer of the docked pane. The dock layer is similar to | |
8d483c9b FM |
675 | an onion, the inner-most layer being layer 0. Each shell moving in the outward |
676 | direction has a higher layer number. This allows for more complex docking layout | |
47d602c1 | 677 | formation. |
23324ae1 | 678 | */ |
d2aa927a | 679 | wxAuiPaneInfo& Layer(int layer); |
23324ae1 FM |
680 | |
681 | /** | |
682 | Left() sets the pane dock position to the left side of the frame. This is the | |
683 | same thing as calling Direction(wxAUI_DOCK_LEFT). | |
684 | */ | |
d2aa927a | 685 | wxAuiPaneInfo& Left(); |
23324ae1 FM |
686 | |
687 | /** | |
688 | LeftDockable() indicates whether a pane can be docked on the left of the frame. | |
689 | */ | |
d2aa927a | 690 | wxAuiPaneInfo& LeftDockable(bool b = true); |
23324ae1 FM |
691 | |
692 | //@{ | |
693 | /** | |
694 | MaxSize() sets the maximum size of the pane. | |
695 | */ | |
882678eb FM |
696 | wxAuiPaneInfo& MaxSize(const wxSize& size); |
697 | wxAuiPaneInfo& MaxSize(int x, int y); | |
23324ae1 FM |
698 | //@} |
699 | ||
700 | /** | |
701 | MaximizeButton() indicates that a maximize button should be drawn for the pane. | |
702 | */ | |
d2aa927a | 703 | wxAuiPaneInfo& MaximizeButton(bool visible = true); |
23324ae1 FM |
704 | |
705 | //@{ | |
706 | /** | |
707 | MinSize() sets the minimum size of the pane. Please note that this is only | |
708 | partially supported as of this writing. | |
709 | */ | |
882678eb FM |
710 | wxAuiPaneInfo& MinSize(const wxSize& size); |
711 | wxAuiPaneInfo& MinSize(int x, int y); | |
23324ae1 FM |
712 | //@} |
713 | ||
714 | /** | |
715 | MinimizeButton() indicates that a minimize button should be drawn for the pane. | |
716 | */ | |
d2aa927a | 717 | wxAuiPaneInfo& MinimizeButton(bool visible = true); |
23324ae1 FM |
718 | |
719 | /** | |
720 | Movable indicates whether a frame can be moved. | |
721 | */ | |
d2aa927a | 722 | wxAuiPaneInfo& Movable(bool b = true); |
23324ae1 FM |
723 | |
724 | /** | |
725 | Name() sets the name of the pane so it can be referenced in lookup functions. | |
8d483c9b | 726 | If a name is not specified by the user, a random name is assigned to the pane |
47d602c1 | 727 | when it is added to the manager. |
23324ae1 | 728 | */ |
d2aa927a | 729 | wxAuiPaneInfo& Name(const wxString& n); |
23324ae1 FM |
730 | |
731 | /** | |
732 | PaneBorder indicates that a border should be drawn for the pane. | |
733 | */ | |
d2aa927a | 734 | wxAuiPaneInfo& PaneBorder(bool visible = true); |
23324ae1 FM |
735 | |
736 | /** | |
737 | PinButton() indicates that a pin button should be drawn for the pane. | |
738 | */ | |
d2aa927a | 739 | wxAuiPaneInfo& PinButton(bool visible = true); |
23324ae1 FM |
740 | |
741 | /** | |
742 | Position() determines the position of the docked pane. | |
743 | */ | |
d2aa927a | 744 | wxAuiPaneInfo& Position(int pos); |
23324ae1 FM |
745 | |
746 | /** | |
747 | Resizable() allows a pane to be resized if the parameter is @true, and forces it | |
748 | to be a fixed size if the parameter is @false. This is simply an antonym for Fixed(). | |
749 | */ | |
d2aa927a | 750 | wxAuiPaneInfo& Resizable(bool resizable = true); |
23324ae1 FM |
751 | |
752 | /** | |
753 | Right() sets the pane dock position to the right side of the frame. | |
754 | */ | |
d2aa927a | 755 | wxAuiPaneInfo& Right(); |
23324ae1 FM |
756 | |
757 | /** | |
758 | RightDockable() indicates whether a pane can be docked on the right of the | |
759 | frame. | |
760 | */ | |
d2aa927a | 761 | wxAuiPaneInfo& RightDockable(bool b = true); |
23324ae1 FM |
762 | |
763 | /** | |
764 | Row() determines the row of the docked pane. | |
765 | */ | |
d2aa927a | 766 | wxAuiPaneInfo& Row(int row); |
23324ae1 FM |
767 | |
768 | /** | |
769 | Write the safe parts of a newly loaded PaneInfo structure "source" into "this" | |
770 | used on loading perspectives etc. | |
771 | */ | |
772 | void SafeSet(wxAuiPaneInfo source); | |
773 | ||
774 | /** | |
775 | SetFlag() turns the property given by flag on or off with the option_state | |
776 | parameter. | |
777 | */ | |
d56f17d8 | 778 | wxAuiPaneInfo& SetFlag(int flag, bool option_state); |
23324ae1 FM |
779 | |
780 | /** | |
781 | Show() indicates that a pane should be shown. | |
782 | */ | |
d2aa927a | 783 | wxAuiPaneInfo& Show(bool show = true); |
23324ae1 FM |
784 | |
785 | /** | |
786 | ToolbarPane() specifies that the pane should adopt the default toolbar pane | |
787 | settings. | |
788 | */ | |
d2aa927a | 789 | wxAuiPaneInfo& ToolbarPane(); |
23324ae1 FM |
790 | |
791 | /** | |
792 | Top() sets the pane dock position to the top of the frame. | |
793 | */ | |
d2aa927a | 794 | wxAuiPaneInfo& Top(); |
23324ae1 FM |
795 | |
796 | /** | |
797 | TopDockable() indicates whether a pane can be docked at the top of the frame. | |
798 | */ | |
d2aa927a | 799 | wxAuiPaneInfo& TopDockable(bool b = true); |
23324ae1 FM |
800 | |
801 | /** | |
8d483c9b FM |
802 | Window() assigns the window pointer that the wxAuiPaneInfo should use. |
803 | This normally does not need to be specified, as the window pointer is | |
804 | automatically assigned to the wxAuiPaneInfo structure as soon as it is added | |
47d602c1 | 805 | to the manager. |
23324ae1 | 806 | */ |
d2aa927a | 807 | wxAuiPaneInfo& Window(wxWindow* w); |
23324ae1 FM |
808 | |
809 | /** | |
810 | Makes a copy of the wxAuiPaneInfo object. | |
811 | */ | |
1d497b99 | 812 | wxAuiPaneInfo& operator=(const wxAuiPaneInfo& c); |
23324ae1 | 813 | }; |
e54c96f1 | 814 | |
ea6e8ec5 BP |
815 | |
816 | ||
817 | /** | |
818 | @class wxAuiManagerEvent | |
819 | ||
820 | Event used to indicate various actions taken with wxAuiManager. | |
821 | ||
822 | See wxAuiManager for available event types. | |
823 | ||
9ccf8289 FM |
824 | @beginEventTable{wxAuiManagerEvent} |
825 | @event{EVT_AUI_PANE_BUTTON(func)} | |
826 | Triggered when any button is pressed for any docked panes. | |
827 | @event{EVT_AUI_PANE_CLOSE(func)} | |
828 | Triggered when a docked or floating pane is closed. | |
829 | @event{EVT_AUI_PANE_MAXIMIZE(func)} | |
830 | Triggered when a pane is maximized. | |
831 | @event{EVT_AUI_PANE_RESTORE(func)} | |
832 | Triggered when a pane is restored. | |
833 | @event{EVT_AUI_RENDER(func)} | |
834 | This event can be caught to override the default renderer in order to | |
835 | custom draw your wxAuiManager window (not recommended). | |
836 | @endEventTable | |
837 | ||
ea6e8ec5 BP |
838 | @library{wxaui} |
839 | @category{events,aui} | |
840 | ||
841 | @see wxAuiManager, wxAuiPaneInfo | |
842 | */ | |
843 | class wxAuiManagerEvent : public wxEvent | |
844 | { | |
845 | public: | |
846 | /** | |
847 | Constructor. | |
848 | */ | |
849 | wxAuiManagerEvent(wxEventType type = wxEVT_NULL); | |
850 | ||
851 | /** | |
852 | @return @true if this event can be vetoed. | |
853 | ||
854 | @see Veto() | |
855 | */ | |
856 | bool CanVeto(); | |
857 | ||
858 | /** | |
859 | @return The ID of the button that was clicked. | |
860 | */ | |
861 | int GetButton(); | |
862 | ||
863 | /** | |
864 | @todo What is this? | |
865 | */ | |
866 | wxDC* GetDC(); | |
867 | ||
868 | /** | |
869 | @return @true if this event was vetoed. | |
870 | ||
871 | @see Veto() | |
872 | */ | |
873 | bool GetVeto(); | |
874 | ||
875 | /** | |
876 | @return The wxAuiManager this event is associated with. | |
877 | */ | |
878 | wxAuiManager* GetManager(); | |
879 | ||
880 | /** | |
881 | @return The pane this event is associated with. | |
882 | */ | |
883 | wxAuiPaneInfo* GetPane(); | |
884 | ||
885 | /** | |
886 | Sets the ID of the button clicked that triggered this event. | |
887 | */ | |
888 | void SetButton(int button); | |
889 | ||
890 | /** | |
891 | Sets whether or not this event can be vetoed. | |
892 | */ | |
893 | void SetCanVeto(bool can_veto); | |
894 | ||
895 | /** | |
896 | @todo What is this? | |
897 | */ | |
898 | void SetDC(wxDC* pdc); | |
899 | ||
900 | /** | |
901 | Sets the wxAuiManager this event is associated with. | |
902 | */ | |
903 | void SetManager(wxAuiManager* manager); | |
904 | ||
905 | /** | |
906 | Sets the pane this event is associated with. | |
907 | */ | |
908 | void SetPane(wxAuiPaneInfo* pane); | |
909 | ||
910 | /** | |
911 | Cancels the action indicated by this event if CanVeto() is @true. | |
912 | */ | |
913 | void Veto(bool veto = true); | |
914 | }; | |
915 |