📄 controlbar.h
字号:
typedef void (wxEvtHandler::*cbRightUpHandler )(cbRightUpEvent&);typedef void (wxEvtHandler::*cbMotionHandler )(cbMotionEvent&);typedef void (wxEvtHandler::*cbLeftDClickHandler )(cbLeftDClickEvent&);typedef void (wxEvtHandler::*cbLayoutRowHandler )(cbLayoutRowEvent&);typedef void (wxEvtHandler::*cbResizeRowHandler )(cbResizeRowEvent&);typedef void (wxEvtHandler::*cbLayoutRowsHandler )(cbLayoutRowsEvent&);typedef void (wxEvtHandler::*cbInsertBarHandler )(cbInsertBarEvent&);typedef void (wxEvtHandler::*cbResizeBarHandler )(cbResizeBarEvent&);typedef void (wxEvtHandler::*cbRemoveBarHandler )(cbRemoveBarEvent&);typedef void (wxEvtHandler::*cbSizeBarWndHandler )(cbSizeBarWndEvent&);typedef void (wxEvtHandler::*cbDrawBarDecorHandler )(cbDrawBarDecorEvent&);typedef void (wxEvtHandler::*cbDrawRowDecorHandler )(cbDrawRowDecorEvent&);typedef void (wxEvtHandler::*cbDrawPaneDecorHandler )(cbDrawPaneDecorEvent&);typedef void (wxEvtHandler::*cbDrawBarHandlesHandler )(cbDrawBarHandlesEvent&);typedef void (wxEvtHandler::*cbDrawRowHandlesHandler )(cbDrawRowHandlesEvent&);typedef void (wxEvtHandler::*cbDrawRowBkGroundHandler )(cbDrawRowBkGroundEvent&);typedef void (wxEvtHandler::*cbDrawPaneBkGroundHandler)(cbDrawPaneBkGroundEvent&);typedef void (wxEvtHandler::*cbStartBarDraggingHandler )(cbStartBarDraggingEvent&);typedef void (wxEvtHandler::*cbDrawHintRectHandler )(cbDrawHintRectEvent&);typedef void (wxEvtHandler::*cbStartDrawInAreaHandler )(cbStartDrawInAreaEvent&);typedef void (wxEvtHandler::*cbFinishDrawInAreaHandler)(cbFinishDrawInAreaEvent&);typedef void (wxEvtHandler::*cbCustomizeBarHandler )(cbCustomizeBarEvent&);typedef void (wxEvtHandler::*cbCustomizeLayoutHandler )(cbCustomizeLayoutEvent&);// Macros for creating event table entries for plugin-events.#define EVT_PL_LEFT_DOWN(func) wxEventTableEntry( cbEVT_PL_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDownHandler ) & func, (wxObject *) NULL ),#define EVT_PL_LEFT_UP(func) wxEventTableEntry( cbEVT_PL_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftUpHandler ) & func, (wxObject *) NULL ),#define EVT_PL_RIGHT_DOWN(func) wxEventTableEntry( cbEVT_PL_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightDownHandler ) & func, (wxObject *) NULL ),#define EVT_PL_RIGHT_UP(func) wxEventTableEntry( cbEVT_PL_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRightUpHandler ) & func, (wxObject *) NULL ),#define EVT_PL_MOTION(func) wxEventTableEntry( cbEVT_PL_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbMotionHandler ) & func, (wxObject *) NULL ),#define EVT_PL_LEFT_DCLICK(func) wxEventTableEntry( cbEVT_PL_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLeftDClickHandler ) & func, (wxObject *) NULL ),#define EVT_PL_LAYOUT_ROW(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowHandler ) & func, (wxObject *) NULL ),#define EVT_PL_RESIZE_ROW(func) wxEventTableEntry( cbEVT_PL_RESIZE_ROW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeRowHandler ) & func, (wxObject *) NULL ),#define EVT_PL_LAYOUT_ROWS(func) wxEventTableEntry( cbEVT_PL_LAYOUT_ROWS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbLayoutRowsHandler ) & func, (wxObject *) NULL ),#define EVT_PL_INSERT_BAR(func) wxEventTableEntry( cbEVT_PL_INSERT_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbInsertBarHandler ) & func, (wxObject *) NULL ),#define EVT_PL_RESIZE_BAR(func) wxEventTableEntry( cbEVT_PL_RESIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbResizeBarHandler ) & func, (wxObject *) NULL ),#define EVT_PL_REMOVE_BAR(func) wxEventTableEntry( cbEVT_PL_REMOVE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbRemoveBarHandler ) & func, (wxObject *) NULL ),#define EVT_PL_SIZE_BAR_WND(func) wxEventTableEntry( cbEVT_PL_SIZE_BAR_WND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbSizeBarWndHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_BAR_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarDecorHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_ROW_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowDecorHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_PANE_DECOR(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_DECOR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneDecorHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_BAR_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_BAR_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawBarHandlesHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_ROW_HANDLES(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_HANDLES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowHandlesHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_ROW_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_ROW_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawRowBkGroundHandler ) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_PANE_BKGROUND(func) wxEventTableEntry( cbEVT_PL_DRAW_PANE_BKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawPaneBkGroundHandler) & func, (wxObject *) NULL ),#define EVT_PL_START_BAR_DRAGGING(func) wxEventTableEntry( cbEVT_PL_START_BAR_DRAGGING, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartBarDraggingHandler) & func, (wxObject *) NULL ),#define EVT_PL_DRAW_HINT_RECT(func) wxEventTableEntry( cbEVT_PL_DRAW_HINT_RECT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbDrawHintRectHandler ) & func, (wxObject *) NULL ),#define EVT_PL_START_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_START_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbStartDrawInAreaHandler) & func, (wxObject *) NULL ),#define EVT_PL_FINISH_DRAW_IN_AREA(func) wxEventTableEntry( cbEVT_PL_FINISH_DRAW_IN_AREA, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbFinishDrawInAreaHandler) & func, (wxObject *) NULL ),#define EVT_PL_CUSTOMIZE_BAR(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_BAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeBarHandler) & func, (wxObject *) NULL ),#define EVT_PL_CUSTOMIZE_LAYOUT(func) wxEventTableEntry( cbEVT_PL_CUSTOMIZE_LAYOUT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (cbCustomizeLayoutHandler) & func, (wxObject *) NULL ),/*Abstract base class for all control-bar related plugins.Note: pointer positions of mouse events sent to pluginsare always in the pane's coordinates (the pane to whichthis plugin is hooked).*/class cbPluginBase : public wxEvtHandler{ DECLARE_ABSTRACT_CLASS( cbPluginBase )public: // Back-reference to the frame layout. wxFrameLayout* mpLayout; // Specifies panes for which this plugin receives events // (see pane masks definitions). int mPaneMask; // Is true when plugin is ready to handle events. bool mIsReady;public: // Default constructor. cbPluginBase() : mpLayout ( 0 ), mPaneMask( wxALL_PANES ), mIsReady ( false ) {} // Constructor taking layout panel and a mask. cbPluginBase( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ) : mpLayout ( pPanel ), mPaneMask( paneMask ), mIsReady ( false ) {} // Returns the pane mask. inline int GetPaneMask() { return mPaneMask; } // Destructor. Destroys the whole plugin chain of connected plugins. virtual ~cbPluginBase(); // Override this method to do plugin-specific initialization. // At this point plugin is already attached to the frame layout, // and pane masks are set. virtual void OnInitPlugin() { mIsReady = true; } // Returns true if the plugin is ready to receive events. bool IsReady() { return mIsReady; } // Overridden to determine whether the target pane specified in the // event matches the pane mask of this plugin (specific plugins // do not override this method). virtual bool ProcessEvent(wxEvent& event);};/*Class for mouse left down events.*/class cbLeftDownEvent : public cbPluginEvent{public: wxPoint mPos; // Constructor, taking mouse position and pane. cbLeftDownEvent( const wxPoint& pos, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_LEFT_DOWN, pPane ), mPos( pos ) {}};/*Class for mouse left up events.*/class cbLeftUpEvent : public cbPluginEvent{public: wxPoint mPos; // Constructor, taking mouse position and pane. cbLeftUpEvent( const wxPoint& pos, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_LEFT_UP, pPane ), mPos( pos ) {}};/*Class for mouse right down events.*/class cbRightDownEvent : public cbPluginEvent{public: wxPoint mPos; // Constructor, taking mouse position and pane. cbRightDownEvent( const wxPoint& pos, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_RIGHT_DOWN, pPane ), mPos( pos ) {}};/*Class for mouse right up events.*/class cbRightUpEvent : public cbPluginEvent{public: wxPoint mPos; // Constructor, taking mouse position and pane. cbRightUpEvent( const wxPoint& pos, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_RIGHT_UP, pPane ), mPos( pos ) {}};/*Class for mouse motion events.*/class cbMotionEvent : public cbPluginEvent{public: wxPoint mPos; // Constructor, taking mouse position and pane. cbMotionEvent( const wxPoint& pos, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_MOTION, pPane ), mPos( pos ) {}};/*Class for mouse left double click events.*/class cbLeftDClickEvent : public cbPluginEvent{public: wxPoint mPos; // Constructor, taking mouse position and pane. cbLeftDClickEvent( const wxPoint& pos, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_LEFT_DCLICK, pPane ), mPos( pos ) {}};/*Class for single row layout events.*/class cbLayoutRowEvent : public cbPluginEvent{public: cbRowInfo* mpRow; // Constructor, taking row information and pane. cbLayoutRowEvent( cbRowInfo* pRow, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_LAYOUT_ROW, pPane ), mpRow( pRow ) {}};/*Class for row resize events.*/class cbResizeRowEvent : public cbPluginEvent{public: cbRowInfo* mpRow; int mHandleOfs; bool mForUpperHandle; // Constructor, taking row information, two parameters of currently unknown use, and pane. cbResizeRowEvent( cbRowInfo* pRow, int handleOfs, bool forUpperHandle, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_RESIZE_ROW, pPane ), mpRow( pRow ), mHandleOfs( handleOfs ), mForUpperHandle( forUpperHandle ) {}};/*Class for multiple rows layout events.*/class cbLayoutRowsEvent : public cbPluginEvent{public: // Constructor, taking pane. cbLayoutRowsEvent( cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_LAYOUT_ROWS, pPane ) {}};/*Class for bar insertion events.*/class cbInsertBarEvent : public cbPluginEvent{public: cbBarInfo* mpBar; cbRowInfo* mpRow; // Constructor, taking bar information, row information, and pane. cbInsertBarEvent( cbBarInfo* pBar, cbRowInfo* pIntoRow, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_INSERT_BAR, pPane ), mpBar( pBar ), mpRow( pIntoRow ) {}};/*Class for bar resize events.*/class cbResizeBarEvent : public cbPluginEvent{public: cbBarInfo* mpBar; cbRowInfo* mpRow; // Constructor, taking bar information, row information, and pane. cbResizeBarEvent( cbBarInfo* pBar, cbRowInfo* pRow, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_RESIZE_BAR, pPane ), mpBar( pBar ), mpRow( pRow ) {}};/*Class for bar removal events.*/class cbRemoveBarEvent : public cbPluginEvent{public: cbBarInfo* mpBar; // Constructor, taking bar information and pane. cbRemoveBarEvent( cbBarInfo* pBar, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_REMOVE_BAR, pPane ), mpBar( pBar ) {}};/*Class for bar window resize events.*/class cbSizeBarWndEvent : public cbPluginEvent{public: cbBarInfo* mpBar; wxRect mBoundsInParent; // Constructor, taking bar information and pane. cbSizeBarWndEvent( cbBarInfo* pBar, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_SIZE_BAR_WND, pPane ), mpBar( pBar ), mBoundsInParent( pBar->mBoundsInParent ) {}};/*Class for bar decoration drawing events.*/class cbDrawBarDecorEvent : public cbPluginEvent{public: cbBarInfo* mpBar; wxDC* mpDc; wxRect mBoundsInParent; // Constructor, taking bar information, device context, and pane. cbDrawBarDecorEvent( cbBarInfo* pBar, wxDC& dc, cbDockPane* pPane ) : cbPluginEvent( cbEVT_PL_DRAW_BAR_DECOR, pPane ), mpBar( pBar ), mpDc( &dc ), mBoundsInParent( pBar->mBoundsInParent ) {}};/*Class for row decoration drawing events.*/class cbDrawRowDecorEvent : public cbPluginEvent{public: cbRowInf
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -