Top-level control in a ribbon user interface.
__init__ | Default constructor. |
AddPage | Adds a page to the RibbonBar. |
CommonInit | Common initialization procedures. |
DismissExpandedPanel | Dismiss the expanded panel of the currently active page. |
DoEraseBackground | Does the initial painting of stuff from the OnPaint event. |
DoGetBestSize | Gets the size which best suits the window: for a control, it would be the |
DoMouseButtonCommon | Common methods for all the mouse move/click events. |
GetActivePage | Get the index of the active page. |
GetAGWWindowStyleFlag | Returns the RibbonBar window style flag. |
GetDefaultBorder | Returns the default border style for RibbonBar. |
GetPage | Get a page by index. |
HasMultiplePages | This method should be overridden to return true if this window has multiple pages. |
HitTestTabs | Hit test method for RibbonBar, testing where the given (in client coordinates) |
OnEraseBackground | Handles the EVT_ERASE_BACKGROUND event for RibbonBar. |
OnMouseDoubleClick | Handles the EVT_LEFT_DCLICK event for RibbonBar. |
OnMouseLeave | Handles the EVT_LEAVE_WINDOW event for RibbonBar. |
OnMouseLeftDown | Handles the EVT_LEFT_DOWN event for RibbonBar. |
OnMouseLeftUp | Handles the EVT_LEFT_UP event for RibbonBar. |
OnMouseMiddleDown | Handles the EVT_MIDDLE_DOWN event for RibbonBar. |
OnMouseMiddleUp | Handles the EVT_MIDDLE_UP event for RibbonBar. |
OnMouseMove | Handles the EVT_MOTION event for RibbonBar. |
OnMouseRightDown | Handles the EVT_RIGHT_DOWN event for RibbonBar. |
OnMouseRightUp | Handles the EVT_RIGHT_UP event for RibbonBar. |
OnPaint | Handles the EVT_PAINT event for RibbonBar. |
OnSize | Handles the EVT_SIZE event for RibbonBar. |
OrderPageTabInfoBySmallWidthAsc | |
Realize | Perform initial layout and size calculations of the bar and its children. |
RecalculateMinSize | Recalculates the RibbonBar minimum size. |
RecalculateTabSizes | Recalculates the RibbonBar tab sizes. |
RefreshTabBar | Repaints the tab area in RibbonBar. |
RepositionPage | |
ScrollTabBar | Scrolls the tab area left/right/up/down by the specified amount. |
SetActivePage | See comments on SetActivePageByIndex and SetActivePageByPage. |
SetActivePageByIndex | Set the active page by index, without triggering any events. |
SetActivePageByPage | Set the active page, without triggering any events. |
SetAGWWindowStyleFlag | Sets the window style for RibbonBar. |
SetArtProvider | Set the art provider to be used be the ribbon bar. |
SetTabCtrlMargins | Set the margin widths (in pixels) on the left and right sides of the tab bar |
ShowPanels | Shows or hides the panels inside RibbonBar. |
Top-level control in a ribbon user interface.
Default constructor.
Parameters: |
|
---|
Adds a page to the RibbonBar.
Parameters: | page – an instance of RibbonPage. |
---|
Common initialization procedures.
Parameters: | agwStyle (integer) – the AGW-specific window style. |
---|
See also
SetAGWWindowStyleFlag for a list of valid window styles.
Dismiss the expanded panel of the currently active page.
Calls and returns the value from RibbonPage.DismissExpandedPanel() for the currently active page, or False if there is no active page.
Does the initial painting of stuff from the OnPaint event.
Parameters: | dc – an instance of DC. |
---|
Gets the size which best suits the window: for a control, it would be the minimal size which doesn’t truncate the control, for a panel - the same size as it would have after a call to Fit().
Returns: | An instance of Size. |
---|
Note
Overridden from PyControl.
Common methods for all the mouse move/click events.
Parameters: |
|
---|
Get the index of the active page.
In the rare case of no page being active, -1 is returned.
Returns the RibbonBar window style flag.
See also
SetAGWWindowStyleFlag for a list of valid window styles.
Get a page by index.
None will be returned if the given index is out of range.
Parameters: | n (integer) – the zero-based index indicating the page position. |
---|
This method should be overridden to return true if this window has multiple pages.
All standard class with multiple pages such as Notebook, Listbook and Treebook already override it to return true and user-defined classes with similar behaviour should also do so, to allow the library to handle such windows appropriately.
Hit test method for RibbonBar, testing where the given (in client coordinates) point lies.
Parameters: | position – an instance of Point in client coordinates. |
---|---|
Returns: | a tuple containing the tab index and the RibbonPage if the HitTestTabs successfully found such combination, or a tuple (-1, None) if no tab has been hit. |
Handles the EVT_ERASE_BACKGROUND event for RibbonBar.
Parameters: | event – a EraseEvent event to be processed. |
---|
Handles the EVT_LEFT_DCLICK event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_LEAVE_WINDOW event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_LEFT_DOWN event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_LEFT_UP event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_MIDDLE_DOWN event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_MIDDLE_UP event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_MOTION event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_RIGHT_DOWN event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_RIGHT_UP event for RibbonBar.
Parameters: | event – a MouseEvent event to be processed. |
---|
Handles the EVT_PAINT event for RibbonBar.
Parameters: | event – a PaintEvent event to be processed. |
---|
Handles the EVT_SIZE event for RibbonBar.
Parameters: | event – a SizeEvent event to be processed. |
---|
Perform initial layout and size calculations of the bar and its children.
This must be called after all of the bar’s children have been created (and their children created, etc.) - if it is not, then windows may not be laid out or sized correctly. Also calls RibbonPage.Realize() on each child page.
Note
Reimplemented from RibbonControl.
Scrolls the tab area left/right/up/down by the specified amount.
Parameters: | amount (integer) – the amount by which the tab area is scrolled, in pixels. |
---|
See comments on SetActivePageByIndex and SetActivePageByPage.
Set the active page by index, without triggering any events.
Parameters: | page (integer) – The zero-based index of the page to activate. |
---|---|
Returns: | True if the specified page is now active, False if it could not be activated (for example because the page index is invalid). |
Set the active page, without triggering any events.
Parameters: | page – the page to activate, an instance of RibbonPage. |
---|---|
Returns: | True if the specified page is now active, False if it could not be activated (for example because the given page is not a child of the ribbon bar). |
Sets the window style for RibbonBar.
Parameters: | agwStyle (integer) – can be a combination of the following bits:
|
---|
Note
Please note that some styles cannot be changed after the window creation and that Refresh() might need to be be called after changing the others for the change to take place immediately.
Set the art provider to be used be the ribbon bar.
Also sets the art provider on all current RibbonPage children, and any RibbonPage children added in the future.
Note that unlike most other ribbon controls, the ribbon bar creates a default art provider when initialised, so an explicit call to SetArtProvider is not required if the default art provider is sufficient. Also unlike other ribbon controls, the ribbon bar takes ownership of the given pointer, and will delete it when the art provider is changed or the bar is destroyed.
If this behaviour is not desired, then clone the art provider before setting it.
Parameters: | art – an art provider. |
---|
Note
Reimplemented from RibbonControl.
Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar.
These margins will be painted with the tab background, but tabs and scroll buttons will never be painted in the margins. The left margin could be used for rendering something equivalent to the “Office Button”, though this is not currently implemented. The right margin could be used for rendering a help button, and/or MDI buttons, but again, this is not currently implemented.
Parameters: |
|
---|