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