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