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

==========================================================================================================================================
|phoenix_title|  **wx.Choicebook**
==========================================================================================================================================

:ref:`wx.Choicebook`  is a class similar to :ref:`wx.Notebook`, but uses a :ref:`wx.Choice`  control to show the labels instead of the tabs.          

For usage documentation of this class, please refer to the base abstract class BookCtrl. You can also use the :ref:`Notebook Sample <notebook sample>`  to see :ref:`wx.Choicebook`  in action. 

:ref:`wx.Choicebook`  allows the use of `BookCtrlBase.GetControlSizer(),` allowing a program to add other controls next to the choice control. This is particularly useful when screen space is restricted, as it often is when :ref:`wx.Choicebook`  is being employed. 





.. _Choicebook-styles:

|styles| Window Styles
================================

This class supports the following styles: 

  

- ``wx.CHB_DEFAULT``: Choose the default location for the labels depending on the current platform (but currently it's the same everywhere, namely ``wx.CHB_TOP``).  
- ``wx.CHB_TOP``: Place labels above the page area.  
- ``wx.CHB_LEFT``: Place labels on the left side.  
- ``wx.CHB_RIGHT``: Place labels on the right side.  
- ``wx.CHB_BOTTOM``: Place labels below the page area.  








.. _Choicebook-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.BookCtrlEvent` parameter.


- EVT_CHOICEBOOK_PAGE_CHANGED: The page selection was changed. Processes a  ``wxEVT_CHOICEBOOK_PAGE_CHANGED``   event.   
- EVT_CHOICEBOOK_PAGE_CHANGING: The page selection is about to be changed. Processes a  ``wxEVT_CHOICEBOOK_PAGE_CHANGING``   event. This event can be vetoed (using  :meth:`wx.NotifyEvent.Veto` ).  








         



.. seealso:: :ref:`BookCtrl Overview <bookctrl overview>`, :ref:`wx.Notebook`, :ref:`Notebook Sample <notebook sample>`    







|

|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>Choicebook</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.Choicebook_inheritance.png" alt="Inheritance diagram of Choicebook" 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.Choicebook.html" title="wx.Choicebook" alt="" coords="113,392,235,421"/> <area shape="rect" id="node2" href="wx.BookCtrlBase.html" title="wx.BookCtrlBase" alt="" coords="107,315,241,344"/> <area shape="rect" id="node3" href="wx.Control.html" title="wx.Control" alt="" coords="63,237,155,267"/> <area shape="rect" id="node4" href="wx.WithImages.html" title="wx.WithImages" alt="" coords="179,237,302,267"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="60,160,157,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="50,83,167,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="117,5,223,35"/> </map> 
   </p>
   </div>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.choicebook.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/wx.choicebook.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.choicebook.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|


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

================================================================================ ================================================================================
:meth:`~wx.Choicebook.__init__`                                                  Constructs a choicebook control.
:meth:`~wx.Choicebook.Create`                                                    Create the choicebook control that has already been constructed with the default constructor.
:meth:`~wx.Choicebook.GetChoiceCtrl`                                             Returns the :ref:`wx.Choice`  associated with the control.
:meth:`~wx.Choicebook.GetClassDefaultAttributes`                                 
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.Choicebook.ChoiceCtrl`                                                See :meth:`~wx.Choicebook.GetChoiceCtrl`
================================================================================ ================================================================================


|


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


.. class:: wx.Choicebook(BookCtrlBase)

   **Possible constructors**::

       Choicebook()
       
       Choicebook(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
                  style=0, name=EmptyString)
       
   
   Choicebook is a class similar to Notebook, but uses a Choice
   control to show the labels instead of the tabs.



   .. method:: __init__(self, *args, **kw)

      Constructs a choicebook control.                   


      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=EmptyString)`
      
      
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `name`: 
      :type `name`: string
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name=EmptyString)

      Create the choicebook control that has already been constructed with the default constructor.                  


      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `name`: 
      :type `name`: string




      :rtype: `bool`








   .. method:: GetChoiceCtrl(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **GetChoiceCtrl** `(self)`
      
      Returns the :ref:`wx.Choice`  associated with the control.                  
      
      :rtype: :ref:`wx.Choice`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **GetChoiceCtrl** `(self)`
      
      Returns the choice control used for selecting pages. 
      
      :rtype: :ref:`wx.Choice`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)




      :param `variant`: 
      :type `variant`: wx.WindowVariant




      :rtype: :ref:`wx.VisualAttributes`








   .. attribute:: ChoiceCtrl

      See :meth:`~wx.Choicebook.GetChoiceCtrl`

