phoenix_title wx.ribbon.RibbonPanel

Serves as a container for a group of (ribbon) controls.

A wx.ribbon.RibbonPage will typically have panels for children, with the controls for that page placed on the panels.

A panel adds a border and label to a group of controls, and can be minimised (either automatically to conserve space, or manually by the user).

Non ribbon controls can be placed on a panel using Sizers to manage layout. Panel size is governed by the sizer’s minimum calculated size and the parent wx.ribbon.RibbonPage’s dimensions. For functional and aesthetic reasons it is recommended that ribbon and non ribbon controls are not mixed in one panel.

^^

styles Window Styles

This class supports the following styles:

  • wx.ribbon.RIBBON_PANEL_DEFAULT_STYLE: Defined as no other flags set.

  • wx.ribbon.RIBBON_PANEL_NO_AUTO_MINIMISE: Prevents the panel from automatically minimising to conserve screen space.

  • wx.ribbon.RIBBON_PANEL_EXT_BUTTON: Causes an extension button to be shown in the panel’s chrome (if the bar in which it is contained has wx.ribbon.RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS set). The behaviour of this button is application controlled, but typically will show an extended drop-down menu relating to the panel.

  • wx.ribbon.RIBBON_PANEL_MINIMISE_BUTTON: Causes a (de)minimise button to be shown in the panel’s chrome (if the bar in which it is contained has the wx.ribbon.RIBBON_BAR_SHOW_PANEL_MINIMISE_BUTTONS style set). This flag is typically combined with wx.ribbon.RIBBON_PANEL_NO_AUTO_MINIMISE to make a panel which the user always has manual control over when it minimises.

  • wx.ribbon.RIBBON_PANEL_STRETCH: Stretches a single panel to fit the parent page.

  • wx.ribbon.RIBBON_PANEL_FLEXIBLE: Allows the panel to size in both directions; currently only useful when a single wx.ribbon.RibbonToolBar is the child of the panel, particularly in vertical orientation where the number of rows is dependent on the amount of horizontal space available. Set the minimum and maximum toolbar rows to take full advantage of this wrapping behaviour. ^^

^^

events Events Emitted by this Class

Handlers bound for the following event types will receive a wx.ribbon.RibbonPanelEvent parameter.

  • EVT_RIBBONPANEL_EXTBUTTON_ACTIVATED: Triggered when the user activate the panel extension button. ^^


class_hierarchy Class Hierarchy

Inheritance diagram for class RibbonPanel:

method_summary Methods Summary

__init__

Default constructor.

CanAutoMinimise

Query if the panel can automatically minimise itself at small sizes.

Create

Create a ribbon panel in two-step ribbon panel construction.

GetClassDefaultAttributes

GetExpandedDummy

Get the dummy panel of an expanded panel.

GetExpandedPanel

Get the expanded panel of a dummy panel.

GetMinimisedIcon

Get the bitmap to be used in place of the panel children when it is minimised.

HasExtButton

Test if the panel has an extension button.

HideExpanded

Hide the panel’s external expansion.

IsExtButtonHovered

Query if the mouse is currently hovered over the extension button.

IsHovered

Query is the mouse is currently hovered over the panel.

IsMinimised

Query if the panel is currently minimised.

Realize

Realize all children of the panel.

SetArtProvider

Set the art provider to be used.

ShowExpanded

Show the panel externally expanded.


api Class API

class wx.ribbon.RibbonPanel(RibbonControl)

Possible constructors:

RibbonPanel()

RibbonPanel(parent, id=ID_ANY, label="", minimised_icon=NullBitmap,
            pos=DefaultPosition, size=DefaultSize, style=RIBBON_PANEL_DEFAULT_STYLE)

Serves as a container for a group of (ribbon) controls.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__init__ (self)

Default constructor.

With this constructor, Create should be called in order to create the ribbon panel.



__init__ (self, parent, id=ID_ANY, label=””, minimised_icon=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=RIBBON_PANEL_DEFAULT_STYLE)

Constructs a ribbon panel.

Parameters
  • parent (wx.Window) – Pointer to a parent window, which is typically a wx.ribbon.RibbonPage, though it can be any window.

  • id (wx.WindowID) – Window identifier.

  • label (string) – Label to be used in the wx.ribbon.RibbonPanel’s chrome.

  • minimised_icon (wx.Bitmap) – Icon to be used in place of the panel’s children when the panel is minimised.

  • pos (wx.Point) – The initial position of the panel. Not relevant when the parent is a ribbon page, as the position and size of the panel will be dictated by the page.

  • size (wx.Size) – The initial size of the panel. Not relevant when the parent is a ribbon page, as the position and size of the panel will be dictated by the page.

  • style (long) – Style flags for the panel.





CanAutoMinimise(self)

Query if the panel can automatically minimise itself at small sizes.

Return type

bool



Create(self, parent, id=ID_ANY, label="", icon=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=RIBBON_PANEL_DEFAULT_STYLE)

Create a ribbon panel in two-step ribbon panel construction.

Should only be called when the default constructor is used, and arguments have the same meaning as in the full constructor.

Parameters
Return type

bool



static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)
Parameters

variant (WindowVariant) –

Return type

VisualAttributes



GetExpandedDummy(self)

Get the dummy panel of an expanded panel.

Note that this should be called on an expanded panel to get the dummy associated with it - it will return None when called on the dummy itself.

Return type

wx.ribbon.RibbonPanel

See also

ShowExpanded

See also

GetExpandedPanel



GetExpandedPanel(self)

Get the expanded panel of a dummy panel.

Note that this should be called on a dummy panel to get the expanded panel associated with it - it will return None when called on the expanded panel itself.

Return type

wx.ribbon.RibbonPanel

See also

ShowExpanded

See also

GetExpandedDummy



GetMinimisedIcon(self)

Get the bitmap to be used in place of the panel children when it is minimised.

Return type

Bitmap



HasExtButton(self)

Test if the panel has an extension button.

Such button is shown in the top right corner of the panel if RIBBON_PANEL_EXT_BUTTON style is used for it.

Return type

bool

Returns

True if the panel and its wx.ribbon.RibbonBar allow it in their styles.

New in version 2.9.4.



HideExpanded(self)

Hide the panel’s external expansion.

Return type

bool

Returns

True if the panel was un-expanded, False if it was not (normally due to it not being expanded in the first place).

See also

HideExpanded

See also

GetExpandedPanel



IsExtButtonHovered(self)

Query if the mouse is currently hovered over the extension button.

Extension button is only shown for panels with RIBBON_PANEL_EXT_BUTTON style.

Return type

bool

New in version 2.9.4.



IsHovered(self)

Query is the mouse is currently hovered over the panel.

Return type

bool

Returns

True if the cursor is within the bounds of the panel (i.e. hovered over the panel or one of its children), False otherwise.



IsMinimised(self, *args, **kw)

overload Overloaded Implementations:



IsMinimised (self)

Query if the panel is currently minimised.

Return type

bool



IsMinimised (self, at_size)

Query if the panel would be minimised at a given size.

Parameters

at_size (wx.Size) –

Return type

bool





Realize(self)

Realize all children of the panel.

Return type

bool



SetArtProvider(self, art)

Set the art provider to be used.

Normally called automatically by wx.ribbon.RibbonPage when the panel is created, or the art provider changed on the page.

The new art provider will be propagated to the children of the panel.

Parameters

art (wx.ribbon.RibbonArtProvider) –



ShowExpanded(self)

Show the panel externally expanded.

When a panel is minimised, it can be shown full-size in a pop-out window, which is referred to as being (externally) expanded. Note that when a panel is expanded, there exist two panels - the original panel (which is referred to as the dummy panel) and the expanded panel. The original is termed a dummy as it sits in the ribbon bar doing nothing, while the expanded panel holds the panel children.

Return type

bool

Returns

True if the panel was expanded, False if it was not (possibly due to it not being minimised, or already being expanded).

See also

HideExpanded

See also

GetExpandedPanel


Properties

ExpandedDummy

See GetExpandedDummy



ExpandedPanel

See GetExpandedPanel



MinimisedIcon

See GetMinimisedIcon