A ribbon gallery is like a ListBox
, but for bitmaps rather than strings.
wx.lib.agw.ribbon.control.RibbonControl
Default class constructor. |
|
Add an item to the gallery (with complex client data). |
|
Remove all items from the gallery. |
|
Gets the size which best suits the window: for a control, it would be the |
|
Implementation of |
|
Implementation of |
|
Scroll the gallery to ensure that the given item is visible. |
|
Get the currently active item, or |
|
Get the number of items in the gallery. |
|
Returns the default border style for |
|
Get the state of the scroll down button. |
|
Get the state of the “extension” button. |
|
Get the currently hovered item, or |
|
Get an item by index. |
|
Get the client data associated with a gallery item. |
|
Get the currently selected item, or |
|
Get the state of the scroll up button. |
|
Query if the gallery has no items in it. |
|
Query is the mouse is currently hovered over the gallery. |
|
Returns |
|
Layout() -> bool |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Perform initial size and layout calculations after children have been added, |
|
Scroll the gallery contents by some amount. |
|
Set the client data associated with a gallery item. |
|
Set the selection to the given item, or removes the selection if item == |
|
RibbonGallery
(RibbonControl)¶A ribbon gallery is like a ListBox
, but for bitmaps rather than strings.
__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, agwStyle=0, name="RibbonGallery")¶Default class constructor.
parent – pointer to a parent window, typically a RibbonPanel
;
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, currently unused;
name – the window name.
Append
(self, bitmap, id, clientData=None)¶Add an item to the gallery (with complex client data).
bitmap – the bitmap to display for the item. Note that all items must have equally sized bitmaps;
id – id number to associate with the item. Not currently used for anything important;
clientData – an object which contains data to associate with the item. The item takes ownership of this pointer, and will delete it when the item client data is changed to something else, or when the item is destroyed.
CalculateMinSize
(self)¶Clear
(self)¶Remove all items from the gallery.
CommonInit
(self, agwStyle)¶DoGetBestSize
(self)¶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().
An instance of wx.Size
.
Note
Overridden from wx.Control
.
DoGetNextLargerSize
(self, direction, relative_to)¶Implementation of RibbonControl.GetNextLargerSize()
.
Controls which have non-continuous sizing must override this virtual function
rather than RibbonControl.GetNextLargerSize()
.
DoGetNextSmallerSize
(self, direction, relative_to)¶Implementation of RibbonControl.GetNextSmallerSize()
.
Controls which have non-continuous sizing must override this virtual function
rather than RibbonControl.GetNextSmallerSize()
.
EnsureVisible
(self, item)¶Scroll the gallery to ensure that the given item is visible.
item – an instance of RibbonGalleryItem
.
GetActiveItem
(self)¶Get the currently active item, or None
if there is none.
The active item is the item being pressed by the user, and will thus become the selected item if the user releases the mouse button.
GetCount
(self)¶Get the number of items in the gallery.
GetDefaultBorder
(self)¶Returns the default border style for RibbonGallery
.
GetDownButtonState
(self)¶Get the state of the scroll down button.
GetExtensionButtonState
(self)¶Get the state of the “extension” button.
GetHoveredItem
(self)¶Get the currently hovered item, or None
if there is none.
The hovered item is the item underneath the mouse cursor.
GetItem
(self, n)¶Get an item by index.
n – the zero-based item in the gallery, which is an instance of RibbonGalleryItem
.
GetItemClientData
(self, item)¶Get the client data associated with a gallery item.
item – an instance of RibbonGalleryItem
.
GetSelection
(self)¶Get the currently selected item, or None
if there is none.
The selected item is set by SetSelection
, or by the user clicking on an item.
GetUpButtonState
(self)¶Get the state of the scroll up button.
IsEmpty
(self)¶Query if the gallery has no items in it.
IsHovered
(self)¶Query is the mouse is currently hovered over the gallery.
True
if the cursor is within the bounds of the gallery (not
just hovering over an item), False
otherwise.
IsSizingContinuous
(self)¶Returns True
if this window can take any size (greater than its minimum size),
False
if it can only take certain sizes.
See also
RibbonControl.GetNextSmallerSize()
,
RibbonControl.GetNextLargerSize()
Layout
(self)¶Layout() -> bool
Lays out the children of this window using the associated sizer.
OnEraseBackground
(self, event)¶Handles the wx.EVT_ERASE_BACKGROUND
event for RibbonGallery
.
event – a EraseEvent
event to be processed.
OnMouseDClick
(self, event)¶Handles the wx.EVT_LEFT_DCLICK
event for RibbonGallery
.
event – a MouseEvent
event to be processed.
OnMouseDown
(self, event)¶Handles the wx.EVT_LEFT_DOWN
event for RibbonGallery
.
event – a MouseEvent
event to be processed.
OnMouseEnter
(self, event)¶Handles the wx.EVT_ENTER_WINDOW
event for RibbonGallery
.
event – a MouseEvent
event to be processed.
OnMouseLeave
(self, event)¶Handles the wx.EVT_LEAVE_WINDOW
event for RibbonGallery
.
event – a MouseEvent
event to be processed.
OnMouseMove
(self, event)¶Handles the wx.EVT_MOTION
event for RibbonGallery
.
event – a MouseEvent
event to be processed.
OnMouseUp
(self, event)¶Handles the wx.EVT_LEFT_UP
event for RibbonGallery
.
event – a MouseEvent
event to be processed.
OnPaint
(self, event)¶Handles the wx.EVT_PAINT
event for RibbonGallery
.
event – a PaintEvent
event to be processed.
OnSize
(self, event)¶Handles the wx.EVT_SIZE
event for RibbonGallery
.
event – a wx.SizeEvent
event to be processed.
Realize
(self)¶Perform initial size and layout calculations after children have been added, and/or realize children.
ScrollLines
(self, lines)¶Scroll the gallery contents by some amount.
lines – Positive values scroll toward the end of the gallery, while negative values scroll toward the start.
True
if the gallery scrolled at least one pixel in the given
direction, False
if it did not scroll.
Note
Reimplemented from wx.Window
.
SetItemClientData
(self, item, data)¶Set the client data associated with a gallery item.
item – an instance of RibbonGalleryItem
;
data – any Python object.
SetSelection
(self, item)¶Set the selection to the given item, or removes the selection if item == None
.
Note that this not cause any events to be emitted.
item – an instance of RibbonGalleryItem
, can also be None
to remove the selection.
TestButtonHover
(self, rect, pos, state)¶