AGW Logo

agw_title RibbonPage

hierarchy Inheritance Diagram

Inheritance diagram for: RibbonPage

Inheritance diagram of RibbonPage


supclasses Known Superclasses


appearance Control Appearance


RibbonPage

RibbonPage


method_summary Methods Summary

__init__Default class constructor.
AdjustRectToIncludeScrollButtonsExpand a rectangle of the page to include external scroll buttons (if any).
CollapsePanels
CommonInit
DismissExpandedPanelDismiss the current externally expanded panel, if there is one.
DoGetBestSize
DoSetSize
ExpandPanels
GetDefaultBorder
GetIconGet the icon used for the page in the ribbon bar tab area (only displayed if the
GetMajorAxisGet the direction in which ribbon panels are stacked within the page.
GetMinSize
HideScrollButtons
Layout
OnEraseBackground
OnPaint
OnSize
RealizePerform a full re-layout of all panels on the page.
RemoveChild
ScrollLinesScroll the page by some amount up / down / left / right.
ScrollPixelsScroll the page by a set number of pixels up / down / left / right.
SetArtProviderSet the art provider to be used.
SetSizeWithScrollButtonAdjustmentSet the size of the page and the external scroll buttons (if any).
Show
ShowScrollButtons

API Class API

class RibbonPage(RibbonControl)[source]


__init__(parent, id=wx.ID_ANY, label="", icon=wx.NullBitmap, style=0)[source]

Default class constructor.

Parameters:
  • parent – Pointer to a parent window;
  • id – Window identifier. If wx.ID_ANY, will automatically create an identifier;
  • label – Label of the new button;
  • icon – the icon used for the page in the ribbon bar tab area;
  • style – Window style.


AdjustRectToIncludeScrollButtons(rect)[source]

Expand a rectangle of the page to include external scroll buttons (if any).

When no scroll buttons are shown, has no effect.

Parameters:rect – The rectangle to adjust. The width and height will not be reduced, and the x and y will not be increased.


CollapsePanels(direction, minimum_amount)[source]


CommonInit(label, icon)[source]


DismissExpandedPanel()[source]

Dismiss the current externally expanded panel, if there is one.

When a ribbon panel automatically minimises, it can be externally expanded into a floating window. When the user clicks a button in such a panel, the panel should generally re-minimise. Event handlers for buttons on ribbon panels should call this method to achieve this behaviour.

Returns:True if a panel was minimised, False otherwise.


DoGetBestSize()[source]


DoSetSize(x, y, width, height, sizeFlags=wx.SIZE_AUTO)[source]


ExpandPanels(direction, maximum_amount)[source]


GetDefaultBorder()[source]


GetIcon()[source]

Get the icon used for the page in the ribbon bar tab area (only displayed if the ribbon bar is actually showing icons).



GetMajorAxis()[source]

Get the direction in which ribbon panels are stacked within the page.

This is controlled by the style of the containing RibbonBar, meaning that all pages within a bar will have the same major axis. As well as being the direction in which panels are stacked, it is also the axis in which scrolling will occur (when required).

Returns:wx.HORIZONTAL or wx.VERTICAL (never wx.BOTH).


GetMinSize()[source]


HideScrollButtons()[source]


Layout()[source]


OnEraseBackground(event)[source]


OnPaint(event)[source]


OnSize(event)[source]


Realize()[source]

Perform a full re-layout of all panels on the page.

Should be called after panels are added to the page, or the sizing behaviour of a panel on the page changes (i.e. due to children being added to it). Usually called automatically when RibbonBar.Realize() is called. Will invoke RibbonPanel.Realize() for all child panels.

Reimplemented from RibbonControl.



RemoveChild(child)[source]


ScrollLines(lines)[source]

Scroll the page by some amount up / down / left / right.

When the page’s children are too big to fit in the onscreen area given to the page, scroll buttons will appear, and the page can be programatically scrolled. Positive values of will scroll right or down, while negative values will scroll up or left (depending on the direction in which panels are stacked). A line is equivalent to a constant number of pixels.

Reimplemented from wx.Window.

Parameters:lines – MISSING DESCRIPTION.
Returns:True if the page scrolled at least one pixel in the given direction, False if it did not scroll.


ScrollPixels(pixels)[source]

Scroll the page by a set number of pixels up / down / left / right.

When the page’s children are too big to fit in the onscreen area given to the page, scroll buttons will appear, and the page can be programatically scrolled. Positive values of will scroll right or down, while negative values will scroll up or left (depending on the direction in which panels are stacked).

Parameters:pixels – MISSING DESCRIPTION.
Returns:True if the page scrolled at least one pixel in the given direction, False if it did not scroll.


SetArtProvider(art)[source]

Set the art provider to be used.

Normally called automatically by RibbonBar when the page is created, or the art provider changed on the bar. The new art provider will be propagated to the children of the page.

Reimplemented from RibbonControl.

Parameters:art – MISSING DESCRIPTION.


SetSizeWithScrollButtonAdjustment(x, y, width, height)[source]

Set the size of the page and the external scroll buttons (if any).

When a page is too small to display all of its children, scroll buttons will appear (and if the page is sized up enough, they will disappear again). Slightly counter-intuively, these buttons are created as siblings of the page rather than children of the page (to achieve correct cropping and paint ordering of the children and the buttons).

When there are no scroll buttons, this function behaves the same as SetSize, however when there are scroll buttons, it positions them at the edges of the given area, and then calls SetSize with the remaining area. This is provided as a separate function to SetSize rather than within the implementation of SetSize, as iteracting algorithms may not expect SetSize to also set the size of siblings.

Parameters:
  • x – MISSING DESCRIPTION;
  • y – MISSING DESCRIPTION;
  • width – MISSING DESCRIPTION;
  • height – MISSING DESCRIPTION.


Show(show=True)[source]


ShowScrollButtons()[source]
Tree

Table Of Contents

Previous topic

ribbon.page

Next topic

RibbonPageScrollButton