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