AGW Logo

agw_title RibbonBar

hierarchy Inheritance Diagram

Inheritance diagram for: RibbonBar

Inheritance diagram of RibbonBar


supclasses Known Superclasses


appearance Control Appearance


RibbonBar

RibbonBar


method_summary Methods Summary

__init__Default constructor.
AddPage
CommonInit
DismissExpandedPanelDismiss the expanded panel of the currently active page.
DoEraseBackground
DoGetBestSize
DoMouseButtonCommon
GetAGWWindowStyleFlagReturns the RibbonBar window style flag.
GetActivePageGet the index of the active page.
GetDefaultBorder
GetPageGet a page by index.
HasMultiplePages
HitTestTabs
OnEraseBackground
OnMouseDoubleClick
OnMouseLeave
OnMouseLeftDown
OnMouseLeftUp
OnMouseMiddleDown
OnMouseMiddleUp
OnMouseMove
OnMouseRightDown
OnMouseRightUp
OnPaint
OnSize
OrderPageTabInfoBySmallWidthAsc
RealizePerform initial layout and size calculations of the bar and its children.
RecalculateMinSize
RecalculateTabSizes
RefreshTabBar
RepositionPage
ScrollTabBar
SetAGWWindowStyleFlagSets the window style for RibbonBar.
SetActivePageSee comments on SetActivePageByIndex and SetActivePageByPage.
SetActivePageByIndexSet the active page by index, without triggering any events.
SetActivePageByPageSet the active page, without triggering any events.
SetArtProviderSet the art provider to be used be the ribbon bar.
SetTabCtrlMarginsSet the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar.
ShowPanelsShows or hides the panels inside RibbonBar.

API Class API

class RibbonBar(RibbonControl)[source]


__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, agwStyle=RIBBON_BAR_DEFAULT_STYLE, validator=wx.DefaultValidator, name="RibbonBar")[source]

Default constructor.

Parameters:
  • parent – Pointer to a parent window;
  • id – Window identifier. If wx.ID_ANY, will automatically create an identifier;
  • pos – Window position. wx.DefaultPosition indicates that wxPython should generate a default position for the window;
  • size – Window size. wx.DefaultSize indicates that wxPython should generate a default size for the window. If no suitable size can be found, the window will be sized to 20x20 pixels so that the window is visible but obviously not correctly sized;
  • agwStyle – the AGW-specific window style. This can be a combination of the following bits:


    Window Styles Hex Value Description
    RIBBON_BAR_DEFAULT_STYLE 0x9 Defined as RIBBON_BAR_FLOW_HORIZONTAL | RIBBON_BAR_SHOW_PAGE_LABELS | RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS
    RIBBON_BAR_FOLDBAR_STYLE 0x1e Defined as RIBBON_BAR_FLOW_VERTICAL | RIBBON_BAR_SHOW_PAGE_ICONS | RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS | RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS
    RIBBON_BAR_SHOW_PAGE_LABELS 0x1 Causes labels to be shown on the tabs in the ribbon bar.
    RIBBON_BAR_SHOW_PAGE_ICONS 0x2 Causes icons to be shown on the tabs in the ribbon bar.
    RIBBON_BAR_FLOW_HORIZONTAL 0x0 Causes panels within pages to stack horizontally.
    RIBBON_BAR_FLOW_VERTICAL 0x4 Causes panels within pages to stack vertically.
    RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS 0x8 Causes extension buttons to be shown on panels (where the panel has such a button).
    RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS 0x10 Causes minimise buttons to be shown on panels (where the panel has such a button).
  • validator – the window validator;
  • name – the window name.


AddPage(page)[source]


CommonInit(agwStyle)[source]


DismissExpandedPanel()[source]

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.



DoEraseBackground(dc)[source]


DoGetBestSize()[source]


DoMouseButtonCommon(event, tab_event_type)[source]


GetAGWWindowStyleFlag()[source]

Returns the RibbonBar window style flag.

See also

SetAGWWindowStyleFlag for a list of valid window styles.



GetActivePage()[source]

Get the index of the active page.

In the rare case of no page being active, -1 is returned.



GetDefaultBorder()[source]


GetPage(n)[source]

Get a page by index.

None will be returned if the given index is out of range.

Parameters:n – MISSING DESCRIPTION.


HasMultiplePages()[source]


HitTestTabs(position)[source]


OnEraseBackground(event)[source]


OnMouseDoubleClick(event)[source]


OnMouseLeave(event)[source]


OnMouseLeftDown(event)[source]


OnMouseLeftUp(event)[source]


OnMouseMiddleDown(event)[source]


OnMouseMiddleUp(event)[source]


OnMouseMove(event)[source]


OnMouseRightDown(event)[source]


OnMouseRightUp(event)[source]


OnPaint(event)[source]


OnSize(event)[source]


OrderPageTabInfoBySmallWidthAsc(first, second)[source]


Realize()[source]

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.

Reimplemented from RibbonControl.



RecalculateMinSize()[source]


RecalculateTabSizes()[source]


RefreshTabBar()[source]


RepositionPage(page)[source]


ScrollTabBar(amount)[source]


SetAGWWindowStyleFlag(agwStyle)[source]

Sets the window style for RibbonBar.

Parameters:agwStyle – can be a combination of the following bits:


Window Styles Hex Value Description
RIBBON_BAR_DEFAULT_STYLE 0x9 Defined as RIBBON_BAR_FLOW_HORIZONTAL | RIBBON_BAR_SHOW_PAGE_LABELS | RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS
RIBBON_BAR_FOLDBAR_STYLE 0x1e Defined as RIBBON_BAR_FLOW_VERTICAL | RIBBON_BAR_SHOW_PAGE_ICONS | RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS | RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS
RIBBON_BAR_SHOW_PAGE_LABELS 0x1 Causes labels to be shown on the tabs in the ribbon bar.
RIBBON_BAR_SHOW_PAGE_ICONS 0x2 Causes icons to be shown on the tabs in the ribbon bar.
RIBBON_BAR_FLOW_HORIZONTAL 0x0 Causes panels within pages to stack horizontally.
RIBBON_BAR_FLOW_VERTICAL 0x4 Causes panels within pages to stack vertically.
RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS 0x8 Causes extension buttons to be shown on panels (where the panel has such a button).
RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS 0x10 Causes minimise buttons to be shown on panels (where the panel has such a button).

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.



SetActivePage(page)[source]

See comments on SetActivePageByIndex and SetActivePageByPage.



SetActivePageByIndex(page)[source]

Set the active page by index, without triggering any events.

Parameters:page – 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).


SetActivePageByPage(page)[source]

Set the active page, without triggering any events.

Parameters:page – The page to activate.
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).


SetArtProvider(art)[source]

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.

Reimplemented from RibbonControl.

Parameters:art – MISSING DESCRIPTION.


SetTabCtrlMargins(left, right)[source]

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:
  • left – MISSING DESCRIPTION;
  • right – MISSING DESCRIPTION.


ShowPanels(show=True)[source]

Shows or hides the panels inside RibbonBar.

Parameters:showTrue to show the panels, False to hide them.
Tree

Table Of Contents

Previous topic

ribbon.bar

Next topic

RibbonBarEvent