.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. currentmodule:: wx.lib.agw.ribbon.art_aui .. highlight:: python .. _wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider: ========================================================================================================================================== |phoenix_title| **wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider** ========================================================================================================================================== | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class RibbonAUIArtProvider:
| |sub_classes| Known Subclasses ============================== :class:`wx.lib.agw.ribbon.art_osx.RibbonOSXArtProvider` | |super_classes| Known Superclasses ================================== :class:`wx.lib.agw.ribbon.art_msw.RibbonMSWArtProvider` | |method_summary| Methods Summary ================================ ================================================================================== ================================================================================ :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.__init__` Initialize self. See help(type(self)) for accurate signature. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.Clone` Create a new art provider which is a clone of this one. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawButtonBarBackground` Draw the background for a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar` control. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawButtonBarButton` Draw a single button for a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar` control. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawGalleryBackground` Draw the background and chrome for a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawGalleryButton` :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawGalleryItemBackground` Draw the background of a single item in a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawMinimisedPanel` Draw a minimised ribbon panel. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawPageBackground` Draw the background of a ribbon page. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawPanelBackground` Draw the background and chrome for a ribbon panel. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawPartialPanelBackground` :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawScrollButton` Draw a ribbon-style scroll button. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawTab` Draw a single tab in the tab region of a ribbon bar. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawTabCtrlBackground` Draw the background of the tab region of a ribbon bar. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawTabSeparator` Draw a separator between two tabs in a ribbon bar. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawTool` Draw a single tool (for a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control). :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawToolBarBackground` Draw the background for a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.DrawToolGroupBackground` Draw the background for a group of tools on a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetBarTabWidth` Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetColour` Get the value of a certain colour setting. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetPanelClientSize` Calculate the client size of a panel for a given overall size. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetPanelExtButtonArea` Retrieve the extension button area rectangle. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetPanelSize` Calculate the size of a panel for a given client size. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetScrollButtonMinimumSize` Calculate the minimum size (in pixels) of a scroll button. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.GetTabCtrlHeight` Calculate the height (in pixels) of the tab region of a ribbon bar. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.SetColour` Set the value of a certain colour setting to the value. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.SetColourScheme` Set all applicable colour settings from a few base colours. :meth:`~wx.lib.agw.ribbon.art_aui.RibbonAUIArtProvider.SetFont` Set the value of a certain font setting to the value. ================================================================================== ================================================================================ | |api| Class API =============== .. class:: RibbonAUIArtProvider(RibbonMSWArtProvider) .. method:: __init__(self) Initialize self. See help(type(self)) for accurate signature. .. method:: Clone(self) Create a new art provider which is a clone of this one. .. method:: DrawButtonBarBackground(self, dc, wnd, rect) Draw the background for a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar` control. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto (which will typically be the button bar itself, though this is not guaranteed); :param `rect`: The rectangle within which to draw. .. method:: DrawButtonBarButton(self, dc, wnd, rect, kind, state, label, bitmap_large, bitmap_small) Draw a single button for a :class:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar` control. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto; :param `rect`: The rectangle within which to draw. The size of this rectangle will be a size previously returned by :meth:`RibbonMSWArtProvider.GetButtonBarButtonSize() `, and the rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawButtonBarBackground`; :param `kind`: The kind of button to draw (normal, dropdown or hybrid); :param `state`: Combination of a size flag and state flags from the `RibbonButtonBarButtonState` enumeration; :param `label`: The label of the button; :param `bitmap_large`: The large bitmap of the button (or the large disabled bitmap when ``RIBBON_BUTTONBAR_BUTTON_DISABLED`` is set in ); :param `bitmap_small`: The small bitmap of the button (or the small disabled bitmap when ``RIBBON_BUTTONBAR_BUTTON_DISABLED`` is set in ). .. method:: DrawGalleryBackground(self, dc, wnd, rect) Draw the background and chrome for a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control. This should draw the border, background, scroll buttons, extension button, and any other UI elements which are not attached to a specific gallery item. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto, which is always the gallery whose background and chrome is being drawn. Attributes used during drawing like the gallery hover state and individual button states can be queried from this parameter by :meth:`RibbonGallery.IsHovered() `, :meth:`RibbonGallery.GetExtensionButtonState() `, :meth:`RibbonGallery.GetUpButtonState() `, and :meth:`RibbonGallery.GetDownButtonState() `; :param `rect`: The rectangle within which to draw. This rectangle is the entire area of the gallery control, not just the client rectangle. .. method:: DrawGalleryButton(self, dc, rect, state, bitmaps) .. method:: DrawGalleryItemBackground(self, dc, wnd, rect, item) Draw the background of a single item in a :class:`~wx.lib.agw.ribbon.gallery.RibbonGallery` control. This is painted on top of a gallery background, and behind the items bitmap. Unlike :meth:`~RibbonAUIArtProvider.DrawButtonBarButton` and :meth:`~RibbonAUIArtProvider.DrawTool`, it is not expected to draw the item bitmap - that is done by the gallery control itself. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto, which is always the gallery which contains the item being drawn; :param `rect`: The rectangle within which to draw. The size of this rectangle will be the size of the item's bitmap, expanded by gallery item padding values (``RIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE``, ``RIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE``, ``RIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE``, and ``RIBBON_ART_GALLERY_BITMAP_PADDING_BOTTOM_SIZE``). The drawing rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawGalleryBackground`; :param `item`: The item whose background is being painted. Typically the background will vary if the item is hovered, active, or selected; :meth:`RibbonGallery.GetSelection() `, :meth:`RibbonGallery.GetActiveItem() `, and :meth:`RibbonGallery.GetHoveredItem() ` can be called to test if the given item is in one of these states. .. method:: DrawMinimisedPanel(self, dc, wnd, rect, bitmap) Draw a minimised ribbon panel. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto, which is always the panel which is minimised. The panel label can be obtained from this window. The minimised icon obtained from querying the window may not be the size requested by :meth:`RibbonMSWArtProvider.GetMinimisedPanelMinimumSize() ` - the argument contains the icon in the requested size; :param `rect`: The rectangle within which to draw. The size of the rectangle will be at least the size returned by :meth:`RibbonMSWArtProvider.GetMinimisedPanelMinimumSize() `; :param `bitmap`: A copy of the panel's minimised bitmap rescaled to the size returned by :meth:`RibbonMSWArtProvider.GetMinimisedPanelMinimumSize() `. .. method:: DrawPageBackground(self, dc, wnd, rect) Draw the background of a ribbon page. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto (which is commonly the :class:`~wx.lib.agw.ribbon.page.RibbonPage` whose background is being drawn, but doesn't have to be); :param `rect`: The rectangle within which to draw. .. seealso:: :meth:`RibbonMSWArtProvider.GetPageBackgroundRedrawArea() ` .. method:: DrawPanelBackground(self, dc, wnd, rect) Draw the background and chrome for a ribbon panel. This should draw the border, background, label, and any other items of a panel which are outside the client area of a panel. Note that when a panel is minimised, this function is not called - only :meth:`~RibbonAUIArtProvider.DrawMinimisedPanel` is called, so a background should be explicitly painted by that if required. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto, which is always the panel whose background and chrome is being drawn. The panel label and other panel attributes can be obtained by querying this; :param `rect`: The rectangle within which to draw. .. method:: DrawPartialPanelBackground(self, dc, wnd, rect) .. method:: DrawScrollButton(self, dc, wnd, rect, style) Draw a ribbon-style scroll button. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto; :param `rect`: The rectangle within which to draw. The size of this rectangle will be at least the size returned by :meth:`~RibbonAUIArtProvider.GetScrollButtonMinimumSize` for a scroll button with the same style. For tab scroll buttons, this rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawTabCtrlBackground`, but this is not guaranteed for other types of button (for example, page scroll buttons will not be painted on an area previously painted with :meth:`~RibbonAUIArtProvider.DrawPageBackground`); :param `style`: A combination of flags from `RibbonScrollButtonStyle`, including a direction, a for flag, and one or more states. .. method:: DrawTab(self, dc, wnd, tab) Draw a single tab in the tab region of a ribbon bar. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto (not the :class:`~wx.lib.agw.ribbon.page.RibbonPage` associated with the tab being drawn); :param `tab`: The rectangle within which to draw, and also the tab label, icon, and state (active and/or hovered). The drawing rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawTabCtrlBackground`. The rectangle's width will be at least the minimum value returned by :meth:`~RibbonAUIArtProvider.GetBarTabWidth`, and height will be the value returned by :meth:`~RibbonAUIArtProvider.GetTabCtrlHeight`. .. method:: DrawTabCtrlBackground(self, dc, wnd, rect) Draw the background of the tab region of a ribbon bar. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto; :param `rect`: The rectangle within which to draw. .. method:: DrawTabSeparator(self, dc, wnd, rect, visibility) Draw a separator between two tabs in a ribbon bar. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto; :param `rect`: The rectangle within which to draw, which will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawTabCtrlBackground`; :param `visibility`: The opacity with which to draw the separator. Values are in the range [0, 1], with 0 being totally transparent, and 1 being totally opaque. .. method:: DrawTool(self, dc, wnd, rect, bitmap, kind, state) Draw a single tool (for a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control). :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto. In most cases this will be a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`, but it doesn't have to be; :param `rect`: The rectangle within which to draw. The size of this rectangle will at least the size returned by :meth:`RibbonMSWArtProvider.GetToolSize() `, and the height of it will be equal for all tools within the same group. The rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawToolGroupBackground`; :param `bitmap`: The bitmap to use as the tool's foreground. If the tool is a hybrid or dropdown tool, then the foreground should also contain a standard dropdown button; :param `kind`: The kind of tool to draw (normal, dropdown, or hybrid); :param `state`: A combination of `RibbonToolBarToolState` flags giving the state of the tool and it's relative position within a tool group. .. method:: DrawToolBarBackground(self, dc, wnd, rect) Draw the background for a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control. :param `dc`: The device context to draw onto; :param `wnd`: The which is being drawn onto. In most cases this will be a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`, but it doesn't have to be; :param `rect`: The rectangle within which to draw. Some of this rectangle will later be drawn over using :meth:`~RibbonAUIArtProvider.DrawToolGroupBackground` and :meth:`~RibbonAUIArtProvider.DrawTool`, but not all of it will (unless there is only a single group of tools). .. method:: DrawToolGroupBackground(self, dc, wnd, rect) Draw the background for a group of tools on a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar` control. :param `dc`: The device context to draw onto; :param `wnd`: The window which is being drawn onto. In most cases this will be a :class:`~wx.lib.agw.ribbon.toolbar.RibbonToolBar`, but it doesn't have to be; :param `rect`: The rectangle within which to draw. This rectangle is a union of the individual tools' rectangles. As there are no gaps between tools, this rectangle will be painted over exactly once by calls to :meth:`~RibbonAUIArtProvider.DrawTool`. The group background could therefore be painted by :meth:`~RibbonAUIArtProvider.DrawTool`, though it can be conceptually easier and more efficient to draw it all at once here. The rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`~RibbonAUIArtProvider.DrawToolBarBackground`. .. method:: GetBarTabWidth(self, dc, wnd, label, bitmap, ideal=None, small_begin_need_separator=None, small_must_have_separator=None, minimum=None) Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar. :param `dc`: A device context to use when one is required for size calculations; :param `wnd`: The window onto which the tab will eventually be drawn; :param `label`: The tab's label (or an empty string if it has none); :param `bitmap`: The tab's icon (or :class:`NullBitmap` if it has none); :param `ideal`: The ideal width (in pixels) of the tab; :param `small_begin_need_separator`: A size less than the size, at which a tab separator should begin to be drawn (i.e. drawn, but still fairly transparent); :param `small_must_have_separator`: A size less than the size, at which a tab separator must be drawn (i.e. drawn at full opacity); :param `minimum`: A size less than the size, and greater than or equal to zero, which is the minimum pixel width for the tab. .. method:: GetColour(self, id) Get the value of a certain colour setting. can be one of the colour values of `RibbonArtSetting`. :param `id`: the colour id. .. method:: GetPanelClientSize(self, dc, wnd, size, client_offset=None) Calculate the client size of a panel for a given overall size. This should act as the inverse to :meth:`~RibbonAUIArtProvider.GetPanelSize`, and decrement the given size by enough to fit the panel label and other chrome. :param `dc`: A device context to use if one is required for size calculations; :param `wnd`: The ribbon panel in question; :param `size`: The overall size to calculate client size for; :param `client_offset`: The offset where the returned client size begins within the given (may be ``None``). .. seealso:: :meth:`~RibbonAUIArtProvider.GetPanelSize` .. method:: GetPanelExtButtonArea(self, dc, wnd, rect) Retrieve the extension button area rectangle. :param `dc`: The device context used to measure text extents; :param `wnd`: The panel where the extension button resides; :param `rect`: The panel client rectangle. .. method:: GetPanelSize(self, dc, wnd, client_size, client_offset=None) Calculate the size of a panel for a given client size. This should increment the given size by enough to fit the panel label and other chrome. :param `dc`: A device context to use if one is required for size calculations; :param `wnd`: The ribbon panel in question; :param `client_size`: The client size; :param `client_offset`: The offset where the client rectangle begins within the panel (may be ``None``). .. seealso:: :meth:`~RibbonAUIArtProvider.GetPanelClientSize` .. method:: GetScrollButtonMinimumSize(self, dc, wnd, style) Calculate the minimum size (in pixels) of a scroll button. :param `dc`: A device context to use when one is required for size calculations; :param `wnd`: The window onto which the scroll button will eventually be drawn; :param `style`: A combination of flags from `RibbonScrollButtonStyle`, including a direction, and a for flag (state flags may be given too, but should be ignored, as a button should retain a constant size, regardless of its state). .. method:: GetTabCtrlHeight(self, dc, wnd, pages) Calculate the height (in pixels) of the tab region of a ribbon bar. Note that as the tab region can contain scroll buttons, the height should be greater than or equal to the minimum height for a tab scroll button. :param `dc`: A device context to use when one is required for size calculations; :param `wnd`: The window onto which the tabs will eventually be drawn; :param `pages`: The tabs which will acquire the returned height. .. method:: SetColour(self, id, colour) Set the value of a certain colour setting to the value. can be one of the colour values of `RibbonArtSetting`, though not all colour settings will have an affect on every art provider. :param `id`: the colour id; :param `colour`: MISSING DESCRIPTION. .. seealso:: :meth:`~RibbonAUIArtProvider.SetColourScheme` .. method:: SetColourScheme(self, primary, secondary, tertiary) Set all applicable colour settings from a few base colours. Uses any or all of the three given colours to create a colour scheme, and then sets all colour settings which are relevant to the art provider using that scheme. Note that some art providers may not use the tertiary colour for anything, and some may not use the secondary colour either. :param `primary`: MISSING DESCRIPTION; :param `secondary`: MISSING DESCRIPTION; :param `tertiary`: MISSING DESCRIPTION. .. seealso:: :meth:`~RibbonAUIArtProvider.SetColour`, :meth:`RibbonMSWArtProvider.GetColourScheme() ` .. method:: SetFont(self, id, font) Set the value of a certain font setting to the value. can be one of the font values of `RibbonArtSetting`. :param `id`: the font id; :param `font`: MISSING DESCRIPTION.