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

.. currentmodule:: wx.lib.agw.buttonpanel

.. highlight:: python



.. _wx.lib.agw.buttonpanel.Control:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.buttonpanel.Control**
==========================================================================================================================================

This class represents a base class for all pseudo controls used in
:class:`ButtonPanel`.



|

|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>Control</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.buttonpanel.Control_inheritance.png" alt="Inheritance diagram of Control" 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.buttonpanel.Control.html" title="wx.lib.agw.buttonpanel.Control" alt="" coords="5,160,229,189"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="59,83,176,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="14,5,101,35"/> <area shape="rect" id="node4" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="125,5,232,35"/> </map> 
   </p>
   </div>

|


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

:class:`wx.lib.agw.buttonpanel.ButtonInfo`, :class:`wx.lib.agw.buttonpanel.ButtonPanelText`, :class:`wx.lib.agw.buttonpanel.Separator`

|


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

:class:`wx.EvtHandler`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.buttonpanel.Control.__init__`                                 Default class constructor.
:meth:`~wx.lib.agw.buttonpanel.Control.Disable`                                  Disables the control.
:meth:`~wx.lib.agw.buttonpanel.Control.Draw`                                     Handles the drawing of the control.
:meth:`~wx.lib.agw.buttonpanel.Control.Enable`                                   Enable or disable the window for user input.
:meth:`~wx.lib.agw.buttonpanel.Control.GetBestSize`                              This functions returns the best acceptable minimal size for the window. For
:meth:`~wx.lib.agw.buttonpanel.Control.GetId`                                    Returns the identifier of the window.
:meth:`~wx.lib.agw.buttonpanel.Control.HasFocus`                                 Returns whether the control has the focus or not.
:meth:`~wx.lib.agw.buttonpanel.Control.Hide`                                     Hides the control.
:meth:`~wx.lib.agw.buttonpanel.Control.IsShown`                                  Returns ``True`` if the window is shown, ``False`` if it has been hidden.
:meth:`~wx.lib.agw.buttonpanel.Control.OnMouseEvent`                             Handles the ``wx.EVT_MOUSE_EVENTS`` events for the control.
:meth:`~wx.lib.agw.buttonpanel.Control.SetFocus`                                 Sets or kills the focus on the control.
:meth:`~wx.lib.agw.buttonpanel.Control.Show`                                     Shows or hide the control.
================================================================================ ================================================================================


|


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


.. class:: Control(wx.EvtHandler)

   This class represents a base class for all pseudo controls used in
   :class:`ButtonPanel`.

   .. method:: __init__(self, parent, size=wx.Size(-1, -1), id=wx.ID_ANY)

      Default class constructor.
      
      :param wx.Window `parent`: the control parent object. Must not be ``None``;
      :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;
      :type `size`: tuple or :class:`wx.Size`
      :param integer `id`: window identifier. A value of -1 indicates a default value.


   .. method:: Disable(self)

      Disables the control.
      
      :returns: ``True`` if the window has been disabled, ``False`` if it had been
       already disabled before the call to this function.
      
      :note: This is functionally equivalent of calling :meth:`~Control.Enable` with a ``False`` flag.


   .. method:: Draw(self, rect)

      Handles the drawing of the control.
      
      :param wx.Rect `rect`: the control client rectangle.


   .. method:: Enable(self, enable=True)

      Enable or disable the window for user input.
      
      :param bool `enable`: If ``True``, enables the window for input. If ``False``, disables the window.
      
      :returns: ``True`` if the window has been enabled or disabled, ``False`` if nothing was
       done, i.e. if the window had already been in the specified state.
      
      :note: Note that when a parent window is disabled, all of its children are disabled as
       well and they are reenabled again when the parent is.


   .. method:: GetBestSize(self)

      This functions returns the best acceptable minimal size for the window. For
      example, for a static control, it will be the minimal size such that the control
      label is not truncated. For windows containing subwindows (typically :class:`Panel`),
      the size returned by this function will be the same as the size the window would
      have had after calling `Fit()`.
      
      :return: An instance of :class:`wx.Size`.


   .. method:: GetId(self)

      Returns the identifier of the window.
      
      :return: An integer representing the identifier of the window.
      
      :note: Each window has an integer identifier. If the application has not provided
       one (or the default ``wx.ID_ANY``) an unique identifier with a negative value will
       be generated.


   .. method:: HasFocus(self)

      Returns whether the control has the focus or not.
      
      :return: ``True`` if the control has the focus, ``False`` otherwise.


   .. method:: Hide(self)

      Hides the control.
      
      :note: This is functionally equivalent of calling :meth:`~Control.Show` with a ``False`` input.


   .. method:: IsShown(self)

      Returns ``True`` if the window is shown, ``False`` if it has been hidden. 


   .. method:: OnMouseEvent(self, x, y, event)

      Handles the ``wx.EVT_MOUSE_EVENTS`` events for the control.
      
      :param integer `x`: the mouse `x` position;
      :param integer `y`: the mouse `y` position;
      :param `event`: the :class:`MouseEvent` event to be processed.


   .. method:: SetFocus(self, focus=True)

      Sets or kills the focus on the control.
      
      :param bool `focus`: whether the control can receive keyboard inputs or not.


   .. method:: Show(self, show=True)

      Shows or hide the control.
      
      :param bool `show`: If ``True`` displays the window. Otherwise, it hides it.


