1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
|
.. 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.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>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="56,83,167,112"/> <area shape="rect" id="node4" href="wx.lib.agw.buttonpanel.Control.html" title="wx.lib.agw.buttonpanel.Control" alt="" coords="5,160,219,189"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="13,5,95,35"/> <area shape="rect" id="node3" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="120,5,221,35"/> </map>
</p>
|
|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.
|