1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/aui/framemanager.h
3 // Purpose: wxaui: wx advanced user interface - docking window manager
4 // Author: Benjamin I. Williams
8 // Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
9 // Licence: wxWindows Library Licence, Version 3.1
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_FRAMEMANAGER_H_
13 #define _WX_FRAMEMANAGER_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
23 #include "wx/dynarray.h"
24 #include "wx/gdicmn.h"
25 #include "wx/window.h"
29 enum wxFrameManagerDock
34 wxAUI_DOCK_BOTTOM
= 3,
36 wxAUI_DOCK_CENTER
= 5,
37 wxAUI_DOCK_CENTRE
= wxAUI_DOCK_CENTER
40 enum wxFrameManagerOption
42 wxAUI_MGR_ALLOW_FLOATING
= 1 << 0,
43 wxAUI_MGR_ALLOW_ACTIVE_PANE
= 1 << 1,
44 wxAUI_MGR_TRANSPARENT_DRAG
= 1 << 2,
45 wxAUI_MGR_TRANSPARENT_HINT
= 1 << 3,
46 wxAUI_MGR_TRANSPARENT_HINT_FADE
= 1 << 4,
47 // The venetian blind effect is ONLY used when the wxAUI_MGR_TRANSPARENT_HINT has been used, but
48 // at runtime we determine we cannot use transparency (because, for instance, the OS does not support it).
49 // setting this flag drops back in such circumstances (only) to the behaviour without wxAUI_MGR_TRANSPARENT_HINT
50 wxAUI_MGR_DISABLE_VENETIAN_BLINDS
= 1 << 5,
51 wxAUI_MGR_DISABLE_VENETIAN_BLINDS_FADE
= 1 << 6,
53 wxAUI_MGR_DEFAULT
= wxAUI_MGR_ALLOW_FLOATING
|
54 wxAUI_MGR_TRANSPARENT_HINT
|
55 wxAUI_MGR_TRANSPARENT_HINT_FADE
|
56 wxAUI_MGR_DISABLE_VENETIAN_BLINDS_FADE
59 enum wxPaneDockArtSetting
61 wxAUI_ART_SASH_SIZE
= 0,
62 wxAUI_ART_CAPTION_SIZE
= 1,
63 wxAUI_ART_GRIPPER_SIZE
= 2,
64 wxAUI_ART_PANE_BORDER_SIZE
= 3,
65 wxAUI_ART_PANE_BUTTON_SIZE
= 4,
66 wxAUI_ART_BACKGROUND_COLOUR
= 5,
67 wxAUI_ART_SASH_COLOUR
= 6,
68 wxAUI_ART_ACTIVE_CAPTION_COLOUR
= 7,
69 wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR
= 8,
70 wxAUI_ART_INACTIVE_CAPTION_COLOUR
= 9,
71 wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR
= 10,
72 wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR
= 11,
73 wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR
= 12,
74 wxAUI_ART_BORDER_COLOUR
= 13,
75 wxAUI_ART_GRIPPER_COLOUR
= 14,
76 wxAUI_ART_CAPTION_FONT
= 15,
77 wxAUI_ART_GRADIENT_TYPE
= 16
80 enum wxPaneDockArtGradients
82 wxAUI_GRADIENT_NONE
= 0,
83 wxAUI_GRADIENT_VERTICAL
= 1,
84 wxAUI_GRADIENT_HORIZONTAL
= 2
87 enum wxPaneButtonState
89 wxAUI_BUTTON_STATE_NORMAL
= 0,
90 wxAUI_BUTTON_STATE_HOVER
= 1,
91 wxAUI_BUTTON_STATE_PRESSED
= 2
94 enum wxPaneInsertLevel
96 wxAUI_INSERT_PANE
= 0,
103 // forwards and array declarations
109 class wxFrameManagerEvent
;
112 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDockInfo
, wxDockInfoArray
, WXDLLIMPEXP_AUI
);
113 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDockUIPart
, wxDockUIPartArray
, WXDLLIMPEXP_AUI
);
114 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxPaneButton
, wxPaneButtonArray
, WXDLLIMPEXP_AUI
);
115 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxPaneInfo
, wxPaneInfoArray
, WXDLLIMPEXP_AUI
);
116 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxPaneInfo
*, wxPaneInfoPtrArray
, class WXDLLIMPEXP_AUI
);
117 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxDockInfo
*, wxDockInfoPtrArray
, class WXDLLIMPEXP_AUI
);
120 extern WXDLLIMPEXP_AUI wxDockInfo wxNullDockInfo
;
121 extern WXDLLIMPEXP_AUI wxPaneInfo wxNullPaneInfo
;
125 class WXDLLIMPEXP_AUI wxPaneInfo
134 dock_direction
= wxAUI_DOCK_LEFT
;
138 floating_pos
= wxDefaultPosition
;
139 floating_size
= wxDefaultSize
;
140 best_size
= wxDefaultSize
;
141 min_size
= wxDefaultSize
;
142 max_size
= wxDefaultSize
;
151 wxPaneInfo(const wxPaneInfo
& c
)
158 dock_direction
= c
.dock_direction
;
159 dock_layer
= c
.dock_layer
;
160 dock_row
= c
.dock_row
;
161 dock_pos
= c
.dock_pos
;
162 best_size
= c
.best_size
;
163 min_size
= c
.min_size
;
164 max_size
= c
.max_size
;
165 floating_pos
= c
.floating_pos
;
166 floating_size
= c
.floating_size
;
167 dock_proportion
= c
.dock_proportion
;
172 wxPaneInfo
& operator=(const wxPaneInfo
& c
)
179 dock_direction
= c
.dock_direction
;
180 dock_layer
= c
.dock_layer
;
181 dock_row
= c
.dock_row
;
182 dock_pos
= c
.dock_pos
;
183 best_size
= c
.best_size
;
184 min_size
= c
.min_size
;
185 max_size
= c
.max_size
;
186 floating_pos
= c
.floating_pos
;
187 floating_size
= c
.floating_size
;
188 dock_proportion
= c
.dock_proportion
;
195 // Write the safe parts of a newly loaded PaneInfo structure "source" into "this"
196 // used on loading perspectives etc.
197 void SafeSet(wxPaneInfo source
)
199 // note source is not passed by reference so we can overwrite, to keep the
200 // unsafe bits of "dest"
201 source
.window
= window
;
202 source
.frame
= frame
;
203 source
.buttons
= buttons
;
208 bool IsOk() const { return (window
!= NULL
) ? true : false; }
209 bool IsFixed() const { return !HasFlag(optionResizable
); }
210 bool IsResizable() const { return HasFlag(optionResizable
); }
211 bool IsShown() const { return !HasFlag(optionHidden
); }
212 bool IsFloating() const { return HasFlag(optionFloating
); }
213 bool IsDocked() const { return !HasFlag(optionFloating
); }
214 bool IsToolbar() const { return HasFlag(optionToolbar
); }
215 bool IsTopDockable() const { return HasFlag(optionTopDockable
); }
216 bool IsBottomDockable() const { return HasFlag(optionBottomDockable
); }
217 bool IsLeftDockable() const { return HasFlag(optionLeftDockable
); }
218 bool IsRightDockable() const { return HasFlag(optionRightDockable
); }
219 bool IsFloatable() const { return HasFlag(optionFloatable
); }
220 bool IsMovable() const { return HasFlag(optionMovable
); }
221 bool HasCaption() const { return HasFlag(optionCaption
); }
222 bool HasGripper() const { return HasFlag(optionGripper
); }
223 bool HasBorder() const { return HasFlag(optionPaneBorder
); }
224 bool HasCloseButton() const { return HasFlag(buttonClose
); }
225 bool HasMaximizeButton() const { return HasFlag(buttonMaximize
); }
226 bool HasMinimizeButton() const { return HasFlag(buttonMinimize
); }
227 bool HasPinButton() const { return HasFlag(buttonPin
); }
228 bool HasGripperTop() const { return HasFlag(optionGripperTop
); }
231 %typemap
(out
) wxPaneInfo
& { $result
= $self
; Py_INCREF($result
); }
233 wxPaneInfo
& Window(wxWindow
* w
) { window
= w
; return *this; }
234 wxPaneInfo
& Name(const wxString
& n
) { name
= n
; return *this; }
235 wxPaneInfo
& Caption(const wxString
& c
) { caption
= c
; return *this; }
236 wxPaneInfo
& Left() { dock_direction
= wxAUI_DOCK_LEFT
; return *this; }
237 wxPaneInfo
& Right() { dock_direction
= wxAUI_DOCK_RIGHT
; return *this; }
238 wxPaneInfo
& Top() { dock_direction
= wxAUI_DOCK_TOP
; return *this; }
239 wxPaneInfo
& Bottom() { dock_direction
= wxAUI_DOCK_BOTTOM
; return *this; }
240 wxPaneInfo
& Center() { dock_direction
= wxAUI_DOCK_CENTER
; return *this; }
241 wxPaneInfo
& Centre() { dock_direction
= wxAUI_DOCK_CENTRE
; return *this; }
242 wxPaneInfo
& Direction(int direction
) { dock_direction
= direction
; return *this; }
243 wxPaneInfo
& Layer(int layer
) { dock_layer
= layer
; return *this; }
244 wxPaneInfo
& Row(int row
) { dock_row
= row
; return *this; }
245 wxPaneInfo
& Position(int pos
) { dock_pos
= pos
; return *this; }
246 wxPaneInfo
& BestSize(const wxSize
& size
) { best_size
= size
; return *this; }
247 wxPaneInfo
& MinSize(const wxSize
& size
) { min_size
= size
; return *this; }
248 wxPaneInfo
& MaxSize(const wxSize
& size
) { max_size
= size
; return *this; }
249 wxPaneInfo
& BestSize(int x
, int y
) { best_size
.Set(x
,y
); return *this; }
250 wxPaneInfo
& MinSize(int x
, int y
) { min_size
.Set(x
,y
); return *this; }
251 wxPaneInfo
& MaxSize(int x
, int y
) { max_size
.Set(x
,y
); return *this; }
252 wxPaneInfo
& FloatingPosition(const wxPoint
& pos
) { floating_pos
= pos
; return *this; }
253 wxPaneInfo
& FloatingPosition(int x
, int y
) { floating_pos
.x
= x
; floating_pos
.y
= y
; return *this; }
254 wxPaneInfo
& FloatingSize(const wxSize
& size
) { floating_size
= size
; return *this; }
255 wxPaneInfo
& FloatingSize(int x
, int y
) { floating_size
.Set(x
,y
); return *this; }
256 wxPaneInfo
& Fixed() { return SetFlag(optionResizable
, false); }
257 wxPaneInfo
& Resizable(bool resizable
= true) { return SetFlag(optionResizable
, resizable
); }
258 wxPaneInfo
& Dock() { return SetFlag(optionFloating
, false); }
259 wxPaneInfo
& Float() { return SetFlag(optionFloating
, true); }
260 wxPaneInfo
& Hide() { return SetFlag(optionHidden
, true); }
261 wxPaneInfo
& Show(bool show
= true) { return SetFlag(optionHidden
, !show
); }
262 wxPaneInfo
& CaptionVisible(bool visible
= true) { return SetFlag(optionCaption
, visible
); }
263 wxPaneInfo
& PaneBorder(bool visible
= true) { return SetFlag(optionPaneBorder
, visible
); }
264 wxPaneInfo
& Gripper(bool visible
= true) { return SetFlag(optionGripper
, visible
); }
265 wxPaneInfo
& GripperTop(bool attop
= true) { return SetFlag(optionGripperTop
, attop
); }
266 wxPaneInfo
& CloseButton(bool visible
= true) { return SetFlag(buttonClose
, visible
); }
267 wxPaneInfo
& MaximizeButton(bool visible
= true) { return SetFlag(buttonMaximize
, visible
); }
268 wxPaneInfo
& MinimizeButton(bool visible
= true) { return SetFlag(buttonMinimize
, visible
); }
269 wxPaneInfo
& PinButton(bool visible
= true) { return SetFlag(buttonPin
, visible
); }
270 wxPaneInfo
& DestroyOnClose(bool b
= true) { return SetFlag(optionDestroyOnClose
, b
); }
271 wxPaneInfo
& TopDockable(bool b
= true) { return SetFlag(optionTopDockable
, b
); }
272 wxPaneInfo
& BottomDockable(bool b
= true) { return SetFlag(optionBottomDockable
, b
); }
273 wxPaneInfo
& LeftDockable(bool b
= true) { return SetFlag(optionLeftDockable
, b
); }
274 wxPaneInfo
& RightDockable(bool b
= true) { return SetFlag(optionRightDockable
, b
); }
275 wxPaneInfo
& Floatable(bool b
= true) { return SetFlag(optionFloatable
, b
); }
276 wxPaneInfo
& Movable(bool b
= true) { return SetFlag(optionMovable
, b
); }
277 wxPaneInfo
& Dockable(bool b
= true)
279 return TopDockable(b
).BottomDockable(b
).LeftDockable(b
).RightDockable(b
);
282 wxPaneInfo
& DefaultPane()
284 state
|= optionTopDockable
| optionBottomDockable
|
285 optionLeftDockable
| optionRightDockable
|
286 optionFloatable
| optionMovable
| optionResizable
|
287 optionCaption
| optionPaneBorder
| buttonClose
;
291 wxPaneInfo
& CentrePane() { return CenterPane(); }
292 wxPaneInfo
& CenterPane()
295 return Center().PaneBorder().Resizable();
298 wxPaneInfo
& ToolbarPane()
301 state
|= (optionToolbar
| optionGripper
);
302 state
&= ~(optionResizable
| optionCaption
);
308 wxPaneInfo
& SetFlag(unsigned int flag
, bool option_state
)
317 bool HasFlag(unsigned int flag
) const
319 return (state
& flag
) ? true:false;
323 %typemap
(out
) wxPaneInfo
& ;
330 optionFloating
= 1 << 0,
331 optionHidden
= 1 << 1,
332 optionLeftDockable
= 1 << 2,
333 optionRightDockable
= 1 << 3,
334 optionTopDockable
= 1 << 4,
335 optionBottomDockable
= 1 << 5,
336 optionFloatable
= 1 << 6,
337 optionMovable
= 1 << 7,
338 optionResizable
= 1 << 8,
339 optionPaneBorder
= 1 << 9,
340 optionCaption
= 1 << 10,
341 optionGripper
= 1 << 11,
342 optionDestroyOnClose
= 1 << 12,
343 optionToolbar
= 1 << 13,
344 optionActive
= 1 << 14,
345 optionGripperTop
= 1 << 15,
347 buttonClose
= 1 << 24,
348 buttonMaximize
= 1 << 25,
349 buttonMinimize
= 1 << 26,
351 buttonCustom1
= 1 << 28,
352 buttonCustom2
= 1 << 29,
353 buttonCustom3
= 1 << 30,
354 actionPane
= 1 << 31 // used internally
358 wxString name
; // name of the pane
359 wxString caption
; // caption displayed on the window
361 wxWindow
* window
; // window that is in this pane
362 wxFrame
* frame
; // floating frame window that holds the pane
363 unsigned int state
; // a combination of wxPaneState values
365 int dock_direction
; // dock direction (top, bottom, left, right, center)
366 int dock_layer
; // layer number (0 = innermost layer)
367 int dock_row
; // row number on the docking bar (0 = first row)
368 int dock_pos
; // position inside the row (0 = first position)
370 wxSize best_size
; // size that the layout engine will prefer
371 wxSize min_size
; // minimum size the pane window can tolerate
372 wxSize max_size
; // maximum size the pane window can tolerate
374 wxPoint floating_pos
; // position while floating
375 wxSize floating_size
; // size while floating
376 int dock_proportion
; // proportion while docked
378 wxPaneButtonArray buttons
; // buttons on the pane
380 wxRect rect
; // current rectangle (populated by wxAUI)
387 class WXDLLIMPEXP_AUI wxFrameManager
: public wxEvtHandler
389 friend class wxFloatingPane
;
393 wxFrameManager(wxWindow
* managed_wnd
= NULL
,
394 unsigned int flags
= wxAUI_MGR_DEFAULT
);
395 virtual ~wxFrameManager();
398 void SetFlags(unsigned int flags
);
399 unsigned int GetFlags() const;
401 void SetManagedWindow(wxWindow
* managed_wnd
);
402 wxWindow
* GetManagedWindow() const;
405 %disownarg
( wxDockArt
* art_provider
);
407 void SetArtProvider(wxDockArt
* art_provider
);
408 wxDockArt
* GetArtProvider() const;
410 wxPaneInfo
& GetPane(wxWindow
* window
);
411 wxPaneInfo
& GetPane(const wxString
& name
);
412 wxPaneInfoArray
& GetAllPanes();
414 bool AddPane(wxWindow
* window
,
415 const wxPaneInfo
& pane_info
);
417 bool AddPane(wxWindow
* window
,
418 const wxPaneInfo
& pane_info
,
419 const wxPoint
& drop_pos
);
421 bool AddPane(wxWindow
* window
,
422 int direction
= wxLEFT
,
423 const wxString
& caption
= wxEmptyString
);
425 bool InsertPane(wxWindow
* window
,
426 const wxPaneInfo
& insert_location
,
427 int insert_level
= wxAUI_INSERT_PANE
);
429 bool DetachPane(wxWindow
* window
);
431 wxString
SavePaneInfo(wxPaneInfo
& pane
);
432 void LoadPaneInfo(wxString pane_part
, wxPaneInfo
&pane
);
434 wxString
SavePerspective();
436 bool LoadPerspective(const wxString
& perspective
,
444 void DrawHintRect(wxWindow
* pane_window
,
446 const wxPoint
& offset
);
447 virtual void ShowHint(const wxRect
& rect
);
448 virtual void HideHint();
452 // deprecated -- please use SetManagedWindow() and
453 // and GetManagedWindow() instead
455 wxDEPRECATED( void SetFrame(wxFrame
* frame
) );
456 wxDEPRECATED( wxFrame
* GetFrame() const );
462 void DoFrameLayout();
464 void LayoutAddPane(wxSizer
* container
,
467 wxDockUIPartArray
& uiparts
,
470 void LayoutAddDock(wxSizer
* container
,
472 wxDockUIPartArray
& uiparts
,
475 wxSizer
* LayoutAll(wxPaneInfoArray
& panes
,
476 wxDockInfoArray
& docks
,
477 wxDockUIPartArray
& uiparts
,
478 bool spacer_only
= false);
480 virtual bool ProcessDockResult(wxPaneInfo
& target
,
481 const wxPaneInfo
& new_pos
);
483 bool DoDrop(wxDockInfoArray
& docks
,
484 wxPaneInfoArray
& panes
,
487 const wxPoint
& action_offset
= wxPoint(0,0));
489 wxPaneInfo
& LookupPane(wxWindow
* window
);
490 wxPaneInfo
& LookupPane(const wxString
& name
);
491 wxDockUIPart
* HitTest(int x
, int y
);
492 wxDockUIPart
* GetPanePart(wxWindow
* pane
);
493 int GetDockPixelOffset(wxPaneInfo
& test
);
494 void OnFloatingPaneMoveStart(wxWindow
* window
);
495 void OnFloatingPaneMoving(wxWindow
* window
, wxDirection dir
);
496 void OnFloatingPaneMoved(wxWindow
* window
, wxDirection dir
);
497 void OnFloatingPaneActivated(wxWindow
* window
);
498 void OnFloatingPaneClosed(wxWindow
* window
, wxCloseEvent
& evt
);
499 void OnFloatingPaneResized(wxWindow
* window
, const wxSize
& size
);
500 void Render(wxDC
* dc
);
501 void Repaint(wxDC
* dc
= NULL
);
502 void ProcessMgrEvent(wxFrameManagerEvent
& event
);
503 void UpdateButtonOnScreen(wxDockUIPart
* button_ui_part
,
504 const wxMouseEvent
& event
);
505 void GetPanePositionsAndSizes(wxDockInfo
& dock
,
506 wxArrayInt
& positions
,
512 // public events (which can be invoked externally)
513 void OnRender(wxFrameManagerEvent
& evt
);
514 void OnPaneButton(wxFrameManagerEvent
& evt
);
519 void OnPaint(wxPaintEvent
& evt
);
520 void OnEraseBackground(wxEraseEvent
& evt
);
521 void OnSize(wxSizeEvent
& evt
);
522 void OnSetCursor(wxSetCursorEvent
& evt
);
523 void OnLeftDown(wxMouseEvent
& evt
);
524 void OnLeftUp(wxMouseEvent
& evt
);
525 void OnMotion(wxMouseEvent
& evt
);
526 void OnLeaveWindow(wxMouseEvent
& evt
);
527 void OnChildFocus(wxChildFocusEvent
& evt
);
528 void OnHintFadeTimer(wxTimerEvent
& evt
);
538 actionDragToolbarPane
,
539 actionDragFloatingPane
544 wxWindow
* m_frame
; // the window being managed
545 wxDockArt
* m_art
; // dock art object which does all drawing
546 unsigned int m_flags
; // manager flags wxAUI_MGR_*
548 wxPaneInfoArray m_panes
; // array of panes structures
549 wxDockInfoArray m_docks
; // array of docks structures
550 wxDockUIPartArray m_uiparts
; // array of UI parts (captions, buttons, etc)
552 int m_action
; // current mouse action
553 wxPoint m_action_start
; // position where the action click started
554 wxPoint m_action_offset
; // offset from upper left of the item clicked
555 wxDockUIPart
* m_action_part
; // ptr to the part the action happened to
556 wxWindow
* m_action_window
; // action frame or window (NULL if none)
557 wxRect m_action_hintrect
; // hint rectangle for the action
560 wxDockUIPart
* m_hover_button
;// button uipart being hovered over
561 wxRect m_last_hint
; // last hint rectangle
562 wxPoint m_last_mouse_move
; // last mouse move position (see OnMotion)
564 wxFrame
* m_hint_wnd
; // transparent hint window, if supported by platform
565 wxTimer m_hint_fadetimer
; // transparent fade timer
566 wxByte m_hint_fadeamt
; // transparent fade amount
567 wxByte m_hint_fademax
; // maximum value of hint fade
570 DECLARE_EVENT_TABLE()
576 // event declarations/classes
578 class WXDLLIMPEXP_AUI wxFrameManagerEvent
: public wxEvent
581 wxFrameManagerEvent(wxEventType type
=wxEVT_NULL
) : wxEvent(0, type
)
590 wxFrameManagerEvent(const wxFrameManagerEvent
& c
) : wxEvent(c
)
594 veto_flag
= c
.veto_flag
;
595 canveto_flag
= c
.canveto_flag
;
599 wxEvent
*Clone() const { return new wxFrameManagerEvent(*this); }
601 void SetPane(wxPaneInfo
* p
) { pane
= p
; }
602 void SetButton(int b
) { button
= b
; }
603 void SetDC(wxDC
* pdc
) { dc
= pdc
; }
605 wxPaneInfo
* GetPane() { return pane
; }
606 int GetButton() { return button
; }
607 wxDC
* GetDC() { return dc
; }
609 void Veto(bool veto
= true) { veto_flag
= veto
; }
610 bool GetVeto() const { return veto_flag
; }
611 void SetCanVeto(bool can_veto
) { canveto_flag
= can_veto
; }
612 bool CanVeto() const { return canveto_flag
&& veto_flag
; }
623 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFrameManagerEvent
)
628 class WXDLLIMPEXP_AUI wxDockInfo
644 wxDockInfo(const wxDockInfo
& c
)
646 dock_direction
= c
.dock_direction
;
647 dock_layer
= c
.dock_layer
;
648 dock_row
= c
.dock_row
;
650 min_size
= c
.min_size
;
651 resizable
= c
.resizable
;
658 wxDockInfo
& operator=(const wxDockInfo
& c
)
660 dock_direction
= c
.dock_direction
;
661 dock_layer
= c
.dock_layer
;
662 dock_row
= c
.dock_row
;
664 min_size
= c
.min_size
;
665 resizable
= c
.resizable
;
674 bool IsOk() const { return (dock_direction
!= 0) ? true : false; }
675 bool IsHorizontal() const { return (dock_direction
== wxAUI_DOCK_TOP
||
676 dock_direction
== wxAUI_DOCK_BOTTOM
) ? true:false; }
677 bool IsVertical() const { return (dock_direction
== wxAUI_DOCK_LEFT
||
678 dock_direction
== wxAUI_DOCK_RIGHT
||
679 dock_direction
== wxAUI_DOCK_CENTER
) ? true:false; }
681 wxPaneInfoPtrArray panes
; // array of panes
682 wxRect rect
; // current rectangle
683 int dock_direction
; // dock direction (top, bottom, left, right, center)
684 int dock_layer
; // layer number (0 = innermost layer)
685 int dock_row
; // row number on the docking bar (0 = first row)
686 int size
; // size of the dock
687 int min_size
; // minimum size of a dock (0 if there is no min)
688 bool resizable
; // flag indicating whether the dock is resizable
689 bool toolbar
; // flag indicating dock contains only toolbars
690 bool fixed
; // flag indicating that the dock operates on
691 // absolute coordinates as opposed to proportional
695 class WXDLLIMPEXP_AUI wxDockUIPart
711 int type
; // ui part type (see enum above)
712 int orientation
; // orientation (either wxHORIZONTAL or wxVERTICAL)
713 wxDockInfo
* dock
; // which dock the item is associated with
714 wxPaneInfo
* pane
; // which pane the item is associated with
715 wxPaneButton
* button
; // which pane button the item is associated with
716 wxSizer
* cont_sizer
; // the part's containing sizer
717 wxSizerItem
* sizer_item
; // the sizer item of the part
718 wxRect rect
; // client coord rectangle of the part itself
722 class WXDLLIMPEXP_AUI wxPaneButton
725 int button_id
; // id of the button (e.g. buttonClose)
731 // wx event machinery
733 BEGIN_DECLARE_EVENT_TYPES()
734 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_PANEBUTTON
, 0)
735 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_PANECLOSE
, 0)
736 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_RENDER
, 0)
737 END_DECLARE_EVENT_TYPES()
739 typedef void (wxEvtHandler::*wxFrameManagerEventFunction
)(wxFrameManagerEvent
&);
741 #define wxFrameManagerEventHandler(func) \
742 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFrameManagerEventFunction, &func)
744 #define EVT_AUI_PANEBUTTON(func) \
745 wx__DECLARE_EVT0(wxEVT_AUI_PANEBUTTON, wxFrameManagerEventHandler(func))
746 #define EVT_AUI_PANECLOSE(func) \
747 wx__DECLARE_EVT0(wxEVT_AUI_PANECLOSE, wxFrameManagerEventHandler(func))
748 #define EVT_AUI_RENDER(func) \
749 wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxFrameManagerEventHandler(func))
753 %constant wxEventType wxEVT_AUI_PANEBUTTON
;
754 %constant wxEventType wxEVT_AUI_PANECLOSE
;
755 %constant wxEventType wxEVT_AUI_RENDER
;
758 EVT_AUI_PANEBUTTON
= wx
.PyEventBinder( wxEVT_AUI_PANEBUTTON
)
759 EVT_AUI_PANECLOSE
= wx
.PyEventBinder( wxEVT_AUI_PANECLOSE
)
760 EVT_AUI_RENDER
= wx
.PyEventBinder( wxEVT_AUI_RENDER
)
765 #endif //_WX_FRAMEMANAGER_H_