A ribbon gallery is like a ListBox
, but for bitmaps rather than strings.
__init__ |
Default class constructor. |
Append |
Add an item to the gallery (with complex client data). |
CalculateMinSize |
|
Clear |
Remove all items from the gallery. |
CommonInit |
|
DoGetBestSize |
Gets the size which best suits the window: for a control, it would be the |
DoGetNextLargerSize |
Implementation of RibbonControl.GetNextLargerSize() . |
DoGetNextSmallerSize |
Implementation of RibbonControl.GetNextSmallerSize() . |
EnsureVisible |
Scroll the gallery to ensure that the given item is visible. |
GetActiveItem |
Get the currently active item, or None if there is none. |
GetCount |
Get the number of items in the gallery. |
GetDefaultBorder |
Returns the default border style for RibbonGallery . |
GetDownButtonState |
Get the state of the scroll down button. |
GetExtensionButtonState |
Get the state of the “extension” button. |
GetHoveredItem |
Get the currently hovered item, or None if there is none. |
GetItem |
Get an item by index. |
GetItemClientData |
Get the client data associated with a gallery item. |
GetSelection |
Get the currently selected item, or None if there is none. |
GetUpButtonState |
Get the state of the scroll up button. |
IsEmpty |
Query if the gallery has no items in it. |
IsHovered |
Query is the mouse is currently hovered over the gallery. |
IsSizingContinuous |
Returns True if this window can take any size (greater than its minimum size), |
Layout |
|
OnEraseBackground |
Handles the wx.EVT_ERASE_BACKGROUND event for RibbonGallery . |
OnMouseDClick |
Handles the wx.EVT_LEFT_DCLICK event for RibbonGallery . |
OnMouseDown |
Handles the wx.EVT_LEFT_DOWN event for RibbonGallery . |
OnMouseEnter |
Handles the wx.EVT_ENTER_WINDOW event for RibbonGallery . |
OnMouseLeave |
Handles the wx.EVT_LEAVE_WINDOW event for RibbonGallery . |
OnMouseMove |
Handles the wx.EVT_MOTION event for RibbonGallery . |
OnMouseUp |
Handles the wx.EVT_LEFT_UP event for RibbonGallery . |
OnPaint |
Handles the wx.EVT_PAINT event for RibbonGallery . |
OnSize |
Handles the wx.EVT_SIZE event for RibbonGallery . |
Realize |
Perform initial size and layout calculations after children have been added, |
ScrollLines |
Scroll the gallery contents by some amount. |
SetItemClientData |
Set the client data associated with a gallery item. |
SetSelection |
Set the selection to the given item, or removes the selection if item == None . |
TestButtonHover |
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.
Parameters: |
|
---|
Append
(self, bitmap, id, clientData=None)¶Add an item to the gallery (with complex client data).
Parameters: |
|
---|
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().
Returns: | 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.
Parameters: | 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.
Parameters: | 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.
Parameters: | 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.
Returns: | 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)¶OnEraseBackground
(self, event)¶Handles the wx.EVT_ERASE_BACKGROUND
event for RibbonGallery
.
Parameters: | event – a EraseEvent event to be processed. |
---|
OnMouseDClick
(self, event)¶Handles the wx.EVT_LEFT_DCLICK
event for RibbonGallery
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseDown
(self, event)¶Handles the wx.EVT_LEFT_DOWN
event for RibbonGallery
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseEnter
(self, event)¶Handles the wx.EVT_ENTER_WINDOW
event for RibbonGallery
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseLeave
(self, event)¶Handles the wx.EVT_LEAVE_WINDOW
event for RibbonGallery
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseMove
(self, event)¶Handles the wx.EVT_MOTION
event for RibbonGallery
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseUp
(self, event)¶Handles the wx.EVT_LEFT_UP
event for RibbonGallery
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnPaint
(self, event)¶Handles the wx.EVT_PAINT
event for RibbonGallery
.
Parameters: | event – a PaintEvent event to be processed. |
---|
OnSize
(self, event)¶Handles the wx.EVT_SIZE
event for RibbonGallery
.
Parameters: | 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.
Parameters: | lines – Positive values scroll toward the end of the gallery, while negative values scroll toward the start. |
---|---|
Returns: | 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.
Parameters: |
|
---|
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.
Parameters: | item – an instance of RibbonGalleryItem , can also be None to remove the selection. |
---|
TestButtonHover
(self, rect, pos, state)¶