📄 framemanager.h
字号:
wxAuiManager(wxWindow* managed_wnd = NULL, unsigned int flags = wxAUI_MGR_DEFAULT); virtual ~wxAuiManager(); void UnInit(); void SetFlags(unsigned int flags); unsigned int GetFlags() const; void SetManagedWindow(wxWindow* managed_wnd); wxWindow* GetManagedWindow() const; static wxAuiManager* GetManager(wxWindow* window);#ifdef SWIG %disownarg( wxAuiDockArt* art_provider );#endif void SetArtProvider(wxAuiDockArt* art_provider); wxAuiDockArt* GetArtProvider() const; wxAuiPaneInfo& GetPane(wxWindow* window); wxAuiPaneInfo& GetPane(const wxString& name); wxAuiPaneInfoArray& GetAllPanes(); bool AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info); bool AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info, const wxPoint& drop_pos); bool AddPane(wxWindow* window, int direction = wxLEFT, const wxString& caption = wxEmptyString); bool InsertPane(wxWindow* window, const wxAuiPaneInfo& insert_location, int insert_level = wxAUI_INSERT_PANE); bool DetachPane(wxWindow* window); void Update(); wxString SavePaneInfo(wxAuiPaneInfo& pane); void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane); wxString SavePerspective(); bool LoadPerspective(const wxString& perspective, bool update = true); void SetDockSizeConstraint(double width_pct, double height_pct); void GetDockSizeConstraint(double* width_pct, double* height_pct) const; void ClosePane(wxAuiPaneInfo& pane_info); void MaximizePane(wxAuiPaneInfo& pane_info); void RestorePane(wxAuiPaneInfo& pane_info); void RestoreMaximizedPane();public: virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p); void StartPaneDrag( wxWindow* pane_window, const wxPoint& offset); wxRect CalculateHintRect( wxWindow* pane_window, const wxPoint& pt, const wxPoint& offset); void DrawHintRect( wxWindow* pane_window, 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, wxAuiDockInfo& dock, wxAuiPaneInfo& pane, wxAuiDockUIPartArray& uiparts, bool spacer_only); void LayoutAddDock(wxSizer* container, wxAuiDockInfo& dock, wxAuiDockUIPartArray& uiparts, bool spacer_only); wxSizer* LayoutAll(wxAuiPaneInfoArray& panes, wxAuiDockInfoArray& docks, wxAuiDockUIPartArray& uiparts, bool spacer_only = false); virtual bool ProcessDockResult(wxAuiPaneInfo& target, const wxAuiPaneInfo& new_pos); bool DoDrop(wxAuiDockInfoArray& docks, wxAuiPaneInfoArray& panes, wxAuiPaneInfo& drop, const wxPoint& pt, const wxPoint& action_offset = wxPoint(0,0)); wxAuiDockUIPart* HitTest(int x, int y); wxAuiDockUIPart* GetPanePart(wxWindow* pane); int GetDockPixelOffset(wxAuiPaneInfo& test); void OnFloatingPaneMoveStart(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); void Render(wxDC* dc); void Repaint(wxDC* dc = NULL); void ProcessMgrEvent(wxAuiManagerEvent& event); void UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part, const wxMouseEvent& event); void GetPanePositionsAndSizes(wxAuiDockInfo& dock, wxArrayInt& positions, wxArrayInt& sizes);public: // public events (which can be invoked externally) void OnRender(wxAuiManagerEvent& evt); void OnPaneButton(wxAuiManagerEvent& evt);protected: // 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); void OnFindManager(wxAuiManagerEvent& evt);protected: enum { actionNone = 0, actionResize, actionClickButton, actionClickCaption, actionDragToolbarPane, actionDragFloatingPane };protected: wxWindow* m_frame; // the window being managed wxAuiDockArt* m_art; // dock art object which does all drawing unsigned int m_flags; // manager flags wxAUI_MGR_* wxAuiPaneInfoArray m_panes; // array of panes structures wxAuiDockInfoArray m_docks; // array of docks structures wxAuiDockUIPartArray m_uiparts; // array of UI parts (captions, buttons, etc) int m_action; // current mouse action wxPoint m_action_start; // position where the action click started wxPoint m_action_offset; // offset from upper left of the item clicked wxAuiDockUIPart* 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 wxRect m_last_rect; wxAuiDockUIPart* 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) bool m_skipping; bool m_has_maximized; double m_dock_constraint_x; // 0.0 .. 1.0; max pct of window width a dock can consume double m_dock_constraint_y; // 0.0 .. 1.0; max pct of window height a dock can consume 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 void* m_reserved;#ifndef SWIG DECLARE_EVENT_TABLE() DECLARE_CLASS(wxAuiManager)#endif // SWIG};// event declarations/classesclass WXDLLIMPEXP_AUI wxAuiManagerEvent : public wxEvent{public: wxAuiManagerEvent(wxEventType type=wxEVT_NULL) : wxEvent(0, type) { manager = NULL; pane = NULL; button = 0; veto_flag = false; canveto_flag = true; dc = NULL; }#ifndef SWIG wxAuiManagerEvent(const wxAuiManagerEvent& c) : wxEvent(c) { manager = c.manager; pane = c.pane; button = c.button; veto_flag = c.veto_flag; canveto_flag = c.canveto_flag; dc = c.dc; }#endif wxEvent *Clone() const { return new wxAuiManagerEvent(*this); } void SetManager(wxAuiManager* mgr) { manager = mgr; } void SetPane(wxAuiPaneInfo* p) { pane = p; } void SetButton(int b) { button = b; } void SetDC(wxDC* pdc) { dc = pdc; } wxAuiManager* GetManager() const { return manager; } wxAuiPaneInfo* GetPane() const { return pane; } int GetButton() const { return button; } wxDC* GetDC() const { return dc; } void Veto(bool veto = true) { veto_flag = veto; } bool GetVeto() const { return veto_flag; } void SetCanVeto(bool can_veto) { canveto_flag = can_veto; } bool CanVeto() const { return canveto_flag && veto_flag; } public: wxAuiManager* manager; wxAuiPaneInfo* pane; int button; bool veto_flag; bool canveto_flag; wxDC* dc;#ifndef SWIGprivate: DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiManagerEvent)#endif};class WXDLLIMPEXP_AUI wxAuiDockInfo{public: wxAuiDockInfo() { dock_direction = 0; dock_layer = 0; dock_row = 0; size = 0; min_size = 0; resizable = true; fixed = false; toolbar = false; reserved1 = false; }#ifndef SWIG wxAuiDockInfo(const wxAuiDockInfo& c) { dock_direction = c.dock_direction; dock_layer = c.dock_layer; dock_row = c.dock_row; size = c.size; min_size = c.min_size; resizable = c.resizable; fixed = c.fixed; toolbar = c.toolbar; panes = c.panes; rect = c.rect; reserved1 = c.reserved1; } wxAuiDockInfo& operator=(const wxAuiDockInfo& c) { dock_direction = c.dock_direction; dock_layer = c.dock_layer; dock_row = c.dock_row; size = c.size; min_size = c.min_size; resizable = c.resizable; fixed = c.fixed; toolbar = c.toolbar; panes = c.panes; rect = c.rect; reserved1 = c.reserved1; return *this; }#endif // SWIG bool IsOk() const { return (dock_direction != 0) ? true : false; } bool IsHorizontal() const { return (dock_direction == wxAUI_DOCK_TOP || dock_direction == wxAUI_DOCK_BOTTOM) ? true:false; } bool IsVertical() const { return (dock_direction == wxAUI_DOCK_LEFT || dock_direction == wxAUI_DOCK_RIGHT || dock_direction == wxAUI_DOCK_CENTER) ? true:false; }public: wxAuiPaneInfoPtrArray panes; // array of panes wxRect rect; // current rectangle int dock_direction; // dock direction (top, bottom, left, right, center) int dock_layer; // layer number (0 = innermost layer) int dock_row; // row number on the docking bar (0 = first row) int size; // size of the dock int min_size; // minimum size of a dock (0 if there is no min) bool resizable; // flag indicating whether the dock is resizable bool toolbar; // flag indicating dock contains only toolbars bool fixed; // flag indicating that the dock operates on // absolute coordinates as opposed to proportional bool reserved1;};class WXDLLIMPEXP_AUI wxAuiDockUIPart{public: enum { typeCaption, typeGripper, typeDock, typeDockSizer, typePane, typePaneSizer, typeBackground, typePaneBorder, typePaneButton }; int type; // ui part type (see enum above) int orientation; // orientation (either wxHORIZONTAL or wxVERTICAL) wxAuiDockInfo* dock; // which dock the item is associated with wxAuiPaneInfo* pane; // which pane the item is associated with wxAuiPaneButton* button; // which pane button the item is associated with wxSizer* cont_sizer; // the part's containing sizer wxSizerItem* sizer_item; // the sizer item of the part wxRect rect; // client coord rectangle of the part itself};class WXDLLIMPEXP_AUI wxAuiPaneButton{public: int button_id; // id of the button (e.g. buttonClose)};#ifndef SWIG// wx event machineryBEGIN_DECLARE_EVENT_TYPES() DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_BUTTON, 0) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_CLOSE, 0) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_MAXIMIZE, 0) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_RESTORE, 0) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, 0) DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_AUI_FIND_MANAGER, 0)END_DECLARE_EVENT_TYPES()typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&);#define wxAuiManagerEventHandler(func) \ (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiManagerEventFunction, &func)#define EVT_AUI_PANE_BUTTON(func) \ wx__DECLARE_EVT0(wxEVT_AUI_PANE_BUTTON, wxAuiManagerEventHandler(func))#define EVT_AUI_PANE_CLOSE(func) \ wx__DECLARE_EVT0(wxEVT_AUI_PANE_CLOSE, wxAuiManagerEventHandler(func))#define EVT_AUI_PANE_MAXIMIZE(func) \ wx__DECLARE_EVT0(wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEventHandler(func))#define EVT_AUI_PANE_RESTORE(func) \ wx__DECLARE_EVT0(wxEVT_AUI_PANE_RESTORE, wxAuiManagerEventHandler(func))#define EVT_AUI_RENDER(func) \ wx__DECLARE_EVT0(wxEVT_AUI_RENDER, wxAuiManagerEventHandler(func))#define EVT_AUI_FIND_MANAGER(func) \ wx__DECLARE_EVT0(wxEVT_AUI_FIND_MANAGER, wxAuiManagerEventHandler(func))#else%constant wxEventType wxEVT_AUI_PANE_BUTTON;%constant wxEventType wxEVT_AUI_PANE_CLOSE;%constant wxEventType wxEVT_AUI_PANE_MAXIMIZE;%constant wxEventType wxEVT_AUI_PANE_RESTORE;%constant wxEventType wxEVT_AUI_RENDER;%constant wxEventType wxEVT_AUI_FIND_MANAGER;%pythoncode { EVT_AUI_PANE_BUTTON = wx.PyEventBinder( wxEVT_AUI_PANE_BUTTON ) EVT_AUI_PANE_CLOSE = wx.PyEventBinder( wxEVT_AUI_PANE_CLOSE ) EVT_AUI_PANE_MAXIMIZE = wx.PyEventBinder( wxEVT_AUI_PANE_MAXIMIZE ) EVT_AUI_PANE_RESTORE = wx.PyEventBinder( wxEVT_AUI_PANE_RESTORE ) EVT_AUI_RENDER = wx.PyEventBinder( wxEVT_AUI_RENDER ) EVT_AUI_FIND_MANAGER = wx.PyEventBinder( wxEVT_AUI_FIND_MANAGER )}#endif // SWIG#endif // wxUSE_AUI#endif //_WX_FRAMEMANAGER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -