.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.aui.tabart

.. highlight:: python



.. _wx.lib.agw.aui.tabart.AuiDefaultTabArt:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.aui.tabart.AuiDefaultTabArt**
==========================================================================================================================================

Tab art provider code - a tab provider provides all drawing functionality to the :class:`~wx.lib.agw.aui.auibook.AuiNotebook`.
This allows the :class:`~wx.lib.agw.aui.auibook.AuiNotebook` to have a plugable look-and-feel.

By default, a :class:`~wx.lib.agw.aui.auibook.AuiNotebook` uses an instance of this class called
:class:`AuiDefaultTabArt` which provides bitmap art 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. Call :meth:`AuiNotebook.SetArtProvider() <lib.agw.aui.auibook.AuiNotebook.SetArtProvider>` to make use 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>AuiDefaultTabArt</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.lib.agw.aui.tabart.AuiDefaultTabArt_inheritance.png" alt="Inheritance diagram of AuiDefaultTabArt" 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.lib.agw.aui.tabart.AuiDefaultTabArt.html" title="Tab art provider code - a tab provider provides all drawing functionality to the wx.lib.agw.aui.auibook.AuiNotebook." alt="" coords="5,5,287,35"/> </map> 
   </p>
   </div>

|


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

:class:`wx.lib.agw.aui.tabart.ChromeTabArt`, :class:`wx.lib.agw.aui.tabart.FF2TabArt`, :class:`wx.lib.agw.aui.tabart.VC71TabArt`, :class:`wx.lib.agw.aui.tabart.VC8TabArt`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.__init__`                         Default class constructor.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.Clone`                            Clones the art object.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.DrawBackground`                   Draws the tab area background.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.DrawButton`                       Draws a button on the tab or on the tab area, depending on the button identifier.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.DrawFocusRectangle`               Draws the focus rectangle on a tab.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.DrawTab`                          Draws a single tab.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetAGWFlags`                      Returns the tab art flags.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetBestTabCtrlSize`               Returns the best tab control size.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetIndentSize`                    Returns the tabs indent size.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetMeasuringFont`                 Returns the font for calculating text measurements.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetNormalFont`                    Returns the normal font for drawing tab labels.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetSelectedFont`                  Returns the selected tab font for drawing tab labels.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.GetTabSize`                       Returns the tab size for the given caption, bitmap and button state.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetAGWFlags`                      Sets the tab art flags.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetBaseColour`                    Sets a new base colour.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetCustomButton`                  Sets a custom bitmap for the close, left, right and window list buttons.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetDefaultColours`                Sets the default colours, which are calculated from the given base colour.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetMeasuringFont`                 Sets the font for calculating text measurements.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetNormalFont`                    Sets the normal font for drawing tab labels.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetSelectedFont`                  Sets the selected tab font for drawing tab labels.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.SetSizingInfo`                    Sets the tab sizing information.
:meth:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt.ShowDropDown`                     Shows the drop-down window menu on the tab area.
================================================================================ ================================================================================


|


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


.. class:: AuiDefaultTabArt(object)

   Tab art provider code - a tab provider provides all drawing functionality to the :class:`~wx.lib.agw.aui.auibook.AuiNotebook`.
   This allows the :class:`~wx.lib.agw.aui.auibook.AuiNotebook` to have a plugable look-and-feel.
   
   By default, a :class:`~wx.lib.agw.aui.auibook.AuiNotebook` uses an instance of this class called
   :class:`AuiDefaultTabArt` which provides bitmap art 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. Call :meth:`AuiNotebook.SetArtProvider() <lib.agw.aui.auibook.AuiNotebook.SetArtProvider>` to make use this
   new tab art.

   .. method:: __init__(self)

      Default class constructor. 


   .. method:: Clone(self)

      Clones the art object. 


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

      Draws the tab area background.
      
      :param `dc`: a :class:`wx.DC` device context;
      :param `wnd`: a :class:`wx.Window` instance object;
      :param wx.Rect `rect`: the tab control rectangle.


   .. method:: DrawButton(self, dc, wnd, in_rect, button, orientation)

      Draws a button on the tab or on the tab area, depending on the button identifier.
      
      :param `dc`: a :class:`wx.DC` device context;
      :param `wnd`: a :class:`wx.Window` instance object;
      :param wx.Rect `in_rect`: rectangle the tab should be confined to;
      :param `button`: an instance of the button class;
      :param integer `orientation`: the tab orientation.


   .. method:: DrawFocusRectangle(self, dc, page, wnd, draw_text, text_offset, bitmap_offset, drawn_tab_yoff, drawn_tab_height, textx, texty)

      Draws the focus rectangle on a tab.
      
      :param `dc`: a :class:`wx.DC` device context;
      :param `page`: the page associated with the tab;
      :param `wnd`: a :class:`wx.Window` instance object;
      :param string `draw_text`: the text that has been drawn on the tab;
      :param integer `text_offset`: the text offset on the tab;
      :param integer `bitmap_offset`: the bitmap offset on the tab;
      :param integer `drawn_tab_yoff`: the y offset of the tab text;
      :param integer `drawn_tab_height`: the height of the tab;
      :param integer `textx`: the x text extent;
      :param integer `texty`: the y text extent.


   .. method:: DrawTab(self, dc, wnd, page, in_rect, close_button_state, paint_control=False)

      Draws a single tab.
      
      :param `dc`: a :class:`wx.DC` device context;
      :param `wnd`: a :class:`wx.Window` instance object;
      :param `page`: the tab control page associated with the tab;
      :param wx.Rect `in_rect`: rectangle the tab should be confined to;
      :param integer `close_button_state`: the state of the close button on the tab;
      :param bool `paint_control`: whether to draw the control inside a tab (if any) on a :class:`MemoryDC`.


   .. method:: GetAGWFlags(self)

      Returns the tab art flags.
      
      .. seealso:: :meth:`~AuiDefaultTabArt.SetAGWFlags` for a list of possible return values.


   .. method:: GetBestTabCtrlSize(self, wnd, pages, required_bmp_size)

      Returns the best tab control size.
      
      :param `wnd`: a :class:`wx.Window` instance object;
      :param list `pages`: the pages associated with the tabs;
      :param wx.Size `required_bmp_size`: the size of the bitmap on the tabs.


   .. method:: GetIndentSize(self)

      Returns the tabs indent size. 


   .. method:: GetMeasuringFont(self)

      Returns the font for calculating text measurements. 


   .. method:: GetNormalFont(self)

      Returns the normal font for drawing tab labels. 


   .. method:: GetSelectedFont(self)

      Returns the selected tab font for drawing tab labels. 


   .. method:: GetTabSize(self, dc, wnd, caption, bitmap, active, close_button_state, control=None)

      Returns the tab size for the given caption, bitmap and button state.
      
      :param `dc`: a :class:`wx.DC` device context;
      :param `wnd`: a :class:`wx.Window` instance object;
      :param string `caption`: the tab text caption;
      :param wx.Bitmap `bitmap`: the bitmap displayed on the tab;
      :param bool `active`: whether the tab is selected or not;
      :param integer `close_button_state`: the state of the close button on the tab;
      :param wx.Window `control`: a :class:`wx.Window` instance inside a tab (or ``None``).


   .. method:: SetAGWFlags(self, agwFlags)

      Sets the tab art flags.
      
      :param integer `agwFlags`: a combination of the following values:
      
       ==================================== ==================================
       Flag name                            Description
       ==================================== ==================================
       ``AUI_NB_TOP``                       With this style, tabs are drawn along the top of the notebook
       ``AUI_NB_LEFT``                      With this style, tabs are drawn along the left of the notebook. Not implemented yet.
       ``AUI_NB_RIGHT``                     With this style, tabs are drawn along the right of the notebook. Not implemented yet.
       ``AUI_NB_BOTTOM``                    With this style, tabs are drawn along the bottom of the notebook
       ``AUI_NB_TAB_SPLIT``                 Allows the tab control to be split by dragging a tab
       ``AUI_NB_TAB_MOVE``                  Allows a tab to be moved horizontally by dragging
       ``AUI_NB_TAB_EXTERNAL_MOVE``         Allows a tab to be moved to another tab control
       ``AUI_NB_TAB_FIXED_WIDTH``           With this style, all tabs have the same width
       ``AUI_NB_SCROLL_BUTTONS``            With this style, left and right scroll buttons are displayed
       ``AUI_NB_WINDOWLIST_BUTTON``         With this style, a drop-down list of windows is available
       ``AUI_NB_CLOSE_BUTTON``              With this style, a close button is available on the tab bar
       ``AUI_NB_CLOSE_ON_ACTIVE_TAB``       With this style, a close button is available on the active tab
       ``AUI_NB_CLOSE_ON_ALL_TABS``         With this style, a close button is available on all tabs
       ``AUI_NB_MIDDLE_CLICK_CLOSE``        Allows to close :class:`~wx.lib.agw.aui.auibook.AuiNotebook` tabs by mouse middle button click
       ``AUI_NB_SUB_NOTEBOOK``              This style is used by :class:`~wx.lib.agw.aui.framemanager.AuiManager` to create automatic AuiNotebooks
       ``AUI_NB_HIDE_ON_SINGLE_TAB``        Hides the tab window if only one tab is present
       ``AUI_NB_SMART_TABS``                Use Smart Tabbing, like ``Alt`` + ``Tab`` on Windows
       ``AUI_NB_USE_IMAGES_DROPDOWN``       Uses images on dropdown window list menu instead of check items
       ``AUI_NB_CLOSE_ON_TAB_LEFT``         Draws the tab close button on the left instead of on the right (a la Camino browser)
       ``AUI_NB_TAB_FLOAT``                 Allows the floating of single tabs. Known limitation: when the notebook is more or less
                                            full screen, tabs cannot be dragged far enough outside of the notebook to become floating pages
       ``AUI_NB_DRAW_DND_TAB``              Draws an image representation of a tab while dragging (on by default)
       ``AUI_NB_ORDER_BY_ACCESS``           Tab navigation order by last access time for the tabs
       ``AUI_NB_NO_TAB_FOCUS``              Don't draw tab focus rectangle
       ==================================== ==================================


   .. method:: SetBaseColour(self, base_colour)

      Sets a new base colour.
      
      :param `base_colour`: an instance of :class:`wx.Colour`.


   .. method:: SetCustomButton(self, bitmap_id, button_state, bmp)

      Sets a custom bitmap for the close, left, right and window list buttons.
      
      :param integer `bitmap_id`: the button identifier;
      :param integer `button_state`: the button state;
      :param wx.Bitmap `bmp`: the custom bitmap to use for the button.


   .. method:: SetDefaultColours(self, base_colour=None)

      Sets the default colours, which are calculated from the given base colour.
      
      :param `base_colour`: an instance of :class:`wx.Colour`. If defaulted to ``None``, a colour
       is generated accordingly to the platform and theme.


   .. method:: SetMeasuringFont(self, font)

      Sets the font for calculating text measurements.
      
      :param wx.Font `font`: the new font to use to measure tab labels text extents.


   .. method:: SetNormalFont(self, font)

      Sets the normal font for drawing tab labels.
      
      :param wx.Font `font`: the new font to use to draw tab labels in their normal, un-selected state.


   .. method:: SetSelectedFont(self, font)

      Sets the selected tab font for drawing tab labels.
      
      :param wx.Font `font`: the new font to use to draw tab labels in their selected state.


   .. method:: SetSizingInfo(self, tab_ctrl_size, tab_count, minMaxTabWidth)

      Sets the tab sizing information.
      
      :param wx.Size `tab_ctrl_size`: the size of the tab control area;
      :param integer `tab_count`: the number of tabs;
      :param tuple `minMaxTabWidth`: a tuple containing the minimum and maximum tab widths
       to be used when the ``AUI_NB_TAB_FIXED_WIDTH`` style is active.


   .. method:: ShowDropDown(self, wnd, pages, active_idx)

      Shows the drop-down window menu on the tab area.
      
      :param `wnd`: a :class:`wx.Window` derived window instance;
      :param list `pages`: the pages associated with the tabs;
      :param integer `active_idx`: the active tab index.