.. 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 ` to see :ref:`wx.Choicebook` in action. :ref:`wx.Choicebook` allows the use of :meth:`wx.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 `, :ref:`wx.Notebook`, :ref:`Notebook Sample ` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class Choicebook:
| |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="") 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:`

` **__init__** `(self)` :html:`

` **__init__** `(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name="")` :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:`

` .. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=0, name="") 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:`

` **GetChoiceCtrl** `(self)` Returns the :ref:`wx.Choice` associated with the control. :rtype: :ref:`wx.Choice` :html:`

` **GetChoiceCtrl** `(self)` Returns the choice control used for selecting pages. :rtype: :ref:`wx.Choice` :html:`

` .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: :ref:`wx.VisualAttributes` .. attribute:: ChoiceCtrl See :meth:`~wx.Choicebook.GetChoiceCtrl`