.. 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



.. _wx.aui.AuiTabArt:

==========================================================================================================================================
|phoenix_title|  **wx.aui.AuiTabArt**
==========================================================================================================================================

Tab art provider defines all the drawing functions used by :ref:`wx.aui.AuiNotebook`. 
         

This allows the :ref:`wx.aui.AuiNotebook`  to have a pluggable look-and-feel. 

By default, a :ref:`wx.aui.AuiNotebook`  uses an instance of class AuiDefaultTabArt, derived from this class, which provides bitmaps and a colour scheme that is adapted to the major platforms' look. You can either derive from that class to alter its behaviour or write a completely new tab art class. 

Another example of creating a new :ref:`wx.aui.AuiNotebook`  tab bar is :ref:`wx.aui.AuiSimpleTabArt`. 

Call :meth:`wx.aui.AuiNotebook.SetArtProvider`   to make use of this new tab art. 









|

|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>AuiTabArt</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.aui.AuiTabArt_inheritance.svg" alt="Inheritance diagram of AuiTabArt" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.aui.AuiTabArt.html" title="Tab art provider defines all the drawing functions used by wx.aui.AuiNotebook." alt="" coords="5,5,154,34"/> </map> 
   </p>
   </div>

|


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

:ref:`wx.aui.AuiFlatTabArt`, :ref:`wx.aui.AuiGenericTabArt`, :ref:`wx.aui.AuiSimpleTabArt`

|


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

================================================================================ ================================================================================
:meth:`~wx.aui.AuiTabArt.__init__`                                               Constructor.
:meth:`~wx.aui.AuiTabArt.Clone`                                                  Clones the art object.
:meth:`~wx.aui.AuiTabArt.DrawBackground`                                         Draws a background on the given area.
:meth:`~wx.aui.AuiTabArt.DrawButton`                                             Draws a button.
:meth:`~wx.aui.AuiTabArt.DrawPageTab`                                            Draws a tab for the specified notebook page.
:meth:`~wx.aui.AuiTabArt.DrawTab`                                                Draws a tab.
:meth:`~wx.aui.AuiTabArt.GetButtonRect`                                          Returns the rectangle for the given button.
:meth:`~wx.aui.AuiTabArt.GetIndentSize`                                          Returns the indent size.
:meth:`~wx.aui.AuiTabArt.GetNormalFont`                                          Returns the font to use for normal, non-selected, tabs.
:meth:`~wx.aui.AuiTabArt.GetPageTabSize`                                         Returns the size of the tab for the specified notebook page.
:meth:`~wx.aui.AuiTabArt.GetSelectedFont`                                        Returns the font to use for the selected tab.
:meth:`~wx.aui.AuiTabArt.GetTabSize`                                             Returns the tab size for the given caption, bitmap and state.
:meth:`~wx.aui.AuiTabArt.SetActiveColour`                                        Sets the colour of the selected tab.
:meth:`~wx.aui.AuiTabArt.SetColour`                                              Sets the colour of the inactive tabs.
:meth:`~wx.aui.AuiTabArt.SetFlags`                                               Sets flags.
:meth:`~wx.aui.AuiTabArt.SetMeasuringFont`                                       Sets the font used for calculating measurements.
:meth:`~wx.aui.AuiTabArt.SetNormalFont`                                          Sets the normal font for drawing labels.
:meth:`~wx.aui.AuiTabArt.SetSelectedFont`                                        Sets the font for drawing text for selected UI elements.
:meth:`~wx.aui.AuiTabArt.SetSizingInfo`                                          Sets sizing information.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.aui.AuiTabArt.IndentSize`                                             See :meth:`~wx.aui.AuiTabArt.GetIndentSize`
:attr:`~wx.aui.AuiTabArt.NormalFont`                                             See :meth:`~wx.aui.AuiTabArt.GetNormalFont` and :meth:`~wx.aui.AuiTabArt.SetNormalFont`
:attr:`~wx.aui.AuiTabArt.SelectedFont`                                           See :meth:`~wx.aui.AuiTabArt.GetSelectedFont` and :meth:`~wx.aui.AuiTabArt.SetSelectedFont`
================================================================================ ================================================================================


|


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


.. class:: wx.aui.AuiTabArt(object)

   **Possible constructors**::

       AuiTabArt() -> None
       
   
   Tab art provider defines all the drawing functions used by
   AuiNotebook.



   .. method:: __init__(self)

      Constructor. 
                 

      :rtype: `None`     








   .. method:: Clone(self)

      Clones the art object. 
                 

      :rtype: :ref:`wx.aui.AuiTabArt`








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

      Draws a background on the given area. 
                 


      :param `dc`: 
      :type `dc`: wx.DC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `rect`: 
      :type `rect`: wx.Rect




      :rtype: `None`     








   .. method:: DrawButton(self, dc, wnd, in_rect, bitmap_id, button_state, orientation, out_rect)

      Draws a button. 
                 


      :param `dc`: 
      :type `dc`: wx.DC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `in_rect`: 
      :type `in_rect`: wx.Rect
      :param `bitmap_id`: 
      :type `bitmap_id`: int
      :param `button_state`: 
      :type `button_state`: int
      :param `orientation`: 
      :type `orientation`: int
      :param `out_rect`: 
      :type `out_rect`: wx.Rect




      :rtype: `None`     








   .. method:: DrawPageTab(self, dc, wnd, page, rect)

      Draws a tab for the specified notebook page. 
                 

      This function must be overridden if :meth:`DrawTab`   is not overridden and, also, if pinned tabs are used, as they are not supported by :meth:`DrawTab` . 

      The `pane`  contains the information about the page to draw, in particular its :meth:`wx.aui.AuiNotebookPage.buttons`   specifies the buttons to draw if it is not empty and receives the rectangles where they were drawn on output in the :meth:`wx.aui.AuiTabContainerButton.rect`   fields. 

      Note that if a button state is ``AUI_BUTTON_STATE_HIDDEN``, the effect is the same as not including this button at all, i.e. it is not drawn and the output field is not modified in this case. 

      The :meth:`wx.aui.AuiNotebookPage.rect`   field is also updated by this function to contain the bounding rectangle of the tab. 


                


      :param `dc`: 
      :type `dc`: wx.DC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `page`: 
      :type `page`: wx.aui.AuiNotebookPage
      :param `rect`: 
      :type `rect`: wx.Rect




      :rtype: `int`







      :returns: 

         The total horizontal span of the tab, which may be greater than the page bounding rectangle.  







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: DrawTab(self, dc, wnd, page, rect, close_button_state, out_tab_rect, out_button_rect, x_extent)

      Draws a tab. 
                 

      This function used to be pure virtual and so had to be overridden in the derived classes in the previous versions of wxWidgets, however since version 3.3.0 it doesn't have to be overridden if :meth:`DrawPageTab`   is overridden and, moreover, it is recommended to override :meth:`DrawPageTab`   instead of this function in the new code. 
                 


      :param `dc`: 
      :type `dc`: wx.DC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `page`: 
      :type `page`: wx.aui.AuiNotebookPage
      :param `rect`: 
      :type `rect`: wx.Rect
      :param `close_button_state`: 
      :type `close_button_state`: int
      :param `out_tab_rect`: 
      :type `out_tab_rect`: wx.Rect
      :param `out_button_rect`: 
      :type `out_button_rect`: wx.Rect
      :param `x_extent`: 
      :type `x_extent`: int




      :rtype: `None`     








   .. method:: GetButtonRect(self, dc, wnd, inRect, bitmapId, buttonState, orientation, outRect=nullptr)

      Returns the rectangle for the given button. 
                 

      This function is not pure virtual because it is only for multi-line tabs, but it must be implemented if ``wx.aui.AUI_NB_MULTILINE`` is used. 

      If specified, the returned rectangle must be filled with the same value as :meth:`DrawButton`   puts into its `outRect`  but here it can also be null in which case just its width is returned. 


                


      :param `dc`: 
      :type `dc`: wx.ReadOnlyDC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `inRect`: 
      :type `inRect`: wx.Rect
      :param `bitmapId`: 
      :type `bitmapId`: int
      :param `buttonState`: 
      :type `buttonState`: int
      :param `orientation`: 
      :type `orientation`: int
      :param `outRect`: 
      :type `outRect`: wx.Rect




      :rtype: `int`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetIndentSize(self)

      Returns the indent size. 
                 

      :rtype: `int`








   .. method:: GetNormalFont(self)

      Returns the font to use for normal, non-selected, tabs. 
                 

      By default, returns an invalid font, meaning that the font set for :ref:`wx.aui.AuiNotebook`  itself should be used. 

      This function should be overridden for :meth:`SetNormalFont`   to actually work. 


                

      :rtype: `Font`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetPageTabSize(self, dc, wnd, page, xExtent=nullptr)

      Returns the size of the tab for the specified notebook page. 
                 

      This function must be overridden if :meth:`GetTabSize`   is not overridden and, also, if pinned tabs are used, as they are not supported by :meth:`GetTabSize` . 


                


      :param `dc`: 
      :type `dc`: wx.ReadOnlyDC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `page`: 
      :type `page`: wx.aui.AuiNotebookPage
      :param `xExtent`: 
      :type `xExtent`: int




      :rtype: `Size`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetSelectedFont(self)

      Returns the font to use for the selected tab. 
                 

      By default, returns an invalid font, meaning that the font set for :ref:`wx.aui.AuiNotebook`  itself should be used. 

      This function should be overridden for :meth:`SetSelectedFont`   to actually work. 


                

      :rtype: `Font`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetTabSize(self, dc, wnd, caption, bitmap, active, close_button_state, x_extent)

      Returns the tab size for the given caption, bitmap and state. 
                 

      This function used to be pure virtual and so had to be overridden in the derived classes in the previous versions of wxWidgets, however since version 3.3.0 it doesn't have to be overridden if :meth:`GetPageTabSize`   is overridden and it is recommended to override :meth:`GetPageTabSize`   instead of this function in the new code. 
                 


      :param `dc`: 
      :type `dc`: wx.ReadOnlyDC
      :param `wnd`: 
      :type `wnd`: wx.Window
      :param `caption`: 
      :type `caption`: string
      :param `bitmap`: 
      :type `bitmap`: wx.BitmapBundle
      :param `active`: 
      :type `active`: bool
      :param `close_button_state`: 
      :type `close_button_state`: int
      :param `x_extent`: 
      :type `x_extent`: int




      :rtype: `Size`     








   .. method:: SetActiveColour(self, colour)

      Sets the colour of the selected tab. 
                 


                


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




      :rtype: `None`     







      .. versionadded:: 2.9.2 
     








   .. method:: SetColour(self, colour)

      Sets the colour of the inactive tabs. 
                 


                


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




      :rtype: `None`     







      .. versionadded:: 2.9.2 
     








   .. method:: SetFlags(self, flags)

      Sets flags. 
                 


      :param `flags`: 
      :type `flags`: int




      :rtype: `None`     








   .. method:: SetMeasuringFont(self, font)

      Sets the font used for calculating measurements. 
                 


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




      :rtype: `None`     








   .. method:: SetNormalFont(self, font)

      Sets the normal font for drawing labels. 
                 


                


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




      :rtype: `None`     







      .. seealso:: :meth:`GetNormalFont`     








   .. method:: SetSelectedFont(self, font)

      Sets the font for drawing text for selected UI elements. 
                 


                


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




      :rtype: `None`     







      .. seealso:: :meth:`GetSelectedFont`     








   .. method:: SetSizingInfo(self, tab_ctrl_size, tab_count, wnd=nullptr)

      Sets sizing information. 
                 

      The `wnd`  argument is only present in wxWidgets 3.1.6 and newer and is required, it only has nullptr default value for compatibility reasons. 
                 


      :param `tab_ctrl_size`: 
      :type `tab_ctrl_size`: wx.Size
      :param `tab_count`: 
      :type `tab_count`: int
      :param `wnd`: 
      :type `wnd`: wx.Window




      :rtype: `None`     








   .. attribute:: IndentSize

      See :meth:`~wx.aui.AuiTabArt.GetIndentSize`


   .. attribute:: NormalFont

      See :meth:`~wx.aui.AuiTabArt.GetNormalFont` and :meth:`~wx.aui.AuiTabArt.SetNormalFont`


   .. attribute:: SelectedFont

      See :meth:`~wx.aui.AuiTabArt.GetSelectedFont` and :meth:`~wx.aui.AuiTabArt.SetSelectedFont`

