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.
^^
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. ^^
^^
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. ^^
Default constructor. |
|
Query if the panel can automatically minimise itself at small sizes. |
|
Create a ribbon panel in two-step ribbon panel construction. |
|
Get the dummy panel of an expanded panel. |
|
Get the expanded panel of a dummy panel. |
|
Get the bitmap to be used in place of the panel children when it is minimised. |
|
Test if the panel has an extension button. |
|
Hide the panel’s external expansion. |
|
Query if the mouse is currently hovered over the extension button. |
|
Query is the mouse is currently hovered over the panel. |
|
Query if the panel is currently minimised. |
|
Realize all children of the panel. |
|
Set the art provider to be used. |
|
Show the panel externally expanded. |
See |
|
See |
|
See |
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.
__init__
(self, *args, **kw)¶__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.
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.
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.
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
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.
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.
GetMinimisedIcon
(self)¶Get the bitmap to be used in place of the panel children when it is minimised.
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.
bool
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.
bool
True
if the panel was un-expanded, False
if it was not (normally due to it not being expanded in the first place).
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.
bool
New in version 2.9.4.
IsHovered
(self)¶Query is the mouse is currently hovered over the panel.
bool
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)¶IsMinimised (self)
Query if the panel is currently minimised.
bool
IsMinimised (self, at_size)
Query if the panel would be minimised at a given size.
at_size (wx.Size) –
bool
Realize
(self)¶Realize all children of the panel.
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.
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.
bool
True
if the panel was expanded, False
if it was not (possibly due to it not being minimised, or already being expanded).
ExpandedDummy
¶See GetExpandedDummy
ExpandedPanel
¶See GetExpandedPanel
MinimisedIcon
¶See GetMinimisedIcon