17#ifndef __albaGUIDockManager__H
18#define __albaGUIDockManager__H
128 m_FloatingPos = wxDefaultPosition;
129 m_FloatingSize = wxDefaultSize;
130 m_BestSize = wxDefaultSize;
131 m_MinSize = wxDefaultSize;
132 m_MaxSize = wxDefaultSize;
133 m_DockProportion = 0;
184 bool IsOk()
const {
return (m_Window != NULL) ? true :
false; }
186 bool IsFixed()
const {
return !HasFlag(optionResizable); }
190 bool IsShown()
const {
return !HasFlag(optionHidden); }
194 bool IsDocked()
const {
return !HasFlag(optionFloating); }
196 bool IsToolbar()
const {
return HasFlag(optionToolbar); }
208 bool IsMovable()
const {
return HasFlag(optionMovable); }
214 bool HasBorder()
const {
return HasFlag(optionPaneBorder); }
319 m_State |= optionTopDockable | optionBottomDockable |
320 optionLeftDockable | optionRightDockable |
321 optionFloatable | optionMovable | optionResizable |
322 optionCaption | optionPaneBorder | buttonClose;
339 m_State |= (optionToolbar | optionGripper);
340 m_State &= ~(optionResizable | optionCaption);
341 if (m_DockLayer == 0)
359 return (m_State & flag) ?
true:
false;
366 optionFloating = 1 << 0,
367 optionHidden = 1 << 1,
368 optionLeftDockable = 1 << 2,
369 optionRightDockable = 1 << 3,
370 optionTopDockable = 1 << 4,
371 optionBottomDockable = 1 << 5,
372 optionFloatable = 1 << 6,
373 optionMovable = 1 << 7,
374 optionResizable = 1 << 8,
375 optionPaneBorder = 1 << 9,
376 optionCaption = 1 << 10,
377 optionGripper = 1 << 11,
378 optionDestroyOnClose = 1 << 12,
379 optionToolbar = 1 << 13,
380 optionActive = 1 << 14,
382 buttonClose = 1 << 24,
383 buttonMaximize = 1 << 25,
384 buttonMinimize = 1 << 26,
386 buttonCustom1 = 1 << 28,
387 buttonCustom2 = 1 << 29,
388 buttonCustom3 = 1 << 30,
427friend class wxFloatingPane;
467 int direction = wxLEFT,
468 const wxString& caption = wxEmptyString);
489 void DrawHintRect(wxWindow* pane_window,
491 const wxPoint& offset);
497 void DoFrameLayout();
500 void LayoutAddPane(wxSizer* container,
503 wxDockUIPartArray& uiparts,
506 void LayoutAddDock(wxSizer* container,
508 wxDockUIPartArray& uiparts,
512 wxSizer* LayoutAll(wxPaneInfoArray& panes,
513 wxDockInfoArray& docks,
514 wxDockUIPartArray& uiparts,
515 bool spacer_only =
false);
517 bool DoDrop(wxDockInfoArray& docks,
518 wxPaneInfoArray& panes,
521 const wxPoint& action_offset = wxPoint(0,0));
538 void OnFloatingPaneMoveStart(wxWindow* window);
540 void OnFloatingPaneMoving(wxWindow* window);
542 void OnFloatingPaneMoved(wxWindow* window);
544 void OnFloatingPaneActivated(wxWindow* window);
546 void OnFloatingPaneClosed(wxWindow* window);
548 void OnFloatingPaneResized(wxWindow* window,
const wxSize& size);
550 void Render(wxDC* dc);
552 void Repaint(wxDC* dc = NULL);
557 const wxMouseEvent& event);
559 void GetPanePositionsAndSizes(
wxDockInfo& dock,
560 wxArrayInt& positions,
563 void ShowHint(
const wxRect& rect);
572 void OnPaint(wxPaintEvent& event);
574 void OnEraseBackground(wxEraseEvent& event);
576 void OnSize(wxSizeEvent& event);
578 void OnSetCursor(wxSetCursorEvent& event);
580 void OnLeftDown(wxMouseEvent& event);
582 void OnLeftUp(wxMouseEvent& event);
584 void OnMotion(wxMouseEvent& event);
586 void OnLeaveWindow(wxMouseEvent& event);
590 void OnChildFocus(wxChildFocusEvent& event);
592 void OnHintFadeTimer(wxTimerEvent& event);
602 actionDragToolbarPane,
603 actionDragFloatingPane
631 DECLARE_EVENT_TABLE()
695 virtual void SetFont(
int id,
const wxFont& font) = 0;
701 virtual void SetColour(
int id,
const wxColor& colour) = 0;
705 void SetColor(
int id,
const wxColor& color) { SetColour(
id, color); }
710 const wxRect& rect) = 0;
714 const wxRect& rect) = 0;
717 const wxString& text,
773 const wxString& text,
873 bool IsOk()
const {
return (m_DockDirection != 0) ? true :
false; }
944BEGIN_DECLARE_EVENT_TYPES()
945 DECLARE_EXPORTED_EVENT_TYPE(ALBA_EXPORT,wxEVT_AUI_PANEBUTTON, 0)
946END_DECLARE_EVENT_TYPES()
950#define wxFrameManagerEventHandler(func) \
951 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFrameManagerEventFunction, &func)
953#define EVT_AUI_PANEBUTTON(func) \
954 wx__DECLARE_EVT0(wxEVT_AUI_PANEBUTTON, wxFrameManagerEventHandler(func))
968 virtual bool AddPane(wxWindow* window,
const wxPaneInfo& pane_info,
const wxString &menu = _(
"&View"),
const wxString &subMenu = wxEmptyString);
970 virtual bool AddPane(wxWindow* window,
int direction = wxLEFT,
const wxString& caption = wxEmptyString);
975 void AddMenuItem(wxWindow* window,
const wxString& caption = wxEmptyString,
const wxString &menu = _(
"&View"),
const wxString &subMenu = wxEmptyString );
WX_DEFINE_ARRAY_PTR(wxPaneInfo *, wxPaneInfoPtrArray)
@ wxAUI_BUTTON_STATE_PRESSED
@ wxAUI_BUTTON_STATE_HOVER
@ wxAUI_BUTTON_STATE_NORMAL
@ wxAUI_GRADIENT_HORIZONTAL
@ wxAUI_GRADIENT_VERTICAL
WX_DECLARE_OBJARRAY_WITH_DECL(wxDockInfo, wxDockInfoArray, class ALBA_EXPORT)
@ wxAUI_ART_ACTIVE_CAPTION_COLOUR
@ wxAUI_ART_PANE_BORDER_SIZE
@ wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR
@ wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR
@ wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR
@ wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR
@ wxAUI_ART_INACTIVE_CAPTION_COLOUR
@ wxAUI_ART_BORDER_COLOUR
@ wxAUI_ART_PANE_BUTTON_SIZE
@ wxAUI_ART_GRADIENT_TYPE
@ wxAUI_ART_GRIPPER_COLOUR
@ wxAUI_ART_BACKGROUND_COLOUR
void(wxEvtHandler::* wxFrameManagerEventFunction)(wxFrameManagerEvent &)
ALBA_EXPORT wxDockInfo wxNullDockInfo
ALBA_EXPORT wxPaneInfo wxNullPaneInfo
@ wxAUI_MGR_ALLOW_ACTIVE_PANE
@ wxAUI_MGR_TRANSPARENT_DRAG
@ wxAUI_MGR_TRANSPARENT_HINT_FADE
@ wxAUI_MGR_TRANSPARENT_HINT
@ wxAUI_MGR_ALLOW_FLOATING
class name: albaGUIDockManager Represent a frame manager for gui dock elements.
virtual bool AddPane(wxWindow *window, const wxPaneInfo &pane_info, const wxString &menu=_("&View"), const wxString &subMenu=wxEmptyString)
add pane
virtual void Update()
update
virtual bool AddPane(wxWindow *window, int direction=wxLEFT, const wxString &caption=wxEmptyString)
add pane overload
void UpdateMenuItems()
update menu items
void AddMenuItem(wxWindow *window, const wxString &caption=wxEmptyString, const wxString &menu=_("&View"), const wxString &subMenu=wxEmptyString)
add menu item
class name: wxDefaultDockArt this is the default art provider for wxFrameManager.
void DrawBackground(wxDC &dc, int orientation, const wxRect &rect)
Draw Background.
wxDefaultDockArt()
constructor
wxFont GetFont(int id)
get font
wxColour GetColour(int id)
get colour
wxBitmap m_InactivePinBitmap
wxColour m_ActiveCaptionTextColour
void DrawCaption(wxDC &dc, const wxString &text, const wxRect &rect, wxPaneInfo &pane)
Draw Caption.
wxBrush m_BackgroundBrush
wxBitmap m_ActivePinBitmap
void DrawCaptionBackground(wxDC &dc, const wxRect &rect, bool active)
Draw Caption Background.
void DrawSash(wxDC &dc, int orientation, const wxRect &rect)
Draw Sash.
wxBitmap m_ActiveCloseBitmap
void DrawBorder(wxDC &dc, const wxRect &rect, wxPaneInfo &pane)
Draw Border.
wxColour m_InactiveCaptionColour
wxColour m_ActiveCaptionGradientColour
void DrawGripper(wxDC &dc, const wxRect &rect, wxPaneInfo &pane)
Draw Gripper.
wxColour m_ActiveCaptionColour
wxColour m_InactiveCaptionGradientColour
wxBitmap m_InactiveCloseBitmap
void SetFont(int id, const wxFont &font)
set font
wxColour m_InactiveCaptionTextColour
int GetMetric(int metric_id)
get metric
void DrawPaneButton(wxDC &dc, int button, int button_state, const wxRect &rect, wxPaneInfo &pane)
Draw Pane Button.
void SetColour(int id, const wxColor &colour)
set colour
void SetMetric(int metric_id, int new_val)
set metric
class name: wxDockArt dock art provider code - a dock provider provides all drawing functionality to ...
virtual void DrawBorder(wxDC &dc, const wxRect &rect, wxPaneInfo &pane)=0
draw border
virtual void DrawSash(wxDC &dc, int orientation, const wxRect &rect)=0
draw sash
virtual void SetMetric(int id, int new_val)=0
set metric
virtual void DrawPaneButton(wxDC &dc, int button, int button_state, const wxRect &rect, wxPaneInfo &pane)=0
draw pane button
virtual void SetFont(int id, const wxFont &font)=0
set font
void SetColor(int id, const wxColor &color)
set colour
virtual void DrawBackground(wxDC &dc, int orientation, const wxRect &rect)=0
draw background
virtual ~wxDockArt()
destructor
virtual void DrawGripper(wxDC &dc, const wxRect &rect, wxPaneInfo &pane)=0
draw gripper
virtual wxColour GetColour(int id)=0
get colour
virtual wxFont GetFont(int id)=0
get font
virtual void DrawCaption(wxDC &dc, const wxString &text, const wxRect &rect, wxPaneInfo &pane)=0
draw caption
wxColor GetColor(int id)
get colour
virtual int GetMetric(int id)=0
get metric
virtual void SetColour(int id, const wxColor &colour)=0
set colour
class name: wxDockInfo This class define properties of a dock.
wxPaneInfoPtrArray m_Panes
wxDockInfo & operator=(const wxDockInfo &c)
assignment operator
wxDockInfo(const wxDockInfo &c)
copy constructor
bool IsOk() const
retrieve if dock direction is active
bool IsVertical() const
retrieve if dock direction is left , rigth or center
bool IsHorizontal() const
retrieve if dock direction is top or bottom
class name: wxDockUIPart This class define a UI part of a dock.
wxSizerItem * m_SizerItem
class name: wxFrameManagerEvent Event handled by frame manager
wxFrameManagerEvent(const wxFrameManagerEvent &c)
constructor
wxPaneInfo * GetPane()
retrieve pane
wxEvent * Clone() const
clone the event and retrieve the new instance
wxFrameManagerEvent(wxEventType type)
constructor
void SetPane(wxPaneInfo *p)
set pane member
void SetButton(int b)
set button member
int GetButton()
retrieve button
class name: wxFrameManager Manager for dockabale panels; it can manage flags, attach/detach panes.
wxPaneInfo & GetPane(const wxString &name)
retrieve pane from name
virtual void Update()
update
void UnInit()
remove event handler
wxDockUIPart * m_ActionPart
virtual ~wxFrameManager()
destructor
wxDockUIPart * m_HoverButton
unsigned int GetFlags() const
retrieve flags
bool LoadPerspective(const wxString &perspective, bool update=true)
load perspective from a string
void SetArtProvider(wxDockArt *art_provider)
set art provider
wxDockUIPartArray m_UIParts
wxDockArt * GetArtProvider() const
retrieve art provider
wxPaneInfoArray & GetAllPanes()
retrieve all panes
wxWindow * m_ActionWindow
void SetFlags(unsigned int flags)
set flags
wxPaneInfoArray m_PanesArray
wxFrameManager(wxFrame *frame=NULL, unsigned int flags=wxAUI_MGR_DEFAULT)
constructor
wxFrame * GetFrame() const
retrieve frame
wxPaneInfo & GetPane(wxWindow *window)
retrieve pane from window
wxString SavePerspective()
saves all pane information as a single string
void SetFrame(wxFrame *frame)
set frame
virtual bool AddPane(wxWindow *window, const wxPaneInfo &pane_info)
add pane
bool InsertPane(wxWindow *window, const wxPaneInfo &pane_info, int insert_level=wxAUI_INSERT_PANE)
insert pane, shifting the panes around, depending on the insert level
virtual bool AddPane(wxWindow *window, int direction=wxLEFT, const wxString &caption=wxEmptyString)
add pane
bool DetachPane(wxWindow *window)
detach pane
class name: wxPaneInfo This class define properties of a pane.
wxPaneInfo & ToolbarPane()
set optionToolbar optionGripper , remove optionResizable and optionCaption and retrieve this pointer
wxPaneInfo & TopDockable(bool b=true)
set flag optionTopDockable and retrieve this pointer
wxPaneInfo & Dockable(bool b=true)
set TopDockable BottomDockable LeftDockable RightDockable and retrieve this pointer
wxPaneInfo & MinSize(const wxSize &size)
set min size and retrieve this pointer
wxPaneInfo & FloatingPosition(int x, int y)
set floating position and retrieve this pointer
bool IsFixed() const
check flag optionResizable
wxPaneInfo & Resizable(bool resizable=true)
set flag optionResizable and retrieve this pointer
wxPaneInfo & DestroyOnClose(bool b=true)
set flag optionDestroyOnClose and retrieve this pointer
bool HasCloseButton() const
check flag buttonClose
wxPaneInfo & Bottom()
set dock direction to bottom and retrieve this pointer
bool IsFloating() const
check flag optionFloating
wxPaneInfo & MinSize(int x, int y)
set min size and retrieve this pointer
bool HasFlag(unsigned int flag) const
check if flag is active
wxPaneInfo & FloatingPosition(const wxPoint &pos)
set floating position and retrieve this pointer
wxPaneInfo & Direction(int direction)
set dock direction and retrieve this pointer
wxPaneInfo & Centre()
set dock direction to center and retrieve this pointer
bool IsMovable() const
check flag optionMovable
bool IsResizable() const
check flag optionResizable
wxPaneInfo & CaptionVisible(bool visible=true)
set flag optionCaption and retrieve this pointer
wxPaneInfo & Movable(bool b=true)
set flag optionMovable and retrieve this pointer
wxPaneInfo & BestSize(int x, int y)
set best size and retrieve this pointer
wxPaneInfo & MaximizeButton(bool visible=true)
set flag buttonMaximize and retrieve this pointer
wxPaneInfo & Top()
set dock direction to top and retrieve this pointer
wxPaneInfo & operator=(const wxPaneInfo &c)
assignment operator
wxPaneInfo & Floatable(bool b=true)
set flag optionFloatable and retrieve this pointer
wxPaneInfo & Left()
set dock direction to left and retrieve this pointer
bool IsTopDockable() const
check flag optionTopDockable
wxPaneInfo & Center()
set dock direction to center and retrieve this pointer
wxPaneInfo & BottomDockable(bool b=true)
set flag optionBottomDockable and retrieve this pointer
wxPaneInfo & FloatingSize(const wxSize &size)
set floating size and retrieve this pointer
wxPaneInfo & Right()
set dock direction to right and retrieve this pointer
wxPaneInfo & BestSize(const wxSize &size)
set best size and retrieve this pointer
wxPaneInfo & Show(bool show=true)
set flag optionHidden and retrieve this pointer
bool HasPinButton() const
check flag buttonPin
bool IsDocked() const
check flag optionFloating
wxPaneInfo & Row(int row)
set row and retrieve this pointer
wxPaneInfo & Float()
set flag optionFloating and retrieve this pointer
wxPaneInfo & DefaultPane()
initialize pane flags and retrieve this pointer
bool IsToolbar() const
check flag optionToolbar
wxPaneInfo & Gripper(bool visible=true)
set flag optionGripper and retrieve this pointer
wxPaneInfo & Position(int pos)
set position and retrieve this pointer
bool HasBorder() const
check flag optionPaneBorder
wxPaneInfo & CenterPane()
set Center PaneBorder Resizable and retrieve this pointer
wxPaneInfo & MaxSize(int x, int y)
set max size and retrieve this pointer
wxPaneInfo & MinimizeButton(bool visible=true)
set flag buttonMinimize and retrieve this pointer
bool HasCaption() const
check flag optionCaption
bool HasMinimizeButton() const
check flag buttonMinimize
wxPaneButtonArray m_Buttons
wxPaneInfo & Hide()
set flag optionHidden and retrieve this pointer
wxPaneInfo & FloatingSize(int x, int y)
set floating size and retrieve this pointer
wxPaneInfo & PinButton(bool visible=true)
set flag buttonPin and retrieve this pointer
bool IsFloatable() const
check flag optionFloatable
wxPaneInfo & CloseButton(bool visible=true)
set flag buttonClose and retrieve this pointer
wxPaneInfo & LeftDockable(bool b=true)
set flag optionLeftDockable and retrieve this pointer
bool IsOk() const
retrive if the pane exist
bool IsLeftDockable() const
check flag optionLeftDockable
wxPaneInfo & Window(wxWindow *w)
set window and retrieve this pointer
wxPaneInfo & Dock()
set flag optionFloating and retrieve this pointer
wxPaneInfo & PaneBorder(bool visible=true)
set flag optionPaneBorder and retrieve this pointer
wxPaneInfo & Caption(const wxString &c)
set caption and retrieve this pointer
wxPaneInfo & RightDockable(bool b=true)
set flag optionRightDockable and retrieve this pointer
wxPaneInfo & Fixed()
set flag optionResizable and retrieve this pointer
wxPaneInfo & CentrePane()
set Center PaneBorder Resizable and retrieve this pointer
bool HasGripper() const
check flag optionGripper
bool IsRightDockable() const
check flag optionRightDockable
bool HasMaximizeButton() const
check flag buttonMaximize
bool IsShown() const
check flag optionHidden
wxPaneInfo & Layer(int layer)
set layer and retrieve this pointer
wxPaneInfo & MaxSize(const wxSize &size)
set max size and retrieve this pointer
wxPaneInfo & SetFlag(unsigned int flag, bool option_state)
set generic flag and retrieve this pointer
wxPaneInfo & Name(const wxString &n)
set name and retrieve this pointer
wxPaneInfo(const wxPaneInfo &c)
copy constructor
bool IsBottomDockable() const
check flag optionBottomDockable