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

.. highlight:: python



.. _wx.lib.agw.flatnotebook.FNBRenderer:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.flatnotebook.FNBRenderer**
==========================================================================================================================================

Parent class for the 6 renderers defined: `Standard`, `VC71`, `Fancy`, `Firefox 2`,
`VC8` and `Ribbon`. This class implements the common methods of all 6 renderers.



|

|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>FNBRenderer</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.flatnotebook.FNBRenderer_inheritance.png" alt="Inheritance diagram of FNBRenderer" 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.flatnotebook.FNBRenderer.html" title="Parent class for the 6 renderers defined: `Standard`, `VC71`, `Fancy`, `Firefox 2`," alt="" coords="5,5,280,35"/> </map> 
   </p>
   </div>

|


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

:class:`wx.lib.agw.flatnotebook.FNBRendererDefault`, :class:`wx.lib.agw.flatnotebook.FNBRendererFancy`, :class:`wx.lib.agw.flatnotebook.FNBRendererFirefox2`, :class:`wx.lib.agw.flatnotebook.FNBRendererRibbonTabs`, :class:`wx.lib.agw.flatnotebook.FNBRendererVC71`, :class:`wx.lib.agw.flatnotebook.FNBRendererVC8`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.__init__`                            Default class constructor.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.CalcTabHeight`                       Calculates the height of the input tab.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.CalcTabWidth`                        Calculates the width of the input tab.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawArrowAccordingToState`           Draws the left and right scrolling arrows.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawDragHint`                        Draws tab drag hint, the default implementation is to do nothing.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawDropDownArrow`                   Draws the drop-down arrow in the navigation area.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawFocusRectangle`                  Draws a focus rectangle like the native :class:`Notebook`.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawLeftArrow`                       Draws the left navigation arrow.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawRightArrow`                      Draws the right navigation arrow.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawTabs`                            Actually draws the tabs in :class:`FlatNotebook`.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawTabsLine`                        Draws a line over the tabs.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawTabX`                            Draws the 'X' in the selected tab.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.DrawX`                               Draw the 'X' navigation button in the navigation area.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.GetButtonsAreaLength`                Returns the navigation area width.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.GetDropArrowButtonPos`               Returns the drop down button position in the navigation area.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.GetLeftButtonPos`                    Returns the left button position in the navigation area.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.GetRightButtonPos`                   Returns the right button position in the navigation area.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.GetXPos`                             Returns the 'X' button position in the navigation area.
:meth:`~wx.lib.agw.flatnotebook.FNBRenderer.NumberTabsCanFit`                    Calculates the number of tabs that can fit on the available space on screen.
================================================================================ ================================================================================


|


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


.. class:: FNBRenderer(object)

   Parent class for the 6 renderers defined: `Standard`, `VC71`, `Fancy`, `Firefox 2`,
   `VC8` and `Ribbon`. This class implements the common methods of all 6 renderers.

   .. method:: __init__(self)

      Default class constructor. 


   .. method:: CalcTabHeight(self, pageContainer)

      Calculates the height of the input tab.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`.


   .. method:: CalcTabWidth(self, pageContainer, tabIdx, tabHeight)

      Calculates the width of the input tab.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `tabIdx`: the index of the input tab;
      :param `tabHeight`: the height of the tab.


   .. method:: DrawArrowAccordingToState(self, dc, pc, rect)

      Draws the left and right scrolling arrows.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `pc`: an instance of :class:`FlatNotebook`;
      :param `rect`: the client rectangle containing the scrolling arrows.


   .. method:: DrawDragHint(self, pc, tabIdx)

      Draws tab drag hint, the default implementation is to do nothing.
      You can override this function to provide a nice feedback to user.
      
      :param `pc`: an instance of :class:`FlatNotebook`;
      :param `tabIdx`: the index of the tab we are dragging.
      
      .. note:: To show your own custom drag and drop UI feedback, you must override
       this method in your derived class.


   .. method:: DrawDropDownArrow(self, pageContainer, dc)

      Draws the drop-down arrow in the navigation area.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawFocusRectangle(self, dc, pageContainer, page)

      Draws a focus rectangle like the native :class:`Notebook`.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `page`: an instance of :class:`PageInfo`, representing a page in the notebook.


   .. method:: DrawLeftArrow(self, pageContainer, dc)

      Draws the left navigation arrow.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawRightArrow(self, pageContainer, dc)

      Draws the right navigation arrow.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawTabs(self, pageContainer, dc)

      Actually draws the tabs in :class:`FlatNotebook`.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawTabsLine(self, pageContainer, dc, selTabX1=-1, selTabX2=-1)

      Draws a line over the tabs.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`;
      :param `selTabX1`: first x coordinate of the tab line;
      :param `selTabX2`: second x coordinate of the tab line.


   .. method:: DrawTabX(self, pageContainer, dc, rect, tabIdx, btnStatus)

      Draws the 'X' in the selected tab.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`;
      :param `rect`: the current tab client rectangle;
      :param `tabIdx`: the index of the current tab;
      :param `btnStatus`: the status of the 'X' button in the current tab.


   .. method:: DrawX(self, pageContainer, dc)

      Draw the 'X' navigation button in the navigation area.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: GetButtonsAreaLength(self, pageContainer)

      Returns the navigation area width.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`.


   .. method:: GetDropArrowButtonPos(self, pageContainer)

      Returns the drop down button position in the navigation area.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`.


   .. method:: GetLeftButtonPos(self, pageContainer)

      Returns the left button position in the navigation area.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`.


   .. method:: GetRightButtonPos(self, pageContainer)

      Returns the right button position in the navigation area.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`.


   .. method:: GetXPos(self, pageContainer)

      Returns the 'X' button position in the navigation area.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`.


   .. method:: NumberTabsCanFit(self, pageContainer, fr=-1)

      Calculates the number of tabs that can fit on the available space on screen.
      
      :param `pageContainer`: an instance of :class:`FlatNotebook`;
      :param `fr`: the current first visible tab.