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

.. highlight:: python



.. _wx.lib.agw.labelbook.LabelContainer:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.labelbook.LabelContainer**
==========================================================================================================================================

Base class for :class:`LabelBook`. 



|

|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>LabelContainer</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.labelbook.LabelContainer_inheritance.png" alt="Inheritance diagram of LabelContainer" 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.labelbook.LabelContainer.html" title="Base class for LabelBook." alt="" coords="25,469,291,499"/> <area shape="rect" id="node2" href="wx.lib.agw.labelbook.ImageContainerBase.html" title="Base class for FlatImageBook image container." alt="" coords="5,392,311,421"/> <area shape="rect" id="node3" href="wx.Panel.html" title="A panel is a window on which controls are placed." alt="" coords="117,315,199,344"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="109,237,207,267"/> <area shape="rect" id="node5" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="93,160,223,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="99,83,217,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="53,5,141,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="165,5,276,35"/> </map> 
   </p>
   </div>

|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.agw.labelbook.ImageContainerBase`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.labelbook.LabelContainer.__init__`                            Default class constructor.
:meth:`~wx.lib.agw.labelbook.LabelContainer.CanDoBottomStyle`                    Allows the parent to examine the children type. Some implementation
:meth:`~wx.lib.agw.labelbook.LabelContainer.DrawBackgroundBitmap`                Draws a bitmap as the background of the control.
:meth:`~wx.lib.agw.labelbook.LabelContainer.DrawLabel`                           Draws a label using the specified dc.
:meth:`~wx.lib.agw.labelbook.LabelContainer.DrawRegularHover`                    Draws a rounded rectangle around the current tab.
:meth:`~wx.lib.agw.labelbook.LabelContainer.DrawWebHover`                        Draws a web style hover effect (cursor set to hand & text is underlined).
:meth:`~wx.lib.agw.labelbook.LabelContainer.GetColour`                           Returns a colour for a parameter.
:meth:`~wx.lib.agw.labelbook.LabelContainer.GetTabAreaWidth`                     Returns the width of the tab area.
:meth:`~wx.lib.agw.labelbook.LabelContainer.InitializeColours`                   Initializes the colours map to be used for this control.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnEraseBackground`                   Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnMouseLeaveWindow`                  Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnMouseLeftDown`                     Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnMouseLeftUp`                       Handles the ``wx.EVT_LEFT_UP`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnMouseMove`                         Handles the ``wx.EVT_MOTION`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnPaint`                             Handles the ``wx.EVT_PAINT`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.OnSize`                              Handles the ``wx.EVT_SIZE`` event for :class:`LabelContainer`.
:meth:`~wx.lib.agw.labelbook.LabelContainer.Resize`                              Actually resizes the tab area.
:meth:`~wx.lib.agw.labelbook.LabelContainer.SetBackgroundBitmap`                 Sets the background bitmap for the control.
:meth:`~wx.lib.agw.labelbook.LabelContainer.SetColour`                           Sets a colour for a parameter.
:meth:`~wx.lib.agw.labelbook.LabelContainer.SetTabAreaWidth`                     Sets the width of the tab area.
================================================================================ ================================================================================


|


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


.. class:: LabelContainer(ImageContainerBase)

   Base class for :class:`LabelBook`. 

   .. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="LabelContainer")

      Default class constructor.
      
      :param `parent`: parent window. Must not be ``None``;
      :param `id`: window identifier. A value of -1 indicates a default value;
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform;
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform;
      :param `style`: the underlying :class:`Panel` window style;
      :param `agwStyle`: the AGW-specific window style. This can be a combination of the
       following bits:
      
       =========================== =========== ==================================================
       Window Styles               Hex Value   Description
       =========================== =========== ==================================================
       ``INB_BOTTOM``                      0x1 Place labels below the page area. Available only for :class:`FlatImageBook`.
       ``INB_LEFT``                        0x2 Place labels on the left side. Available only for :class:`FlatImageBook`.
       ``INB_RIGHT``                       0x4 Place labels on the right side.
       ``INB_TOP``                         0x8 Place labels above the page area.
       ``INB_BORDER``                     0x10 Draws a border around :class:`LabelBook` or :class:`FlatImageBook`.
       ``INB_SHOW_ONLY_TEXT``             0x20 Shows only text labels and no images. Available only for :class:`LabelBook`.
       ``INB_SHOW_ONLY_IMAGES``           0x40 Shows only tab images and no label texts. Available only for :class:`LabelBook`.
       ``INB_FIT_BUTTON``                 0x80 Displays a pin button to show/hide the book control.
       ``INB_DRAW_SHADOW``               0x100 Draw shadows below the book tabs. Available only for :class:`LabelBook`.
       ``INB_USE_PIN_BUTTON``            0x200 Displays a pin button to show/hide the book control.
       ``INB_GRADIENT_BACKGROUND``       0x400 Draws a gradient shading on the tabs background. Available only for :class:`LabelBook`.
       ``INB_WEB_HILITE``                0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for :class:`LabelBook`.
       ``INB_NO_RESIZE``                0x1000 Don't allow resizing of the tab area.
       ``INB_FIT_LABELTEXT``            0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
       ``INB_BOLD_TAB_SELECTION``       0x4000 Show the selected tab text using a bold font.
       =========================== =========== ==================================================
      
      :param `name`: the window name.


   .. method:: CanDoBottomStyle(self)

      Allows the parent to examine the children type. Some implementation
      (such as :class:`LabelBook`), does not support top/bottom images, only left/right.


   .. method:: DrawBackgroundBitmap(self, dc)

      Draws a bitmap as the background of the control.
      
      :param `dc`: an instance of :class:`wx.DC`.


   .. method:: DrawLabel(self, dc, rect, text, bmp, imgInfo, orientationLeft, imgIdx, selected, hover)

      Draws a label using the specified dc.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `rect`: the text client rectangle;
      :param `text`: the actual text string;
      :param `bmp`: a bitmap to be drawn next to the text;
      :param `imgInfo`: an instance of :class:`wx.ImageInfo`;
      :param `orientationLeft`: ``True`` if the book has the ``INB_RIGHT`` or ``INB_LEFT``
       style set;
      :param `imgIdx`: the tab image index;
      :param `selected`: ``True`` if the tab is selected, ``False`` otherwise;
      :param `hover`: ``True`` if the tab is being hovered with the mouse, ``False`` otherwise.


   .. method:: DrawRegularHover(self, dc, rect)

      Draws a rounded rectangle around the current tab.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `rect`: the current tab client rectangle.


   .. method:: DrawWebHover(self, dc, caption, xCoord, yCoord, selected)

      Draws a web style hover effect (cursor set to hand & text is underlined).
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `caption`: the tab caption text;
      :param `xCoord`: the x position of the tab caption;
      :param `yCoord`: the y position of the tab caption;
      :param `selected`: ``True`` if the tab is selected, ``False`` otherwise.


   .. method:: GetColour(self, which)

      Returns a colour for a parameter.
      
      :param `which`: the colour key.
      
      .. seealso:: :meth:`~LabelContainer.SetColour` for a list of valid colour keys.


   .. method:: GetTabAreaWidth(self)

      Returns the width of the tab area. 


   .. method:: InitializeColours(self)

      Initializes the colours map to be used for this control. 


   .. method:: OnEraseBackground(self, event)

      Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`EraseEvent` event to be processed.


   .. method:: OnMouseLeaveWindow(self, event)

      Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnMouseLeftDown(self, event)

      Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnMouseLeftUp(self, event)

      Handles the ``wx.EVT_LEFT_UP`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnMouseMove(self, event)

      Handles the ``wx.EVT_MOTION`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.


   .. method:: OnSize(self, event)

      Handles the ``wx.EVT_SIZE`` event for :class:`LabelContainer`.
      
      :param `event`: a :class:`wx.SizeEvent` event to be processed.


   .. method:: Resize(self, event)

      Actually resizes the tab area.
      
      :param `event`: an instance of :class:`wx.SizeEvent`.


   .. method:: SetBackgroundBitmap(self, bmp)

      Sets the background bitmap for the control.
      
      :param `bmp`: a valid :class:`wx.Bitmap` object.


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

      Sets a colour for a parameter.
      
      :param `which`: can be one of the following parameters:
      
       ================================== ======= ==================================
       Colour Key                          Value  Description
       ================================== ======= ==================================
       ``INB_TAB_AREA_BACKGROUND_COLOUR``     100 The tab area background colour
       ``INB_ACTIVE_TAB_COLOUR``              101 The active tab background colour
       ``INB_TABS_BORDER_COLOUR``             102 The tabs border colour
       ``INB_TEXT_COLOUR``                    103 The tab caption text colour
       ``INB_ACTIVE_TEXT_COLOUR``             104 The active tab caption text colour
       ``INB_HILITE_TAB_COLOUR``              105 The tab caption highlight text colour
       ================================== ======= ==================================
      
      :param `colour`: a valid :class:`wx.Colour` object.


   .. method:: SetTabAreaWidth(self, width)

      Sets the width of the tab area.
      
      :param `width`: the width of the tab area, in pixels.