.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.ribbon.RibbonMSWArtProvider:

==========================================================================================================================================
|phoenix_title|  **wx.ribbon.RibbonMSWArtProvider**
==========================================================================================================================================





|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>RibbonMSWArtProvider</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.ribbon.RibbonMSWArtProvider_inheritance.png" alt="Inheritance diagram of RibbonMSWArtProvider" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.ribbon.RibbonArtProvider.html" title="wx.ribbon.RibbonArtProvider" alt="" coords="20,5,219,35"/> <area shape="rect" id="node2" href="wx.ribbon.RibbonMSWArtProvider.html" title="wx.ribbon.RibbonMSWArtProvider" alt="" coords="5,83,235,112"/> </map> 
   </p>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.ribbon.RibbonAUIArtProvider`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.ribbon.RibbonMSWArtProvider.__init__`                                 
:meth:`~wx.ribbon.RibbonMSWArtProvider.Clone`                                    Create a new art provider which is a clone of this one.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawButtonBarBackground`                  Draw the background for a :ref:`wx.ribbon.RibbonButtonBar`  control.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawButtonBarButton`                      Draw a single button for a :ref:`wx.ribbon.RibbonButtonBar`  control.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawGalleryBackground`                    Draw the background and chrome for a :ref:`wx.ribbon.RibbonGallery`  control.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawGalleryItemBackground`                Draw the background of a single item in a :ref:`wx.ribbon.RibbonGallery`  control.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawHelpButton`                           Draw help button on :ref:`wx.ribbon.RibbonBar`.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawMinimisedPanel`                       Draw a minimised ribbon panel.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawPageBackground`                       Draw the background of a ribbon page.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawPanelBackground`                      Draw the background and chrome for a ribbon panel.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawScrollButton`                         Draw a ribbon-style scroll button.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawTab`                                  Draw a single tab in the tab region of a ribbon bar.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawTabCtrlBackground`                    Draw the background of the tab region of a ribbon bar.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawTabSeparator`                         Draw a separator between two tabs in a ribbon bar.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawToggleButton`                         Draw toggle button on :ref:`wx.ribbon.RibbonBar`.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawTool`                                 Draw a single tool (for a :ref:`wx.ribbon.RibbonToolBar`  control).
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawToolBarBackground`                    Draw the background for a :ref:`wx.ribbon.RibbonToolBar`  control.
:meth:`~wx.ribbon.RibbonMSWArtProvider.DrawToolGroupBackground`                  Draw the background for a group of tools on a :ref:`wx.ribbon.RibbonToolBar`  control.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetBarTabWidth`                           Calculate the ideal and minimum width (in pixels) of a tab in a ribbon bar.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetBarToggleButtonArea`                   Calculate the position and size of the ribbon's toggle button.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetButtonBarButtonSize`                   Calculate the size of a button within a :ref:`wx.ribbon.RibbonButtonBar`.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetColour`                                Get the value of a certain colour setting.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetColourScheme`                          Get the current colour scheme.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetFlags`                                 Get the previously set style flags.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetFont`                                  Get the value of a certain font setting.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetGalleryClientSize`                     Calculate the client size of a :ref:`wx.ribbon.RibbonGallery`  control for a given size.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetGallerySize`                           Calculate the size of a :ref:`wx.ribbon.RibbonGallery`  control for a given client size.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetMetric`                                Get the value of a certain integer setting.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetMinimisedPanelMinimumSize`             Calculate the size of a minimised ribbon panel.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetPageBackgroundRedrawArea`              Calculate the portion of a page background which needs to be redrawn when a page is resized.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetPanelClientSize`                       Calculate the client size of a panel for a given overall size.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetPanelExtButtonArea`                    Calculate the position and size of the panel extension button.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetPanelSize`                             Calculate the size of a panel for a given client size.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetRibbonHelpButtonArea`                  Calculate the position and size of the ribbon's help button.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetScrollButtonMinimumSize`               Calculate the minimum size (in pixels) of a scroll button.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetTabCtrlHeight`                         Calculate the height (in pixels) of the tab region of a ribbon bar.
:meth:`~wx.ribbon.RibbonMSWArtProvider.GetToolSize`                              Calculate the size of a tool within a :ref:`wx.ribbon.RibbonToolBar`.
:meth:`~wx.ribbon.RibbonMSWArtProvider.SetColour`                                Set the value of a certain colour setting to the value `colour`.
:meth:`~wx.ribbon.RibbonMSWArtProvider.SetColourScheme`                          Set all applicable colour settings from a few base colours.
:meth:`~wx.ribbon.RibbonMSWArtProvider.SetFlags`                                 Set the style flags.
:meth:`~wx.ribbon.RibbonMSWArtProvider.SetFont`                                  Set the value of a certain font setting to the value `font`.
:meth:`~wx.ribbon.RibbonMSWArtProvider.SetMetric`                                Set the value of a certain integer setting to the value `new_val`.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ribbon.RibbonMSWArtProvider.Flags`                                    See :meth:`~wx.ribbon.RibbonMSWArtProvider.GetFlags` and :meth:`~wx.ribbon.RibbonMSWArtProvider.SetFlags`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.ribbon.RibbonMSWArtProvider(RibbonArtProvider)

   **Possible constructors**::

       RibbonMSWArtProvider(set_colour_scheme=True)
       



   .. method:: __init__(self, set_colour_scheme=True)




      :param `set_colour_scheme`: 
      :type `set_colour_scheme`: bool







   .. method:: Clone(self)

      Create a new art provider which is a clone of this one.                  

      :rtype: :ref:`wx.ribbon.RibbonArtProvider`








   .. method:: DrawButtonBarBackground(self, dc, wnd, rect)

      Draw the background for a :ref:`wx.ribbon.RibbonButtonBar`  control.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto (which will typically be the button bar itself, though this is not guaranteed).   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw.   
      :type `rect`: wx.Rect








                  





   .. method:: DrawButtonBarButton(self, dc, wnd, rect, kind, state, label, bitmap_large, bitmap_small)

      Draw a single button for a :ref:`wx.ribbon.RibbonButtonBar`  control.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto.   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw. The size of this rectangle will be a size previously returned by :meth:`GetButtonBarButtonSize` , and the rectangle will be entirely within a rectangle on the same device context previously painted with :meth:`DrawButtonBarBackground` .   
      :type `rect`: wx.Rect
      :param `kind`: The kind of button to draw (normal, dropdown or hybrid).   
      :type `kind`: wx.ribbon.RibbonButtonKind
      :param `state`: Combination of a size flag and state flags from the RibbonButtonBarButtonState enumeration.   
      :type `state`: long
      :param `label`: The label of the button.   
      :type `label`: string
      :param `bitmap_large`: The large bitmap of the button (or the large disabled bitmap when ``wx.ribbon.RIBBON_BUTTONBAR_BUTTON_DISABLED`` is set in  `state`).   
      :type `bitmap_large`: wx.Bitmap
      :param `bitmap_small`: The small bitmap of the button (or the small disabled bitmap when ``wx.ribbon.RIBBON_BUTTONBAR_BUTTON_DISABLED`` is set in  `state`).   
      :type `bitmap_small`: wx.Bitmap


















                  





   .. method:: DrawGalleryBackground(self, dc, wnd, rect)

      Draw the background and chrome for a :ref:`wx.ribbon.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.   
      :type `dc`: wx.DC
      :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:`wx.ribbon.RibbonGallery.IsHovered` , :meth:`wx.ribbon.RibbonGallery.GetExtensionButtonState` , :meth:`wx.ribbon.RibbonGallery.GetUpButtonState` , and :meth:`wx.ribbon.RibbonGallery.GetDownButtonState` .   
      :type `wnd`: wx.ribbon.RibbonGallery
      :param `rect`: The rectangle within which to draw. This rectangle is the entire area of the gallery control, not just the client rectangle.   
      :type `rect`: wx.Rect








                  





   .. method:: DrawGalleryItemBackground(self, dc, wnd, rect, item)

      Draw the background of a single item in a :ref:`wx.ribbon.RibbonGallery`  control.                  

      This is painted on top of a gallery background, and behind the items bitmap. Unlike :meth:`DrawButtonBarButton`   and :meth:`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.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto, which is always the gallery which contains the item being drawn.   
      :type `wnd`: wx.ribbon.RibbonGallery
      :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 (wx``wx.ribbon.RIBBON_ART_GALLERY_BITMAP_PADDING_LEFT_SIZE``, ``wx.ribbon.RIBBON_ART_GALLERY_BITMAP_PADDING_RIGHT_SIZE``, ``wx.ribbon.RIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE``, and ``wx.ribbon.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:`DrawGalleryBackground` .   
      :type `rect`: wx.Rect
      :param `item`: The item whose background is being painted. Typically the background will vary if the item is hovered, active, or selected; :meth:`wx.ribbon.RibbonGallery.GetSelection` , :meth:`wx.ribbon.RibbonGallery.GetActiveItem` , and :meth:`wx.ribbon.RibbonGallery.GetHoveredItem`   can be called to test if the given item is in one of these states.   
      :type `item`: RibbonGalleryItem










                  





   .. method:: DrawHelpButton(self, dc, wnd, rect)

      Draw help button on :ref:`wx.ribbon.RibbonBar`.                  

      This should draw a help button at top right corner of ribbon bar. 




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :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.   
      :type `wnd`: wx.ribbon.RibbonBar
      :param `rect`: The rectangle within which to draw.  
      :type `rect`: wx.Rect








                  



      .. versionadded:: 2.9.5 
     








   .. method:: DrawMinimisedPanel(self, dc, wnd, rect, bitmap)

      Draw a minimised ribbon panel.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :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:`GetMinimisedPanelMinimumSize`   - the  `bitmap`  argument contains the icon in the requested size.   
      :type `wnd`: wx.ribbon.RibbonPanel
      :param `rect`: The rectangle within which to draw. The size of the rectangle will be at least the size returned by :meth:`GetMinimisedPanelMinimumSize` .   
      :type `rect`: wx.Rect
      :param `bitmap`: A copy of the panel's minimised bitmap rescaled to the size returned by :meth:`GetMinimisedPanelMinimumSize` .   
      :type `bitmap`: wx.Bitmap










                  





   .. method:: DrawPageBackground(self, dc, wnd, rect)

      Draw the background of a ribbon page.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto (which is commonly the :ref:`wx.ribbon.RibbonPage`  whose background is being drawn, but doesn't have to be).   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw.  
      :type `rect`: wx.Rect








                  



      .. seealso:: :meth:`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:`DrawMinimisedPanel`   is called, so a background should be explicitly painted by that if required. 




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :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.   
      :type `wnd`: wx.ribbon.RibbonPanel
      :param `rect`: The rectangle within which to draw.   
      :type `rect`: wx.Rect








                  





   .. method:: DrawScrollButton(self, dc, wnd, rect, style)

      Draw a ribbon-style scroll button.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto.   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw. The size of this rectangle will be at least the size returned by :meth:`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:`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:`DrawPageBackground` ).   
      :type `rect`: wx.Rect
      :param `style`: A combination of flags from :ref:`wx.ribbon.RibbonScrollButtonStyle`, including a direction, a for flag, and one or more states.   
      :type `style`: long










                  





   .. 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.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto (not the :ref:`wx.ribbon.RibbonPage`  associated with the tab being drawn).   
      :type `wnd`: wx.Window
      :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:`DrawTabCtrlBackground` . The rectangle's width will be at least the minimum value returned by :meth:`GetBarTabWidth` , and height will be the value returned by :meth:`GetTabCtrlHeight` .   
      :type `tab`: wx.ribbon.RibbonPageTabInfo








                  





   .. 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.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto.   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw.   
      :type `rect`: wx.Rect








                  





   .. 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.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto.   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw, which will be entirely within a rectangle on the same device context previously painted with :meth:`DrawTabCtrlBackground` .   
      :type `rect`: wx.Rect
      :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.   
      :type `visibility`: float










                  





   .. method:: DrawToggleButton(self, dc, wnd, rect, mode)

      Draw toggle button on :ref:`wx.ribbon.RibbonBar`.                  

      This should draw a small toggle button at top right corner of ribbon bar. 




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :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.   
      :type `wnd`: wx.ribbon.RibbonBar
      :param `rect`: The rectangle within which to draw.   
      :type `rect`: wx.Rect
      :param `mode`: The RibbonDisplayMode which should be applied to display button  
      :type `mode`: wx.ribbon.RibbonDisplayMode










                  



      .. versionadded:: 2.9.5 
     








   .. method:: DrawTool(self, dc, wnd, rect, bitmap, kind, state)

      Draw a single tool (for a :ref:`wx.ribbon.RibbonToolBar`  control).                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto. In most cases this will be a :ref:`wx.ribbon.RibbonToolBar`, but it doesn't have to be.   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw. The size of this rectangle will at least the size returned by :meth:`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:`DrawToolGroupBackground` .   
      :type `rect`: wx.Rect
      :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.   
      :type `bitmap`: wx.Bitmap
      :param `kind`: The kind of tool to draw (normal, dropdown, or hybrid).   
      :type `kind`: wx.ribbon.RibbonButtonKind
      :param `state`: A combination of RibbonToolBarToolState flags giving the state of the tool and it's relative position within a tool group.   
      :type `state`: long














                  





   .. method:: DrawToolBarBackground(self, dc, wnd, rect)

      Draw the background for a :ref:`wx.ribbon.RibbonToolBar`  control.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The which is being drawn onto. In most cases this will be a :ref:`wx.ribbon.RibbonToolBar`, but it doesn't have to be.   
      :type `wnd`: wx.Window
      :param `rect`: The rectangle within which to draw. Some of this rectangle will later be drawn over using :meth:`DrawToolGroupBackground`   and :meth:`DrawTool` , but not all of it will (unless there is only a single group of tools).   
      :type `rect`: wx.Rect








                  





   .. method:: DrawToolGroupBackground(self, dc, wnd, rect)

      Draw the background for a group of tools on a :ref:`wx.ribbon.RibbonToolBar`  control.                  




      :param `dc`: The device context to draw onto.   
      :type `dc`: wx.DC
      :param `wnd`: The window which is being drawn onto. In most cases this will be a :ref:`wx.ribbon.RibbonToolBar`, but it doesn't have to be.   
      :type `wnd`: wx.Window
      :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:`DrawTool` . The group background could therefore be painted by :meth:`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:`DrawToolBarBackground` .   
      :type `rect`: wx.Rect








                  





   .. method:: GetBarTabWidth(self, dc, wnd, label, bitmap, ideal, small_begin_need_separator, small_must_have_separator, minimum)

      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.   
      :type `dc`: wx.DC
      :param `wnd`: The window onto which the tab will eventually be drawn.   
      :type `wnd`: wx.Window
      :param `label`: The tab's label (or EmptyString if it has none).   
      :type `label`: string
      :param `bitmap`: The tab's icon (or NullBitmap if it has none).   
      :type `bitmap`: wx.Bitmap
      :param `ideal`: The ideal width (in pixels) of the tab.   
      :type `ideal`: int
      :param `small_begin_need_separator`: A size less than the  `ideal`  size, at which a tab separator should begin to be drawn (i.e. drawn, but still fairly transparent).   
      :type `small_begin_need_separator`: int
      :param `small_must_have_separator`: A size less than the  `small_begin_need_separator`  size, at which a tab separator must be drawn (i.e. drawn at full opacity).   
      :type `small_must_have_separator`: int
      :param `minimum`: A size less than the  `small_must_have_separator`  size, and greater than or equal to zero, which is the minimum pixel width for the tab.   
      :type `minimum`: int


















                  





   .. method:: GetBarToggleButtonArea(self, rect)

      Calculate the position and size of the ribbon's toggle button.                  




      :param `rect`: The ribbon bar rectangle from which calculate toggle button rectangle.  
      :type `rect`: wx.Rect






      :rtype: :ref:`Rect`



                  



      .. versionadded:: 2.9.5 
     








   .. method:: GetButtonBarButtonSize(self, dc, wnd, kind, size, label, bitmap_size_large, bitmap_size_small, button_size, normal_region, dropdown_region)

      Calculate the size of a button within a :ref:`wx.ribbon.RibbonButtonBar`.                  




      :param `dc`: A device context to use when one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The window onto which the button will eventually be drawn (which is normally a :ref:`wx.ribbon.RibbonButtonBar`, though this is not guaranteed).   
      :type `wnd`: wx.Window
      :param `kind`: The kind of button.   
      :type `kind`: wx.ribbon.RibbonButtonKind
      :param `size`: The size-class to calculate the size for. Buttons on a button bar can have three distinct sizes: ``wx.ribbon.RIBBON_BUTTONBAR_BUTTON_SMALL``, ``wx.ribbon.RIBBON_BUTTONBAR_BUTTON_MEDIUM``, and ``wx.ribbon.RIBBON_BUTTONBAR_BUTTON_LARGE``. If the requested size-class is not applicable, then ``False`` should be returned.   
      :type `size`: wx.ribbon.RibbonButtonBarButtonState
      :param `label`: The label of the button.   
      :type `label`: string
      :param `bitmap_size_large`: The size of all "large" bitmaps on the button bar.   
      :type `bitmap_size_large`: wx.Size
      :param `bitmap_size_small`: The size of all "small" bitmaps on the button bar.   
      :type `bitmap_size_small`: wx.Size
      :param `button_size`: The size, in pixels, of the button.   
      :type `button_size`: wx.Size
      :param `normal_region`: The region of the button which constitutes the normal button.   
      :type `normal_region`: wx.Rect
      :param `dropdown_region`: The region of the button which constitutes the dropdown button.  
      :type `dropdown_region`: wx.Rect
























      :rtype: `bool`



                  



      :returns: 

         ``True`` if a size exists for the button, ``False`` otherwise.   








   .. method:: GetColour(self, id)

      Get the value of a certain colour setting.                  

      `id`  can be one of the colour values of :ref:`wx.ribbon.RibbonArtSetting`.                  


      :param `id`: 
      :type `id`: int




      :rtype: :ref:`Colour`








   .. method:: GetColourScheme(self)

      Get the current colour scheme.                  

      Returns three colours such that if :meth:`SetColourScheme`   were called with them, the colour scheme would be restored to what it was when :meth:`SetColourScheme`   was last called. In practice, this usually means that the returned values are the three colours given in the last call to :meth:`SetColourScheme` , however if :meth:`SetColourScheme`   performs an idempotent operation upon the colours it is given (like clamping a component of the colour), then the returned values may not be the three colours given in the last call to :meth:`SetColourScheme` . If :meth:`SetColourScheme`   has not been called, then the returned values should result in a colour scheme similar to, if not identical to, the default colours of the art provider. Note that if :meth:`SetColour`   is called, then :meth:`GetColourScheme`   does not try and return a colour scheme similar to colours being used - it's return values are dependent upon the last values given to :meth:`SetColourScheme` , as described above. 









      :rtype: `tuple`



                 

      .. note:: The Python version of this method returns the three   scheme colours as a tuple of :class:`wx.Colour` objects.  



      :returns: 

         ( `primary`, `secondary`, `tertiary` ) 








   .. method:: GetFlags(self)

      Get the previously set style flags.                  

      :rtype: `long`








   .. method:: GetFont(self, id)

      Get the value of a certain font setting.                  

      `id`  can be one of the font values of :ref:`wx.ribbon.RibbonArtSetting`.                  


      :param `id`: 
      :type `id`: int




      :rtype: :ref:`Font`








   .. method:: GetGalleryClientSize(self, dc, wnd, size, client_offset, scroll_up_button, scroll_down_button, extension_button)

      Calculate the client size of a :ref:`wx.ribbon.RibbonGallery`  control for a given size.                  

      This should act as the inverse to :meth:`GetGallerySize` , and decrement the given size by enough to fit the gallery border, buttons, and other chrome. 




      :param `dc`: A device context to use if one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The gallery in question.   
      :type `wnd`: wx.ribbon.RibbonGallery
      :param `size`: The overall size to calculate the client size for.   
      :type `size`: wx.Size
      :param `client_offset`: The position within the given size at which the returned client size begins.   
      :type `client_offset`: wx.Point
      :param `scroll_up_button`: The rectangle within the given size which the scroll up button occupies.   
      :type `scroll_up_button`: wx.Rect
      :param `scroll_down_button`: The rectangle within the given size which the scroll down button occupies.   
      :type `scroll_down_button`: wx.Rect
      :param `extension_button`: The rectangle within the given size which the extension button occupies.   
      :type `extension_button`: wx.Rect


















      :rtype: :ref:`Size`



                  





   .. method:: GetGallerySize(self, dc, wnd, client_size)

      Calculate the size of a :ref:`wx.ribbon.RibbonGallery`  control for a given client size.                  

      This should increment the given size by enough to fit the gallery border, buttons, and any other chrome. 




      :param `dc`: A device context to use if one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The gallery in question.   
      :type `wnd`: wx.ribbon.RibbonGallery
      :param `client_size`: The client size.  
      :type `client_size`: wx.Size










      :rtype: :ref:`Size`



                  



      .. seealso:: :meth:`GetGalleryClientSize`     








   .. method:: GetMetric(self, id)

      Get the value of a certain integer setting.                  

      `id`  can be one of the size values of :ref:`wx.ribbon.RibbonArtSetting`.                  


      :param `id`: 
      :type `id`: int




      :rtype: `int`








   .. method:: GetMinimisedPanelMinimumSize(self, dc, wnd, desired_bitmap_size, expanded_panel_direction)

      Calculate the size of a minimised ribbon panel.                  




      :param `dc`: A device context to use when one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The ribbon panel in question. Attributes like the panel label can be queried from this.   
      :type `wnd`: wx.ribbon.RibbonPanel
      :param `desired_bitmap_size`: Optional parameter which is filled with the size of the bitmap suitable for a minimised ribbon panel.   
      :type `desired_bitmap_size`: wx.Size
      :param `expanded_panel_direction`: Optional parameter which is filled with the direction of the minimised panel ( ``EAST``   or   ``SOUTH``   depending on the style).    
      :type `expanded_panel_direction`: wx.DataObject.Direction












      :rtype: :ref:`Size`



                  





   .. method:: GetPageBackgroundRedrawArea(self, dc, wnd, page_old_size, page_new_size)

      Calculate the portion of a page background which needs to be redrawn when a page is resized.                  

      To optimise the drawing of page backgrounds, as small an area as possible should be returned. Of course, if the way in which a background is drawn means that the entire background needs to be repainted on resize, then the entire new size should be returned. 




      :param `dc`: A device context to use when one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The page which is being resized.   
      :type `wnd`: wx.ribbon.RibbonPage
      :param `page_old_size`: The size of the page prior to the resize (which has already been painted).   
      :type `page_old_size`: wx.Size
      :param `page_new_size`: The size of the page after the resize.   
      :type `page_new_size`: wx.Size












      :rtype: :ref:`Rect`



                  





   .. method:: GetPanelClientSize(self, dc, wnd, size, client_offset)

      Calculate the client size of a panel for a given overall size.                  

      This should act as the inverse to :meth:`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.   
      :type `dc`: wx.DC
      :param `wnd`: The ribbon panel in question.   
      :type `wnd`: wx.ribbon.RibbonPanel
      :param `size`: The overall size to calculate client size for.   
      :type `size`: wx.Size
      :param `client_offset`: The offset where the returned client size begins within the given  `size`  (may be ``None``).  
      :type `client_offset`: wx.Point












      :rtype: :ref:`Size`



                  



      .. seealso:: :meth:`GetPanelSize`     








   .. method:: GetPanelExtButtonArea(self, dc, wnd, rect)

      Calculate the position and size of the panel extension button.                  




      :param `dc`: A device context to use if one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The ribbon panel in question.   
      :type `wnd`: wx.ribbon.RibbonPanel
      :param `rect`: The panel rectangle from which calculate extension button rectangle.  
      :type `rect`: wx.Rect










      :rtype: :ref:`Rect`



                  



      .. versionadded:: 2.9.4 
     








   .. method:: GetPanelSize(self, dc, wnd, client_size, client_offset)

      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.   
      :type `dc`: wx.DC
      :param `wnd`: The ribbon panel in question.   
      :type `wnd`: wx.ribbon.RibbonPanel
      :param `client_size`: The client size.   
      :type `client_size`: wx.Size
      :param `client_offset`: The offset where the client rectangle begins within the panel (may be ``None``).  
      :type `client_offset`: wx.Point












      :rtype: :ref:`Size`



                  



      .. seealso:: :meth:`GetPanelClientSize`     








   .. method:: GetRibbonHelpButtonArea(self, rect)

      Calculate the position and size of the ribbon's help button.                  




      :param `rect`: The ribbon bar rectangle from which calculate help button rectangle.  
      :type `rect`: wx.Rect






      :rtype: :ref:`Rect`



                  



      .. versionadded:: 2.9.5 
     








   .. 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.   
      :type `dc`: wx.DC
      :param `wnd`: The window onto which the scroll button will eventually be drawn.   
      :type `wnd`: wx.Window
      :param `style`: A combination of flags from :ref:`wx.ribbon.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).   
      :type `style`: long










      :rtype: :ref:`Size`



                  





   .. 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.   
      :type `dc`: wx.DC
      :param `wnd`: The window onto which the tabs will eventually be drawn.   
      :type `wnd`: wx.Window
      :param `pages`: The tabs which will acquire the returned height.   
      :type `pages`: RibbonPageTabInfoArray










      :rtype: `int`



                  





   .. method:: GetToolSize(self, dc, wnd, bitmap_size, kind, is_first, is_last, dropdown_region)

      Calculate the size of a tool within a :ref:`wx.ribbon.RibbonToolBar`.                  




      :param `dc`: A device context to use when one is required for size calculations.   
      :type `dc`: wx.DC
      :param `wnd`: The window onto which the tool will eventually be drawn.   
      :type `wnd`: wx.Window
      :param `bitmap_size`: The size of the tool's foreground bitmap.   
      :type `bitmap_size`: wx.Size
      :param `kind`: The kind of tool (normal, dropdown, or hybrid).   
      :type `kind`: wx.ribbon.RibbonButtonKind
      :param `is_first`: ``True`` if the tool is the first within its group. ``False`` otherwise.   
      :type `is_first`: bool
      :param `is_last`: ``True`` if the tool is the last within its group. ``False`` otherwise.   
      :type `is_last`: bool
      :param `dropdown_region`: For dropdown and hybrid tools, the region within the returned size which counts as the dropdown part.   
      :type `dropdown_region`: wx.Rect


















      :rtype: :ref:`Size`



                  





   .. method:: SetColour(self, id, colour)

      Set the value of a certain colour setting to the value `colour`.                  

      `id`  can be one of the colour values of :ref:`wx.ribbon.RibbonArtSetting`, though not all colour settings will have an effect on every art provider. 

                


      :param `id`: 
      :type `id`: int
      :param `colour`: 
      :type `colour`: wx.Colour






      .. seealso:: :meth:`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`: 
      :type `primary`: wx.Colour
      :param `secondary`: 
      :type `secondary`: wx.Colour
      :param `tertiary`: 
      :type `tertiary`: wx.Colour






      .. seealso:: :meth:`SetColour`     







      .. seealso:: :meth:`GetColourScheme`     








   .. method:: SetFlags(self, flags)

      Set the style flags.                  

      Normally called automatically by :meth:`wx.ribbon.RibbonBar.SetArtProvider`   with the ribbon bar's style flags, so that the art provider has the same flags as the bar which it is serving.                  


      :param `flags`: 
      :type `flags`: long







   .. method:: SetFont(self, id, font)

      Set the value of a certain font setting to the value `font`.                  

      `id`  can be one of the font values of :ref:`wx.ribbon.RibbonArtSetting`.                  


      :param `id`: 
      :type `id`: int
      :param `font`: 
      :type `font`: wx.Font







   .. method:: SetMetric(self, id, new_val)

      Set the value of a certain integer setting to the value `new_val`.                  

      `id`  can be one of the size values of :ref:`wx.ribbon.RibbonArtSetting`.                  


      :param `id`: 
      :type `id`: int
      :param `new_val`: 
      :type `new_val`: int







   .. attribute:: Flags

      See :meth:`~wx.ribbon.RibbonMSWArtProvider.GetFlags` and :meth:`~wx.ribbon.RibbonMSWArtProvider.SetFlags`

