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