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"
34 wxAUI_DOCK_BOTTOM
= 3,
36 wxAUI_DOCK_CENTER
= 5,
37 wxAUI_DOCK_CENTRE
= wxAUI_DOCK_CENTER
40 enum wxAuiManagerOption
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_VENETIAN_BLINDS_HINT
= 1 << 4,
47 wxAUI_MGR_RECTANGLE_HINT
= 1 << 5,
48 wxAUI_MGR_HINT_FADE
= 1 << 6,
49 wxAUI_MGR_NO_VENETIAN_BLINDS_FADE
= 1 << 7,
51 wxAUI_MGR_DEFAULT
= wxAUI_MGR_ALLOW_FLOATING
|
52 wxAUI_MGR_TRANSPARENT_HINT
|
54 wxAUI_MGR_NO_VENETIAN_BLINDS_FADE
58 enum wxAuiPaneDockArtSetting
60 wxAUI_DOCKART_SASH_SIZE
= 0,
61 wxAUI_DOCKART_CAPTION_SIZE
= 1,
62 wxAUI_DOCKART_GRIPPER_SIZE
= 2,
63 wxAUI_DOCKART_PANE_BORDER_SIZE
= 3,
64 wxAUI_DOCKART_PANE_BUTTON_SIZE
= 4,
65 wxAUI_DOCKART_BACKGROUND_COLOUR
= 5,
66 wxAUI_DOCKART_SASH_COLOUR
= 6,
67 wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR
= 7,
68 wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
= 8,
69 wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR
= 9,
70 wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
= 10,
71 wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
= 11,
72 wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
= 12,
73 wxAUI_DOCKART_BORDER_COLOUR
= 13,
74 wxAUI_DOCKART_GRIPPER_COLOUR
= 14,
75 wxAUI_DOCKART_CAPTION_FONT
= 15,
76 wxAUI_DOCKART_GRADIENT_TYPE
= 16
79 enum wxAuiPaneDockArtGradients
81 wxAUI_GRADIENT_NONE
= 0,
82 wxAUI_GRADIENT_VERTICAL
= 1,
83 wxAUI_GRADIENT_HORIZONTAL
= 2
86 enum wxAuiPaneButtonState
88 wxAUI_BUTTON_STATE_NORMAL
= 0,
89 wxAUI_BUTTON_STATE_HOVER
= 1 << 1,
90 wxAUI_BUTTON_STATE_PRESSED
= 1 << 2,
91 wxAUI_BUTTON_STATE_DISABLED
= 1 << 3,
92 wxAUI_BUTTON_STATE_HIDDEN
= 1 << 4,
93 wxAUI_BUTTON_STATE_CHECKED
= 1 << 5
98 wxAUI_BUTTON_CLOSE
= 101,
99 wxAUI_BUTTON_MAXIMIZE_RESTORE
= 102,
100 wxAUI_BUTTON_MINIMIZE
= 103,
101 wxAUI_BUTTON_PIN
= 104,
102 wxAUI_BUTTON_OPTIONS
= 105,
103 wxAUI_BUTTON_WINDOWLIST
= 106,
104 wxAUI_BUTTON_LEFT
= 107,
105 wxAUI_BUTTON_RIGHT
= 108,
106 wxAUI_BUTTON_UP
= 109,
107 wxAUI_BUTTON_DOWN
= 110,
108 wxAUI_BUTTON_CUSTOM1
= 201,
109 wxAUI_BUTTON_CUSTOM2
= 202,
110 wxAUI_BUTTON_CUSTOM3
= 203
113 enum wxAuiPaneInsertLevel
115 wxAUI_INSERT_PANE
= 0,
116 wxAUI_INSERT_ROW
= 1,
117 wxAUI_INSERT_DOCK
= 2
123 // forwards and array declarations
124 class wxAuiDockUIPart
;
125 class wxAuiPaneButton
;
129 class wxAuiManagerEvent
;
132 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiDockInfo
, wxAuiDockInfoArray
, WXDLLIMPEXP_AUI
);
133 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiDockUIPart
, wxAuiDockUIPartArray
, WXDLLIMPEXP_AUI
);
134 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiPaneButton
, wxAuiPaneButtonArray
, WXDLLIMPEXP_AUI
);
135 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxAuiPaneInfo
, wxAuiPaneInfoArray
, WXDLLIMPEXP_AUI
);
136 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxAuiPaneInfo
*, wxAuiPaneInfoPtrArray
, class WXDLLIMPEXP_AUI
);
137 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxAuiDockInfo
*, wxAuiDockInfoPtrArray
, class WXDLLIMPEXP_AUI
);
140 extern WXDLLIMPEXP_AUI wxAuiDockInfo wxAuiNullDockInfo
;
141 extern WXDLLIMPEXP_AUI wxAuiPaneInfo wxAuiNullPaneInfo
;
145 class WXDLLIMPEXP_AUI wxAuiPaneInfo
154 dock_direction
= wxAUI_DOCK_LEFT
;
158 floating_pos
= wxDefaultPosition
;
159 floating_size
= wxDefaultSize
;
160 best_size
= wxDefaultSize
;
161 min_size
= wxDefaultSize
;
162 max_size
= wxDefaultSize
;
171 wxAuiPaneInfo(const wxAuiPaneInfo
& c
)
178 dock_direction
= c
.dock_direction
;
179 dock_layer
= c
.dock_layer
;
180 dock_row
= c
.dock_row
;
181 dock_pos
= c
.dock_pos
;
182 best_size
= c
.best_size
;
183 min_size
= c
.min_size
;
184 max_size
= c
.max_size
;
185 floating_pos
= c
.floating_pos
;
186 floating_size
= c
.floating_size
;
187 dock_proportion
= c
.dock_proportion
;
192 wxAuiPaneInfo
& operator=(const wxAuiPaneInfo
& c
)
199 dock_direction
= c
.dock_direction
;
200 dock_layer
= c
.dock_layer
;
201 dock_row
= c
.dock_row
;
202 dock_pos
= c
.dock_pos
;
203 best_size
= c
.best_size
;
204 min_size
= c
.min_size
;
205 max_size
= c
.max_size
;
206 floating_pos
= c
.floating_pos
;
207 floating_size
= c
.floating_size
;
208 dock_proportion
= c
.dock_proportion
;
215 // Write the safe parts of a newly loaded PaneInfo structure "source" into "this"
216 // used on loading perspectives etc.
217 void SafeSet(wxAuiPaneInfo source
)
219 // note source is not passed by reference so we can overwrite, to keep the
220 // unsafe bits of "dest"
221 source
.window
= window
;
222 source
.frame
= frame
;
223 source
.buttons
= buttons
;
228 bool IsOk() const { return (window
!= NULL
) ? true : false; }
229 bool IsFixed() const { return !HasFlag(optionResizable
); }
230 bool IsResizable() const { return HasFlag(optionResizable
); }
231 bool IsShown() const { return !HasFlag(optionHidden
); }
232 bool IsFloating() const { return HasFlag(optionFloating
); }
233 bool IsDocked() const { return !HasFlag(optionFloating
); }
234 bool IsToolbar() const { return HasFlag(optionToolbar
); }
235 bool IsTopDockable() const { return HasFlag(optionTopDockable
); }
236 bool IsBottomDockable() const { return HasFlag(optionBottomDockable
); }
237 bool IsLeftDockable() const { return HasFlag(optionLeftDockable
); }
238 bool IsRightDockable() const { return HasFlag(optionRightDockable
); }
239 bool IsFloatable() const { return HasFlag(optionFloatable
); }
240 bool IsMovable() const { return HasFlag(optionMovable
); }
241 bool IsDestroyOnClose() const { return HasFlag(optionDestroyOnClose
); }
242 bool IsMaximized() const { return HasFlag(optionMaximized
); }
243 bool HasCaption() const { return HasFlag(optionCaption
); }
244 bool HasGripper() const { return HasFlag(optionGripper
); }
245 bool HasBorder() const { return HasFlag(optionPaneBorder
); }
246 bool HasCloseButton() const { return HasFlag(buttonClose
); }
247 bool HasMaximizeButton() const { return HasFlag(buttonMaximize
); }
248 bool HasMinimizeButton() const { return HasFlag(buttonMinimize
); }
249 bool HasPinButton() const { return HasFlag(buttonPin
); }
250 bool HasGripperTop() const { return HasFlag(optionGripperTop
); }
253 %typemap
(out
) wxAuiPaneInfo
& { $result
= $self
; Py_INCREF($result
); }
255 wxAuiPaneInfo
& Window(wxWindow
* w
) { window
= w
; return *this; }
256 wxAuiPaneInfo
& Name(const wxString
& n
) { name
= n
; return *this; }
257 wxAuiPaneInfo
& Caption(const wxString
& c
) { caption
= c
; return *this; }
258 wxAuiPaneInfo
& Left() { dock_direction
= wxAUI_DOCK_LEFT
; return *this; }
259 wxAuiPaneInfo
& Right() { dock_direction
= wxAUI_DOCK_RIGHT
; return *this; }
260 wxAuiPaneInfo
& Top() { dock_direction
= wxAUI_DOCK_TOP
; return *this; }
261 wxAuiPaneInfo
& Bottom() { dock_direction
= wxAUI_DOCK_BOTTOM
; return *this; }
262 wxAuiPaneInfo
& Center() { dock_direction
= wxAUI_DOCK_CENTER
; return *this; }
263 wxAuiPaneInfo
& Centre() { dock_direction
= wxAUI_DOCK_CENTRE
; return *this; }
264 wxAuiPaneInfo
& Direction(int direction
) { dock_direction
= direction
; return *this; }
265 wxAuiPaneInfo
& Layer(int layer
) { dock_layer
= layer
; return *this; }
266 wxAuiPaneInfo
& Row(int row
) { dock_row
= row
; return *this; }
267 wxAuiPaneInfo
& Position(int pos
) { dock_pos
= pos
; return *this; }
268 wxAuiPaneInfo
& BestSize(const wxSize
& size
) { best_size
= size
; return *this; }
269 wxAuiPaneInfo
& MinSize(const wxSize
& size
) { min_size
= size
; return *this; }
270 wxAuiPaneInfo
& MaxSize(const wxSize
& size
) { max_size
= size
; return *this; }
271 wxAuiPaneInfo
& BestSize(int x
, int y
) { best_size
.Set(x
,y
); return *this; }
272 wxAuiPaneInfo
& MinSize(int x
, int y
) { min_size
.Set(x
,y
); return *this; }
273 wxAuiPaneInfo
& MaxSize(int x
, int y
) { max_size
.Set(x
,y
); return *this; }
274 wxAuiPaneInfo
& FloatingPosition(const wxPoint
& pos
) { floating_pos
= pos
; return *this; }
275 wxAuiPaneInfo
& FloatingPosition(int x
, int y
) { floating_pos
.x
= x
; floating_pos
.y
= y
; return *this; }
276 wxAuiPaneInfo
& FloatingSize(const wxSize
& size
) { floating_size
= size
; return *this; }
277 wxAuiPaneInfo
& FloatingSize(int x
, int y
) { floating_size
.Set(x
,y
); return *this; }
278 wxAuiPaneInfo
& Fixed() { return SetFlag(optionResizable
, false); }
279 wxAuiPaneInfo
& Resizable(bool resizable
= true) { return SetFlag(optionResizable
, resizable
); }
280 wxAuiPaneInfo
& Dock() { return SetFlag(optionFloating
, false); }
281 wxAuiPaneInfo
& Float() { return SetFlag(optionFloating
, true); }
282 wxAuiPaneInfo
& Hide() { return SetFlag(optionHidden
, true); }
283 wxAuiPaneInfo
& Show(bool show
= true) { return SetFlag(optionHidden
, !show
); }
284 wxAuiPaneInfo
& CaptionVisible(bool visible
= true) { return SetFlag(optionCaption
, visible
); }
285 wxAuiPaneInfo
& Maximize() { return SetFlag(optionMaximized
, true); }
286 wxAuiPaneInfo
& Restore() { return SetFlag(optionMaximized
, false); }
287 wxAuiPaneInfo
& PaneBorder(bool visible
= true) { return SetFlag(optionPaneBorder
, visible
); }
288 wxAuiPaneInfo
& Gripper(bool visible
= true) { return SetFlag(optionGripper
, visible
); }
289 wxAuiPaneInfo
& GripperTop(bool attop
= true) { return SetFlag(optionGripperTop
, attop
); }
290 wxAuiPaneInfo
& CloseButton(bool visible
= true) { return SetFlag(buttonClose
, visible
); }
291 wxAuiPaneInfo
& MaximizeButton(bool visible
= true) { return SetFlag(buttonMaximize
, visible
); }
292 wxAuiPaneInfo
& MinimizeButton(bool visible
= true) { return SetFlag(buttonMinimize
, visible
); }
293 wxAuiPaneInfo
& PinButton(bool visible
= true) { return SetFlag(buttonPin
, visible
); }
294 wxAuiPaneInfo
& DestroyOnClose(bool b
= true) { return SetFlag(optionDestroyOnClose
, b
); }
295 wxAuiPaneInfo
& TopDockable(bool b
= true) { return SetFlag(optionTopDockable
, b
); }
296 wxAuiPaneInfo
& BottomDockable(bool b
= true) { return SetFlag(optionBottomDockable
, b
); }
297 wxAuiPaneInfo
& LeftDockable(bool b
= true) { return SetFlag(optionLeftDockable
, b
); }
298 wxAuiPaneInfo
& RightDockable(bool b
= true) { return SetFlag(optionRightDockable
, b
); }
299 wxAuiPaneInfo
& Floatable(bool b
= true) { return SetFlag(optionFloatable
, b
); }
300 wxAuiPaneInfo
& Movable(bool b
= true) { return SetFlag(optionMovable
, b
); }
302 wxAuiPaneInfo
& SaveHidden() { return SetFlag(optionSavedHidden
, HasFlag(optionHidden
)); }
303 wxAuiPaneInfo
& RestoreHidden() { return SetFlag(optionHidden
, HasFlag(optionSavedHidden
)); }
305 wxAuiPaneInfo
& Dockable(bool b
= true)
307 return TopDockable(b
).BottomDockable(b
).LeftDockable(b
).RightDockable(b
);
310 wxAuiPaneInfo
& DefaultPane()
312 state
|= optionTopDockable
| optionBottomDockable
|
313 optionLeftDockable
| optionRightDockable
|
314 optionFloatable
| optionMovable
| optionResizable
|
315 optionCaption
| optionPaneBorder
| buttonClose
;
319 wxAuiPaneInfo
& CentrePane() { return CenterPane(); }
320 wxAuiPaneInfo
& CenterPane()
323 return Center().PaneBorder().Resizable();
326 wxAuiPaneInfo
& ToolbarPane()
329 state
|= (optionToolbar
| optionGripper
);
330 state
&= ~(optionResizable
| optionCaption
);
336 wxAuiPaneInfo
& SetFlag(unsigned int flag
, bool option_state
)
345 bool HasFlag(unsigned int flag
) const
347 return (state
& flag
) ? true:false;
351 %typemap
(out
) wxAuiPaneInfo
& ;
356 // NOTE: You can add and subtract flags from this list,
357 // but do not change the values of the flags, because
358 // they are stored in a binary integer format in the
359 // perspective string. If you really need to change the
360 // values around, you'll have to ensure backwards-compatibility
361 // in the perspective loading code.
364 optionFloating
= 1 << 0,
365 optionHidden
= 1 << 1,
366 optionLeftDockable
= 1 << 2,
367 optionRightDockable
= 1 << 3,
368 optionTopDockable
= 1 << 4,
369 optionBottomDockable
= 1 << 5,
370 optionFloatable
= 1 << 6,
371 optionMovable
= 1 << 7,
372 optionResizable
= 1 << 8,
373 optionPaneBorder
= 1 << 9,
374 optionCaption
= 1 << 10,
375 optionGripper
= 1 << 11,
376 optionDestroyOnClose
= 1 << 12,
377 optionToolbar
= 1 << 13,
378 optionActive
= 1 << 14,
379 optionGripperTop
= 1 << 15,
380 optionMaximized
= 1 << 16,
381 optionSavedHidden
= 1 << 17,
383 buttonClose
= 1 << 24,
384 buttonMaximize
= 1 << 25,
385 buttonMinimize
= 1 << 26,
387 buttonCustom1
= 1 << 28,
388 buttonCustom2
= 1 << 29,
389 buttonCustom3
= 1 << 30,
390 actionPane
= 1 << 31 // used internally
394 wxString name
; // name of the pane
395 wxString caption
; // caption displayed on the window
397 wxWindow
* window
; // window that is in this pane
398 wxFrame
* frame
; // floating frame window that holds the pane
399 unsigned int state
; // a combination of wxPaneState values
401 int dock_direction
; // dock direction (top, bottom, left, right, center)
402 int dock_layer
; // layer number (0 = innermost layer)
403 int dock_row
; // row number on the docking bar (0 = first row)
404 int dock_pos
; // position inside the row (0 = first position)
406 wxSize best_size
; // size that the layout engine will prefer
407 wxSize min_size
; // minimum size the pane window can tolerate
408 wxSize max_size
; // maximum size the pane window can tolerate
410 wxPoint floating_pos
; // position while floating
411 wxSize floating_size
; // size while floating
412 int dock_proportion
; // proportion while docked
414 wxAuiPaneButtonArray buttons
; // buttons on the pane
416 wxRect rect
; // current rectangle (populated by wxAUI)
421 class WXDLLIMPEXP_AUI wxAuiFloatingFrame
;
423 class WXDLLIMPEXP_AUI wxAuiManager
: public wxEvtHandler
425 friend class wxAuiFloatingFrame
;
429 wxAuiManager(wxWindow
* managed_wnd
= NULL
,
430 unsigned int flags
= wxAUI_MGR_DEFAULT
);
431 virtual ~wxAuiManager();
434 void SetFlags(unsigned int flags
);
435 unsigned int GetFlags() const;
437 void SetManagedWindow(wxWindow
* managed_wnd
);
438 wxWindow
* GetManagedWindow() const;
440 static wxAuiManager
* GetManager(wxWindow
* window
);
443 %disownarg
( wxAuiDockArt
* art_provider
);
445 void SetArtProvider(wxAuiDockArt
* art_provider
);
446 wxAuiDockArt
* GetArtProvider() const;
448 wxAuiPaneInfo
& GetPane(wxWindow
* window
);
449 wxAuiPaneInfo
& GetPane(const wxString
& name
);
450 wxAuiPaneInfoArray
& GetAllPanes();
452 bool AddPane(wxWindow
* window
,
453 const wxAuiPaneInfo
& pane_info
);
455 bool AddPane(wxWindow
* window
,
456 const wxAuiPaneInfo
& pane_info
,
457 const wxPoint
& drop_pos
);
459 bool AddPane(wxWindow
* window
,
460 int direction
= wxLEFT
,
461 const wxString
& caption
= wxEmptyString
);
463 bool InsertPane(wxWindow
* window
,
464 const wxAuiPaneInfo
& insert_location
,
465 int insert_level
= wxAUI_INSERT_PANE
);
467 bool DetachPane(wxWindow
* window
);
469 void ClosePane(wxAuiPaneInfo
& pane_info
);
470 void MaximizePane(wxAuiPaneInfo
& pane_info
);
471 void RestorePane(wxAuiPaneInfo
& pane_info
);
472 void RestoreMaximizedPane();
474 wxString
SavePaneInfo(wxAuiPaneInfo
& pane
);
475 void LoadPaneInfo(wxString pane_part
, wxAuiPaneInfo
&pane
);
477 wxString
SavePerspective();
479 bool LoadPerspective(const wxString
& perspective
,
486 virtual wxAuiFloatingFrame
* CreateFloatingFrame(wxWindow
* parent
, const wxAuiPaneInfo
& p
);
489 wxWindow
* pane_window
,
490 const wxPoint
& offset
);
492 wxRect
CalculateHintRect(
493 wxWindow
* pane_window
,
495 const wxPoint
& offset
);
498 wxWindow
* pane_window
,
500 const wxPoint
& offset
);
502 virtual void ShowHint(const wxRect
& rect
);
503 virtual void HideHint();
507 // deprecated -- please use SetManagedWindow() and
508 // and GetManagedWindow() instead
510 wxDEPRECATED( void SetFrame(wxFrame
* frame
) );
511 wxDEPRECATED( wxFrame
* GetFrame() const );
515 void UpdateHintWindowConfig();
517 void DoFrameLayout();
519 void LayoutAddPane(wxSizer
* container
,
522 wxAuiDockUIPartArray
& uiparts
,
525 void LayoutAddDock(wxSizer
* container
,
527 wxAuiDockUIPartArray
& uiparts
,
530 wxSizer
* LayoutAll(wxAuiPaneInfoArray
& panes
,
531 wxAuiDockInfoArray
& docks
,
532 wxAuiDockUIPartArray
& uiparts
,
533 bool spacer_only
= false);
535 virtual bool ProcessDockResult(wxAuiPaneInfo
& target
,
536 const wxAuiPaneInfo
& new_pos
);
538 bool DoDrop(wxAuiDockInfoArray
& docks
,
539 wxAuiPaneInfoArray
& panes
,
542 const wxPoint
& action_offset
= wxPoint(0,0));
544 wxAuiDockUIPart
* HitTest(int x
, int y
);
545 wxAuiDockUIPart
* GetPanePart(wxWindow
* pane
);
546 int GetDockPixelOffset(wxAuiPaneInfo
& test
);
547 void OnFloatingPaneMoveStart(wxWindow
* window
);
548 void OnFloatingPaneMoving(wxWindow
* window
, wxDirection dir
);
549 void OnFloatingPaneMoved(wxWindow
* window
, wxDirection dir
);
550 void OnFloatingPaneActivated(wxWindow
* window
);
551 void OnFloatingPaneClosed(wxWindow
* window
, wxCloseEvent
& evt
);
552 void OnFloatingPaneResized(wxWindow
* window
, const wxSize
& size
);
553 void Render(wxDC
* dc
);
554 void Repaint(wxDC
* dc
= NULL
);
555 void ProcessMgrEvent(wxAuiManagerEvent
& event
);
556 void UpdateButtonOnScreen(wxAuiDockUIPart
* button_ui_part
,
557 const wxMouseEvent
& event
);
558 void GetPanePositionsAndSizes(wxAuiDockInfo
& dock
,
559 wxArrayInt
& positions
,
565 // public events (which can be invoked externally)
566 void OnRender(wxAuiManagerEvent
& evt
);
567 void OnPaneButton(wxAuiManagerEvent
& evt
);
572 void OnPaint(wxPaintEvent
& evt
);
573 void OnEraseBackground(wxEraseEvent
& evt
);
574 void OnSize(wxSizeEvent
& evt
);
575 void OnSetCursor(wxSetCursorEvent
& evt
);
576 void OnLeftDown(wxMouseEvent
& evt
);
577 void OnLeftUp(wxMouseEvent
& evt
);
578 void OnMotion(wxMouseEvent
& evt
);
579 void OnLeaveWindow(wxMouseEvent
& evt
);
580 void OnChildFocus(wxChildFocusEvent
& evt
);
581 void OnHintFadeTimer(wxTimerEvent
& evt
);
582 void OnFindManager(wxAuiManagerEvent
& evt
);
592 actionDragToolbarPane
,
593 actionDragFloatingPane
598 wxWindow
* m_frame
; // the window being managed
599 wxAuiDockArt
* m_art
; // dock art object which does all drawing
600 unsigned int m_flags
; // manager flags wxAUI_MGR_*
602 wxAuiPaneInfoArray m_panes
; // array of panes structures
603 wxAuiDockInfoArray m_docks
; // array of docks structures
604 wxAuiDockUIPartArray m_uiparts
; // array of UI parts (captions, buttons, etc)
606 int m_action
; // current mouse action
607 wxPoint m_action_start
; // position where the action click started
608 wxPoint m_action_offset
; // offset from upper left of the item clicked
609 wxAuiDockUIPart
* m_action_part
; // ptr to the part the action happened to
610 wxWindow
* m_action_window
; // action frame or window (NULL if none)
611 wxRect m_action_hintrect
; // hint rectangle for the action
613 bool m_has_maximized
;
615 wxAuiDockUIPart
* m_hover_button
;// button uipart being hovered over
616 wxRect m_last_hint
; // last hint rectangle
617 wxPoint m_last_mouse_move
; // last mouse move position (see OnMotion)
619 wxFrame
* m_hint_wnd
; // transparent hint window, if supported by platform
620 wxTimer m_hint_fadetimer
; // transparent fade timer
621 wxByte m_hint_fadeamt
; // transparent fade amount
622 wxByte m_hint_fademax
; // maximum value of hint fade
625 DECLARE_EVENT_TABLE()
626 DECLARE_CLASS(wxAuiManager
)
632 // event declarations/classes
634 class WXDLLIMPEXP_AUI wxAuiManagerEvent
: public wxEvent
637 wxAuiManagerEvent(wxEventType type
=wxEVT_NULL
) : wxEvent(0, type
)
647 wxAuiManagerEvent(const wxAuiManagerEvent
& c
) : wxEvent(c
)
652 veto_flag
= c
.veto_flag
;
653 canveto_flag
= c
.canveto_flag
;
657 wxEvent
*Clone() const { return new wxAuiManagerEvent(*this); }
659 void SetManager(wxAuiManager
* mgr
) { manager
= mgr
; }
660 void SetPane(wxAuiPaneInfo
* p
) { pane
= p
; }
661 void SetButton(int b
) { button
= b
; }
662 void SetDC(wxDC
* pdc
) { dc
= pdc
; }
664 wxAuiManager
* GetManager() const { return manager
; }
665 wxAuiPaneInfo
* GetPane() const { return pane
; }
666 int GetButton() const { return button
; }
667 wxDC
* GetDC() const { return dc
; }
669 void Veto(bool veto
= true) { veto_flag
= veto
; }
670 bool GetVeto() const { return veto_flag
; }
671 void SetCanVeto(bool can_veto
) { canveto_flag
= can_veto
; }
672 bool CanVeto() const { return canveto_flag
&& veto_flag
; }
675 wxAuiManager
* manager
;
684 DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiManagerEvent
)
689 class WXDLLIMPEXP_AUI wxAuiDockInfo
705 wxAuiDockInfo(const wxAuiDockInfo
& c
)
707 dock_direction
= c
.dock_direction
;
708 dock_layer
= c
.dock_layer
;
709 dock_row
= c
.dock_row
;
711 min_size
= c
.min_size
;
712 resizable
= c
.resizable
;
719 wxAuiDockInfo
& operator=(const wxAuiDockInfo
& c
)
721 dock_direction
= c
.dock_direction
;
722 dock_layer
= c
.dock_layer
;
723 dock_row
= c
.dock_row
;
725 min_size
= c
.min_size
;
726 resizable
= c
.resizable
;
735 bool IsOk() const { return (dock_direction
!= 0) ? true : false; }
736 bool IsHorizontal() const { return (dock_direction
== wxAUI_DOCK_TOP
||
737 dock_direction
== wxAUI_DOCK_BOTTOM
) ? true:false; }
738 bool IsVertical() const { return (dock_direction
== wxAUI_DOCK_LEFT
||
739 dock_direction
== wxAUI_DOCK_RIGHT
||
740 dock_direction
== wxAUI_DOCK_CENTER
) ? true:false; }
742 wxAuiPaneInfoPtrArray panes
; // array of panes
743 wxRect rect
; // current rectangle
744 int dock_direction
; // dock direction (top, bottom, left, right, center)
745 int dock_layer
; // layer number (0 = innermost layer)
746 int dock_row
; // row number on the docking bar (0 = first row)
747 int size
; // size of the dock
748 int min_size
; // minimum size of a dock (0 if there is no min)
749 bool resizable
; // flag indicating whether the dock is resizable
750 bool toolbar
; // flag indicating dock contains only toolbars
751 bool fixed
; // flag indicating that the dock operates on
752 // absolute coordinates as opposed to proportional
756 class WXDLLIMPEXP_AUI wxAuiDockUIPart
772 int type
; // ui part type (see enum above)
773 int orientation
; // orientation (either wxHORIZONTAL or wxVERTICAL)
774 wxAuiDockInfo
* dock
; // which dock the item is associated with
775 wxAuiPaneInfo
* pane
; // which pane the item is associated with
776 wxAuiPaneButton
* button
; // which pane button the item is associated with
777 wxSizer
* cont_sizer
; // the part's containing sizer
778 wxSizerItem
* sizer_item
; // the sizer item of the part
779 wxRect rect
; // client coord rectangle of the part itself
783 class WXDLLIMPEXP_AUI wxAuiPaneButton
786 int button_id
; // id of the button (e.g. buttonClose)
792 // wx event machinery
794 BEGIN_DECLARE_EVENT_TYPES()
795 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_PANEBUTTON
, 0)
796 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_PANECLOSE
, 0)
797 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_PANEMAXIMIZE
, 0)
798 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_PANERESTORE
, 0)
799 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_RENDER
, 0)
800 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI
, wxEVT_AUI_FINDMANAGER
, 0)
801 END_DECLARE_EVENT_TYPES()
803 typedef void (wxEvtHandler::*wxAuiManagerEventFunction
)(wxAuiManagerEvent
&);
805 #define wxAuiManagerEventHandler(func) \
806 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiManagerEventFunction, &func)
808 #define EVT_AUI_PANEBUTTON(func) \
809 wx__DECLARE_EVT0(wxEVT_AUI_PANEBUTTON, wxAuiManagerEventHandler(func))
810 #define EVT_AUI_PANECLOSE(func) \
811 wx__DECLARE_EVT0(wxEVT_AUI_PANECLOSE, wxAuiManagerEventHandler(func))
812 #define EVT_AUI_PANEMAXIMIZE(func) \
813 wx__DECLARE_EVT0(wxEVT_AUI_PANEMAXIMIZE, wxAuiManagerEventHandler(func))
814 #define EVT_AUI_PANERESTORE(func) \
815 wx__DECLARE_EVT0(wxEVT_AUI_PANERESTORE, wxAuiManagerEventHandler(func))
816 #define EVT_AUI_RENDER(func) \
817 wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxAuiManagerEventHandler(func))
818 #define EVT_AUI_FINDMANAGER(func) \
819 wx__DECLARE_EVT0(wxEVT_AUI_FINDMANAGER, wxAuiManagerEventHandler(func))
823 %constant wxEventType wxEVT_AUI_PANEBUTTON
;
824 %constant wxEventType wxEVT_AUI_PANECLOSE
;
825 %constant wxEventType wxEVT_AUI_PANEMAXIMIZE
;
826 %constant wxEventType wxEVT_AUI_PANERESTORE
;
827 %constant wxEventType wxEVT_AUI_RENDER
;
828 %constant wxEventType wxEVT_AUI_FINDMANAGER
;
831 EVT_AUI_PANEBUTTON
= wx
.PyEventBinder( wxEVT_AUI_PANEBUTTON
)
832 EVT_AUI_PANECLOSE
= wx
.PyEventBinder( wxEVT_AUI_PANECLOSE
)
833 EVT_AUI_PANEMAXIMIZE
= wx
.PyEventBinder( wxEVT_AUI_PANEMAXIMIZE
)
834 EVT_AUI_PANERESTORE
= wx
.PyEventBinder( wxEVT_AUI_PANERESTORE
)
835 EVT_AUI_RENDER
= wx
.PyEventBinder( wxEVT_AUI_RENDER
)
836 EVT_AUI_FINDMANAGER
= wx
.PyEventBinder( wxEVT_AUI_FINDMANAGER
)
841 #endif //_WX_FRAMEMANAGER_H_