X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af672b5ae860d453e685ec1ad4181f49254abfa8..f9e5b1c786b132485fb0570755d693ff354f4418:/include/wx/aui/framemanager.h?ds=sidebyside diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index f684c3e677..f3b8d6b3a7 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -39,17 +39,22 @@ enum wxFrameManagerDock enum wxFrameManagerOption { - wxAUI_MGR_ALLOW_FLOATING = 1 << 0, - wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1, - wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2, - wxAUI_MGR_TRANSPARENT_HINT = 1 << 3, - wxAUI_MGR_TRANSPARENT_HINT_FADE = 1 << 4, + wxAUI_MGR_ALLOW_FLOATING = 1 << 0, + wxAUI_MGR_ALLOW_ACTIVE_PANE = 1 << 1, + wxAUI_MGR_TRANSPARENT_DRAG = 1 << 2, + wxAUI_MGR_TRANSPARENT_HINT = 1 << 3, + wxAUI_MGR_VENETIAN_BLINDS_HINT = 1 << 4, + wxAUI_MGR_RECTANGLE_HINT = 1 << 5, + wxAUI_MGR_HINT_FADE = 1 << 6, + wxAUI_MGR_NO_VENETIAN_BLINDS_FADE = 1 << 7, wxAUI_MGR_DEFAULT = wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_TRANSPARENT_HINT | - wxAUI_MGR_TRANSPARENT_HINT_FADE + wxAUI_MGR_HINT_FADE | + wxAUI_MGR_NO_VENETIAN_BLINDS_FADE }; + enum wxPaneDockArtSetting { wxAUI_ART_SASH_SIZE = 0, @@ -107,8 +112,8 @@ WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDockInfo, wxDockInfoArray, WXDLLIMPEXP_AUI); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDockUIPart, wxDockUIPartArray, WXDLLIMPEXP_AUI); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxPaneButton, wxPaneButtonArray, WXDLLIMPEXP_AUI); WX_DECLARE_USER_EXPORTED_OBJARRAY(wxPaneInfo, wxPaneInfoArray, WXDLLIMPEXP_AUI); -WX_DEFINE_ARRAY_PTR(wxPaneInfo*, wxPaneInfoPtrArray); -WX_DEFINE_ARRAY_PTR(wxDockInfo*, wxDockInfoPtrArray); +WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxPaneInfo*, wxPaneInfoPtrArray, class WXDLLIMPEXP_AUI); +WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxDockInfo*, wxDockInfoPtrArray, class WXDLLIMPEXP_AUI); #endif // SWIG extern WXDLLIMPEXP_AUI wxDockInfo wxNullDockInfo; @@ -185,7 +190,20 @@ public: return *this; } #endif // SWIG - + + // Write the safe parts of a newly loaded PaneInfo structure "source" into "this" + // used on loading perspectives etc. + void SafeSet(wxPaneInfo source) + { + // note source is not passed by reference so we can overwrite, to keep the + // unsafe bits of "dest" + source.window = window; + source.frame = frame; + source.buttons = buttons; + // now assign + *this = source; + } + bool IsOk() const { return (window != NULL) ? true : false; } bool IsFixed() const { return !HasFlag(optionResizable); } bool IsResizable() const { return HasFlag(optionResizable); } @@ -199,6 +217,7 @@ public: bool IsRightDockable() const { return HasFlag(optionRightDockable); } bool IsFloatable() const { return HasFlag(optionFloatable); } bool IsMovable() const { return HasFlag(optionMovable); } + bool IsDestroyOnClose() const { return HasFlag(optionDestroyOnClose); } bool HasCaption() const { return HasFlag(optionCaption); } bool HasGripper() const { return HasFlag(optionGripper); } bool HasBorder() const { return HasFlag(optionPaneBorder); } @@ -340,7 +359,7 @@ public: wxString caption; // caption displayed on the window wxWindow* window; // window that is in this pane - wxWindow* frame; // floating frame window that holds the pane + wxFrame* frame; // floating frame window that holds the pane unsigned int state; // a combination of wxPaneState values int dock_direction; // dock direction (top, bottom, left, right, center) @@ -363,7 +382,7 @@ public: - +class WXDLLIMPEXP_AUI wxFloatingPane; class WXDLLIMPEXP_AUI wxFrameManager : public wxEvtHandler { @@ -371,7 +390,7 @@ friend class wxFloatingPane; public: - wxFrameManager(wxFrame* frame = NULL, + wxFrameManager(wxWindow* managed_wnd = NULL, unsigned int flags = wxAUI_MGR_DEFAULT); virtual ~wxFrameManager(); void UnInit(); @@ -379,8 +398,8 @@ public: void SetFlags(unsigned int flags); unsigned int GetFlags() const; - void SetFrame(wxFrame* frame); - wxFrame* GetFrame() const; + void SetManagedWindow(wxWindow* managed_wnd); + wxWindow* GetManagedWindow() const; #ifdef SWIG %disownarg( wxDockArt* art_provider ); @@ -394,6 +413,10 @@ public: bool AddPane(wxWindow* window, const wxPaneInfo& pane_info); + + bool AddPane(wxWindow* window, + const wxPaneInfo& pane_info, + const wxPoint& drop_pos); bool AddPane(wxWindow* window, int direction = wxLEFT, @@ -404,6 +427,11 @@ public: int insert_level = wxAUI_INSERT_PANE); bool DetachPane(wxWindow* window); + + void ClosePane(wxPaneInfo& pane_info); + + wxString SavePaneInfo(wxPaneInfo& pane); + void LoadPaneInfo(wxString pane_part, wxPaneInfo &pane); wxString SavePerspective(); @@ -412,12 +440,28 @@ public: void Update(); -protected: + +public: + virtual wxFloatingPane* CreateFloatingFrame(wxWindow* parent, const wxPaneInfo& p); void DrawHintRect(wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset); + const wxPoint& pt, + const wxPoint& offset); + virtual void ShowHint(const wxRect& rect); + virtual void HideHint(); +public: + + // deprecated -- please use SetManagedWindow() and + // and GetManagedWindow() instead + + wxDEPRECATED( void SetFrame(wxFrame* frame) ); + wxDEPRECATED( wxFrame* GetFrame() const ); + +protected: + + void UpdateHintWindowConfig(); + void DoFrameLayout(); void LayoutAddPane(wxSizer* container, @@ -436,6 +480,9 @@ protected: wxDockUIPartArray& uiparts, bool spacer_only = false); + virtual bool ProcessDockResult(wxPaneInfo& target, + const wxPaneInfo& new_pos); + bool DoDrop(wxDockInfoArray& docks, wxPaneInfoArray& panes, wxPaneInfo& drop, @@ -448,8 +495,8 @@ protected: wxDockUIPart* GetPanePart(wxWindow* pane); int GetDockPixelOffset(wxPaneInfo& test); void OnFloatingPaneMoveStart(wxWindow* window); - void OnFloatingPaneMoving(wxWindow* window); - void OnFloatingPaneMoved(wxWindow* window); + void OnFloatingPaneMoving(wxWindow* window, wxDirection dir ); + void OnFloatingPaneMoved(wxWindow* window, wxDirection dir); void OnFloatingPaneActivated(wxWindow* window); void OnFloatingPaneClosed(wxWindow* window, wxCloseEvent& evt); void OnFloatingPaneResized(wxWindow* window, const wxSize& size); @@ -461,23 +508,27 @@ protected: void GetPanePositionsAndSizes(wxDockInfo& dock, wxArrayInt& positions, wxArrayInt& sizes); - virtual void ShowHint(const wxRect& rect); - virtual void HideHint(); + + +public: + + // public events (which can be invoked externally) + void OnRender(wxFrameManagerEvent& evt); + void OnPaneButton(wxFrameManagerEvent& evt); protected: - // events - void OnPaint(wxPaintEvent& event); - void OnEraseBackground(wxEraseEvent& event); - void OnSize(wxSizeEvent& event); - void OnSetCursor(wxSetCursorEvent& event); - void OnLeftDown(wxMouseEvent& event); - void OnLeftUp(wxMouseEvent& event); - void OnMotion(wxMouseEvent& event); - void OnLeaveWindow(wxMouseEvent& event); - void OnPaneButton(wxFrameManagerEvent& event); - void OnChildFocus(wxChildFocusEvent& event); - void OnHintFadeTimer(wxTimerEvent& event); + // protected events + void OnPaint(wxPaintEvent& evt); + void OnEraseBackground(wxEraseEvent& evt); + void OnSize(wxSizeEvent& evt); + void OnSetCursor(wxSetCursorEvent& evt); + void OnLeftDown(wxMouseEvent& evt); + void OnLeftUp(wxMouseEvent& evt); + void OnMotion(wxMouseEvent& evt); + void OnLeaveWindow(wxMouseEvent& evt); + void OnChildFocus(wxChildFocusEvent& evt); + void OnHintFadeTimer(wxTimerEvent& evt); protected: @@ -493,7 +544,7 @@ protected: protected: - wxFrame* m_frame; // the frame being managed + wxWindow* m_frame; // the window being managed wxDockArt* m_art; // dock art object which does all drawing unsigned int m_flags; // manager flags wxAUI_MGR_* @@ -507,13 +558,16 @@ protected: wxDockUIPart* m_action_part; // ptr to the part the action happened to wxWindow* m_action_window; // action frame or window (NULL if none) wxRect m_action_hintrect; // hint rectangle for the action + bool m_skipping; + wxRect m_last_rect; wxDockUIPart* m_hover_button;// button uipart being hovered over wxRect m_last_hint; // last hint rectangle wxPoint m_last_mouse_move; // last mouse move position (see OnMotion) - wxWindow* m_hint_wnd; // transparent hint window (for now, only msw) - wxTimer m_hint_fadetimer; // transparent fade timer (for now, only msw) - int m_hint_fadeamt; // transparent fade amount (for now, only msw) + wxFrame* m_hint_wnd; // transparent hint window, if supported by platform + wxTimer m_hint_fadetimer; // transparent fade timer + wxByte m_hint_fadeamt; // transparent fade amount + wxByte m_hint_fademax; // maximum value of hint fade #ifndef SWIG DECLARE_EVENT_TABLE() @@ -533,6 +587,7 @@ public: button = 0; veto_flag = false; canveto_flag = true; + dc = NULL; } #ifndef SWIG wxFrameManagerEvent(const wxFrameManagerEvent& c) : wxEvent(c) @@ -541,14 +596,18 @@ public: button = c.button; veto_flag = c.veto_flag; canveto_flag = c.canveto_flag; + dc = c.dc; } #endif wxEvent *Clone() const { return new wxFrameManagerEvent(*this); } void SetPane(wxPaneInfo* p) { pane = p; } void SetButton(int b) { button = b; } + void SetDC(wxDC* pdc) { dc = pdc; } + wxPaneInfo* GetPane() { return pane; } int GetButton() { return button; } + wxDC* GetDC() { return dc; } void Veto(bool veto = true) { veto_flag = veto; } bool GetVeto() const { return veto_flag; } @@ -560,6 +619,7 @@ public: int button; bool veto_flag; bool canveto_flag; + wxDC* dc; #ifndef SWIG private: @@ -676,6 +736,7 @@ public: BEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANEBUTTON, 0) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANECLOSE, 0) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, 0) END_DECLARE_EVENT_TYPES() typedef void (wxEvtHandler::*wxFrameManagerEventFunction)(wxFrameManagerEvent&); @@ -687,15 +748,19 @@ typedef void (wxEvtHandler::*wxFrameManagerEventFunction)(wxFrameManagerEvent&); wx__DECLARE_EVT0(wxEVT_AUI_PANEBUTTON, wxFrameManagerEventHandler(func)) #define EVT_AUI_PANECLOSE(func) \ wx__DECLARE_EVT0(wxEVT_AUI_PANECLOSE, wxFrameManagerEventHandler(func)) +#define EVT_AUI_RENDER(func) \ + wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxFrameManagerEventHandler(func)) #else %constant wxEventType wxEVT_AUI_PANEBUTTON; %constant wxEventType wxEVT_AUI_PANECLOSE; +%constant wxEventType wxEVT_AUI_RENDER; %pythoncode { EVT_AUI_PANEBUTTON = wx.PyEventBinder( wxEVT_AUI_PANEBUTTON ) EVT_AUI_PANECLOSE = wx.PyEventBinder( wxEVT_AUI_PANECLOSE ) + EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER ) } #endif // SWIG