Top-level control in a ribbon user interface.
__init__ |
Default constructor. |
AddPage |
Adds a page to the RibbonBar . |
CommonInit |
Common initialization procedures. |
DismissExpandedPanel |
Dismiss the expanded panel of the currently active page. |
DoEraseBackground |
Does the initial painting of stuff from the OnPaint event. |
DoGetBestSize |
Gets the size which best suits the window: for a control, it would be the |
DoMouseButtonCommon |
Common methods for all the mouse move/click events. |
GetActivePage |
Get the index of the active page. |
GetAGWWindowStyleFlag |
Returns the RibbonBar window style flag. |
GetDefaultBorder |
Returns the default border style for RibbonBar . |
GetPage |
Get a page by index. |
HasMultiplePages |
This method should be overridden to return true if this window has multiple pages. |
HitTestTabs |
Hit test method for RibbonBar , testing where the given (in client coordinates) |
OnEraseBackground |
Handles the wx.EVT_ERASE_BACKGROUND event for RibbonBar . |
OnMouseDoubleClick |
Handles the wx.EVT_LEFT_DCLICK event for RibbonBar . |
OnMouseLeave |
Handles the wx.EVT_LEAVE_WINDOW event for RibbonBar . |
OnMouseLeftDown |
Handles the wx.EVT_LEFT_DOWN event for RibbonBar . |
OnMouseLeftUp |
Handles the wx.EVT_LEFT_UP event for RibbonBar . |
OnMouseMiddleDown |
Handles the wx.EVT_MIDDLE_DOWN event for RibbonBar . |
OnMouseMiddleUp |
Handles the wx.EVT_MIDDLE_UP event for RibbonBar . |
OnMouseMove |
Handles the wx.EVT_MOTION event for RibbonBar . |
OnMouseRightDown |
Handles the wx.EVT_RIGHT_DOWN event for RibbonBar . |
OnMouseRightUp |
Handles the wx.EVT_RIGHT_UP event for RibbonBar . |
OnPaint |
Handles the wx.EVT_PAINT event for RibbonBar . |
OnSize |
Handles the wx.EVT_SIZE event for RibbonBar . |
OrderPageTabInfoBySmallWidthAsc |
|
Realize |
Perform initial layout and size calculations of the bar and its children. |
RecalculateMinSize |
Recalculates the RibbonBar minimum size. |
RecalculateTabSizes |
Recalculates the RibbonBar tab sizes. |
RefreshTabBar |
Repaints the tab area in RibbonBar . |
RepositionPage |
|
ScrollTabBar |
Scrolls the tab area left/right/up/down by the specified amount. |
SetActivePage |
See comments on SetActivePageByIndex and SetActivePageByPage . |
SetActivePageByIndex |
Set the active page by index, without triggering any events. |
SetActivePageByPage |
Set the active page, without triggering any events. |
SetAGWWindowStyleFlag |
Sets the window style for RibbonBar . |
SetArtProvider |
Set the art provider to be used be the ribbon bar. |
SetTabCtrlMargins |
Set the margin widths (in pixels) on the left and right sides of the tab bar |
ShowPanels |
Shows or hides the panels inside RibbonBar . |
RibbonBar
(RibbonControl)¶Top-level control in a ribbon user interface.
__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, agwStyle=RIBBON_BAR_DEFAULT_STYLE, validator=wx.DefaultValidator, name="RibbonBar")¶Default constructor.
Parameters: |
|
---|
AddPage
(self, page)¶Adds a page to the RibbonBar
.
Parameters: | page – an instance of RibbonPage . |
---|
CommonInit
(self, agwStyle)¶Common initialization procedures.
Parameters: | agwStyle (integer) – the AGW-specific window style. |
---|
See also
SetAGWWindowStyleFlag
for a list of valid window styles.
DismissExpandedPanel
(self)¶Dismiss the expanded panel of the currently active page.
Calls and returns the value from RibbonPage.DismissExpandedPanel()
for the
currently active page, or False
if there is no active page.
DoEraseBackground
(self, dc)¶Does the initial painting of stuff from the OnPaint
event.
Parameters: | dc – an instance of wx.DC . |
---|
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
.
DoMouseButtonCommon
(self, event, tab_event_type)¶Common methods for all the mouse move/click events.
Parameters: |
|
---|
GetActivePage
(self)¶Get the index of the active page.
In the rare case of no page being active, -1 is returned.
GetAGWWindowStyleFlag
(self)¶Returns the RibbonBar
window style flag.
See also
SetAGWWindowStyleFlag
for a list of valid window styles.
GetPage
(self, n)¶Get a page by index.
None
will be returned if the given index is out of range.
Parameters: | n (integer) – the zero-based index indicating the page position. |
---|
HasMultiplePages
(self)¶This method should be overridden to return true if this window has multiple pages.
All standard class with multiple pages such as Notebook
, Listbook
and Treebook
already override it to return true and user-defined classes with similar behaviour should also
do so, to allow the library to handle such windows appropriately.
HitTestTabs
(self, position)¶Hit test method for RibbonBar
, testing where the given (in client coordinates)
point lies.
Parameters: | position – an instance of wx.Point in client coordinates. |
---|---|
Returns: | a tuple containing the tab index and the RibbonPage if the HitTestTabs
successfully found such combination, or a tuple (-1, None) if no tab has been hit. |
OnEraseBackground
(self, event)¶Handles the wx.EVT_ERASE_BACKGROUND
event for RibbonBar
.
Parameters: | event – a EraseEvent event to be processed. |
---|
OnMouseDoubleClick
(self, event)¶Handles the wx.EVT_LEFT_DCLICK
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseLeave
(self, event)¶Handles the wx.EVT_LEAVE_WINDOW
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseLeftDown
(self, event)¶Handles the wx.EVT_LEFT_DOWN
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseLeftUp
(self, event)¶Handles the wx.EVT_LEFT_UP
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseMiddleDown
(self, event)¶Handles the wx.EVT_MIDDLE_DOWN
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseMiddleUp
(self, event)¶Handles the wx.EVT_MIDDLE_UP
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseMove
(self, event)¶Handles the wx.EVT_MOTION
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseRightDown
(self, event)¶Handles the wx.EVT_RIGHT_DOWN
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnMouseRightUp
(self, event)¶Handles the wx.EVT_RIGHT_UP
event for RibbonBar
.
Parameters: | event – a MouseEvent event to be processed. |
---|
OnPaint
(self, event)¶Handles the wx.EVT_PAINT
event for RibbonBar
.
Parameters: | event – a PaintEvent event to be processed. |
---|
OnSize
(self, event)¶Handles the wx.EVT_SIZE
event for RibbonBar
.
Parameters: | event – a wx.SizeEvent event to be processed. |
---|
OrderPageTabInfoBySmallWidthAsc
(self, first, second)¶Realize
(self)¶Perform initial layout and size calculations of the bar and its children.
This must be called after all of the bar’s children have been created (and their
children created, etc.) - if it is not, then windows may not be laid out or
sized correctly. Also calls RibbonPage.Realize()
on each child page.
Note
Reimplemented from RibbonControl
.
RepositionPage
(self, page)¶ScrollTabBar
(self, amount)¶Scrolls the tab area left/right/up/down by the specified amount.
Parameters: | amount (integer) – the amount by which the tab area is scrolled, in pixels. |
---|
SetActivePage
(self, page)¶See comments on SetActivePageByIndex
and SetActivePageByPage
.
SetActivePageByIndex
(self, page)¶Set the active page by index, without triggering any events.
Parameters: | page (integer) – The zero-based index of the page to activate. |
---|---|
Returns: | True if the specified page is now active, False if it could
not be activated (for example because the page index is invalid). |
SetActivePageByPage
(self, page)¶Set the active page, without triggering any events.
Parameters: | page – the page to activate, an instance of RibbonPage . |
---|---|
Returns: | True if the specified page is now active, False if it could
not be activated (for example because the given page is not a child of the
ribbon bar). |
SetAGWWindowStyleFlag
(self, agwStyle)¶Sets the window style for RibbonBar
.
Parameters: | agwStyle (integer) – can be a combination of the following bits:
|
---|
Note
Please note that some styles cannot be changed after the window creation and that Refresh() might need to be be called after changing the others for the change to take place immediately.
SetArtProvider
(self, art)¶Set the art provider to be used be the ribbon bar.
Also sets the art provider on all current RibbonPage
children, and any
RibbonPage
children added in the future.
Note that unlike most other ribbon controls, the ribbon bar creates a default
art provider when initialised, so an explicit call to SetArtProvider
is
not required if the default art provider is sufficient. Also unlike other
ribbon controls, the ribbon bar takes ownership of the given pointer, and
will delete it when the art provider is changed or the bar is destroyed.
If this behaviour is not desired, then clone the art provider before setting it.
Parameters: | art – an art provider. |
---|
Note
Reimplemented from RibbonControl
.
SetTabCtrlMargins
(self, left, right)¶Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar.
These margins will be painted with the tab background, but tabs and scroll buttons will never be painted in the margins. The left margin could be used for rendering something equivalent to the “Office Button”, though this is not currently implemented. The right margin could be used for rendering a help button, and/or MDI buttons, but again, this is not currently implemented.
Parameters: |
|
---|