📄 controlbar.h
字号:
public: /* protected really (accessed only by plugins) */ // Generates a cbDrawBarDecorEvent and sends it to the layout to paint the bar decorations. // Internal function called by plugins. virtual void PaintBarDecorations( cbBarInfo* pBar, wxDC& dc ); // Generates a cbDrawBarHandlesEvent and sends it to the layout to paint the bar handles. // Internal function called by plugins. virtual void PaintBarHandles( cbBarInfo* pBar, wxDC& dc ); // Calls PaintBarDecorations and PaintBarHandles. // Internal function called by plugins. virtual void PaintBar( cbBarInfo* pBar, wxDC& dc ); // Generates cbDrawRowHandlesEvent and cbDrawRowDecorEvent and sends them to the layout. // Internal function called by plugins. virtual void PaintRowHandles( cbRowInfo* pRow, wxDC& dc ); // Generates cbDrawRowBkGroundEvent and sends it to the layout. // Internal function called by plugins. virtual void PaintRowBackground ( cbRowInfo* pRow, wxDC& dc ); // Calls PaintBarDecorations for each row. // Internal function called by plugins. virtual void PaintRowDecorations( cbRowInfo* pRow, wxDC& dc ); // Calls PaintRowBackground, PaintRowDecorations, PaintRowHandles. // Internal function called by plugins. virtual void PaintRow( cbRowInfo* pRow, wxDC& dc ); // Generates cbDrawPaneBkGroundEvent and sends it to the layout. // Internal function called by plugins. virtual void PaintPaneBackground( wxDC& dc ); // Generates cbDrawPaneDecorEvent and sends it to the layout. // Internal function called by plugins. virtual void PaintPaneDecorations( wxDC& dc ); // Paints the pane background, the row background and decorations, // and finally the pane decorations. // Internal function called by plugins. virtual void PaintPane( wxDC& dc ); // Generates a cbSizeBarWndEvent and sends it to the layout. // Internal function called by plugins. virtual void SizeBar( cbBarInfo* pBar ); // Calls SizeBar for each bar in the row. // Internal function called by plugins. virtual void SizeRowObjects( cbRowInfo* pRow ); // Calls SizeRowObjects for each row. // Internal function called by plugins. virtual void SizePaneObjects(); // Generates cbStartDrawInAreaEvent and sends it to the layout. // Internal function called by plugins. virtual wxDC* StartDrawInArea ( const wxRect& area ); // Generates cbFinishDrawInAreaEvent and sends it to the layout. // Internal function called by plugins. virtual void FinishDrawInArea( const wxRect& area );public: /* public members */ // Default constructor. cbDockPane(void); // Constructor, taking alignment and layout panel. cbDockPane( int alignment, wxFrameLayout* pPanel ); // Sets pane's margins in frame's coordinate orientations. void SetMargins( int top, int bottom, int left, int right ); // Destructor. virtual ~cbDockPane(); // Removes the bar from this pane. Does not destroy the bar. virtual void RemoveBar( cbBarInfo* pBar ); // Inserts the bar into this pane. rect is given in the parent frame's coordinates. virtual void InsertBar( cbBarInfo* pBar, const wxRect& rect ); // Inserts the bar into the given row, with dimensions and position // stored in pBarInfo->mBounds. Returns the node of inserted bar. virtual void InsertBar( cbBarInfo* pBar, cbRowInfo* pIntoRow ); // Inserts bar and sets its position according to the preferred settings // given in pBarInfo. virtual void InsertBar( cbBarInfo* pBarInfo ); // Removes the row from this pane. Does not destroy the row object. virtual void RemoveRow( cbRowInfo* pRow ); // Inserts a row. Does not refresh the inserted row immediately. // If pBeforeRowNode is NULL, the row is appended to the end of pane's row list. virtual void InsertRow( cbRowInfo* pRow, cbRowInfo* pBeforeRow ); // Sets pane's width in the pane's coordinates (including margins). void SetPaneWidth(int width); // Set the position and dimensions of the pane in the parent frame's coordinates. void SetBoundsInParent( const wxRect& rect ); // Returns the bounds of the pane, in parent coordinates. inline wxRect& GetRealRect() { return mBoundsInParent; } // Returns an array of rows. Used by updates-managers. inline RowArrayT& GetRowList() { return mRows; } // Returns the first row. inline cbRowInfo* GetFirstRow() { return mRows.GetCount() ? mRows[0] : NULL; } // Returns true if the given bar is present in this pane. bool BarPresent( cbBarInfo* pBar ); // Returns the height in the pane's coordinates. int GetPaneHeight(); // Returns the alignment for this pane. The value is one of // FL_ALIGN_TOP, FL_ALIGN_BOTTOM, FL_ALIGN_LEFT, FL_ALIGN_RIGHT. int GetAlignment(); // Returns true if the given mask matches the pane's mask. bool MatchesMask( int paneMask ); // Returns true if the pane is aligned to the top or bottom. inline bool IsHorizontal() { return (mAlignment == FL_ALIGN_TOP || mAlignment == FL_ALIGN_BOTTOM ); } // Generates events to perform layout calculations. virtual void RecalcLayout(); // Returns wxCBAR_DOCKED_HORIZONTALLY if the alignment is top or bottom, // or wxCBAR_DOCKED_VERTICALLY otherwise. virtual int GetDockingState(); // Returns the result of hit-testing items in the pane. // See CB_HITTEST_RESULT enumerated type. // pos is the position in this pane's coordinates. virtual int HitTestPaneItems( const wxPoint& pos, cbRowInfo** ppRow, cbBarInfo** ppBar ); // Returns the bar's resize range. void GetBarResizeRange( cbBarInfo* pBar, int* from, int *till, bool forLeftHandle ); // Returns the row's resize range. void GetRowResizeRange( cbRowInfo* pRow, int* from, int* till, bool forUpperHandle ); // Finds the bar information by corresponding window. cbBarInfo* GetBarInfoByWindow( wxWindow* pBarWnd );public: /* protected really (accessed only by plugins) */ // Row/bar resizing related helper-method. void DrawVertHandle ( wxDC& dc, int x, int y, int height ); // Row/bar resizing related helper-method. void DrawHorizHandle( wxDC& dc, int x, int y, int width ); // Row/bar resizing related helper-method. void ResizeRow( cbRowInfo* pRow, int ofs, bool forUpperHandle ); // Row/bar resizing related helper-method. void ResizeBar( cbBarInfo* pBar, int ofs, bool forLeftHandle ); // Returns row shape data. // cbBarShapeData objects will be added to the given pLst. // cbBarShapeData is used for storing the original bar's positions in the row, // when the 'non-destructive-friction' option is turned on. void GetRowShapeData( cbRowInfo* pRow, wxList* pLst ); // Sets the shape data for the given row, using the data provided in pLst. // cbBarShapeData is used for storing the original bar's positions in the row, // when the 'non-destructive-friction' option is turned on. void SetRowShapeData( cbRowInfo* pRowNode, wxList* pLst );};/*This class declares an abstract interface for optimized logic that should refreshareas of frame layout that actually need to be updated. This should be extended in futureto implement a custom updating strategy.*/class WXDLLIMPEXP_FL cbUpdatesManagerBase : public wxObject{ DECLARE_ABSTRACT_CLASS( cbUpdatesManagerBase )public: /* protected really, accessed by serializer (if any) */ wxFrameLayout* mpLayout;public: // Default constructor cbUpdatesManagerBase(void) : mpLayout( 0 ) {} // Constructor taking layout panel. cbUpdatesManagerBase( wxFrameLayout* pPanel ) : mpLayout( pPanel ) {} // Destructor. virtual ~cbUpdatesManagerBase() {} // Sets the associated layout. void SetLayout( wxFrameLayout* pLayout ) { mpLayout = pLayout; } // This function receives a notification from the frame layout (in the order in which // they would usually be invoked). Custom updates-managers may utilize // these notifications to implement a more fine-grained updating strategy. virtual void OnStartChanges() = 0; // This function receives a notification from the frame layout (in the order in which // they would usually be invoked). Custom updates-managers may utilize // these notifications to implement a more fine-grained updating strategy. virtual void OnRowWillChange( cbRowInfo* WXUNUSED(pRow), cbDockPane* WXUNUSED(pInPane) ) {} // This function receives a notification from the frame layout (in the order in which // they would usually be invoked). Custom updates-managers may utilize // these notifications to implement a more fine-grained updating strategy. virtual void OnBarWillChange( cbBarInfo* WXUNUSED(pBar), cbRowInfo* WXUNUSED(pInRow), cbDockPane* WXUNUSED(pInPane) ) {} // This function receives a notification from the frame layout (in the order in which // they would usually be invoked). Custom updates-managers may utilize // these notifications to implement a more fine-grained updating strategy. virtual void OnPaneMarginsWillChange( cbDockPane* WXUNUSED(pPane) ) {} // This function receives a notification from the frame layout (in the order in which // they would usually be invoked). Custom updates-managers may utilize // these notifications to implement a more fine-grained updating strategy. virtual void OnPaneWillChange( cbDockPane* WXUNUSED(pPane) ) {} // This function receives a notification from the frame layout (in the order in which // they would usually be invoked). Custom updates-managers may utilize // these notifications to implement a more fine-grained updating strategy. virtual void OnFinishChanges() {} // Refreshes parts of the frame layout that need an update. virtual void UpdateNow() = 0;};/*Base class for all control-bar plugin events.This is not a dynamically-creatable class.*/class cbPluginEvent : public wxEvent{public: // NULL if event is not addressed to any specific pane. cbDockPane* mpPane; // Not used, but required. virtual wxEvent* Clone() const { return NULL; } // Constructor, taking event type and pane. cbPluginEvent( wxEventType eventType, cbDockPane* pPane ) : mpPane( pPane ) { m_eventType = eventType; }};// event types handled by pluginsextern WXDLLIMPEXP_FL wxEventType cbEVT_PL_LEFT_DOWN;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_LEFT_UP;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_RIGHT_DOWN;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_RIGHT_UP;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_MOTION;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_LEFT_DCLICK;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_LAYOUT_ROW;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_RESIZE_ROW;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_LAYOUT_ROWS;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_INSERT_BAR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_RESIZE_BAR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_REMOVE_BAR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_SIZE_BAR_WND;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_BAR_DECOR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_ROW_DECOR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_PANE_DECOR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_BAR_HANDLES;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_ROW_HANDLES;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_ROW_BKGROUND;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_PANE_BKGROUND;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_START_BAR_DRAGGING;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_DRAW_HINT_RECT;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_START_DRAW_IN_AREA;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_FINISH_DRAW_IN_AREA;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_CUSTOMIZE_BAR;extern WXDLLIMPEXP_FL wxEventType cbEVT_PL_CUSTOMIZE_LAYOUT;extern WXDLLIMPEXP_FL wxEventType wxCUSTOM_CB_PLUGIN_EVENTS_START_AT;// Forward declarations, separated by categories.class cbLeftDownEvent;class cbLeftUpEvent;class cbRightDownEvent;class cbRightUpEvent;class cbMotionEvent;class cbLeftDClickEvent;class cbLayoutRowEvent;class cbResizeRowEvent;class cbLayoutRowsEvent;class cbInsertBarEvent;class cbResizeBarEvent;class cbRemoveBarEvent;class cbSizeBarWndEvent;class cbDrawBarDecorEvent;class cbDrawRowDecorEvent;class cbDrawPaneDecorEvent;class cbDrawBarHandlesEvent;class cbDrawRowHandlesEvent;class cbDrawRowBkGroundEvent;class cbDrawPaneBkGroundEvent;class cbStartBarDraggingEvent;class cbDrawHintRectEvent;class cbStartDrawInAreaEvent;class cbFinishDrawInAreaEvent;class cbCustomizeBarEvent;class cbCustomizeLayoutEvent;// Definitions for for handler-methods.typedef void (wxEvtHandler::*cbLeftDownHandler )(cbLeftDownEvent&);typedef void (wxEvtHandler::*cbLeftUpHandler )(cbLeftUpEvent&);typedef void (wxEvtHandler::*cbRightDownHandler )(cbRightDownEvent&);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -