********** wx.Control ********** Inheritance diagram for `wx.Control`: | .. inheritance-diagram:: wx.Control | Description =========== This is the base class for a control or "widget". A control is generally a small window which processes user input and/or displays one or more item of data. .. seealso:: `wx.Validator `_ Derived From ^^^^^^^^^^^^^ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.BitmapButton `_, `wx.BookCtrlBase `_, `wx.Button `_, `wx.CheckBox `_, `wx.CheckListBox `_, `wx.Choice `_, `wx.Choicebook `_, `wx.CollapsiblePane `_, `wx.ColourPickerCtrl `_, `wx.ComboBox `_, `wx.ContextHelpButton `_, `wx.ControlWithItems `_, `wx.DatePickerCtrl `_, `wx.DatePickerCtrlBase `_, `wx.DirFilterListCtrl `_, `wx.DirPickerCtrl `_, `wx.FilePickerCtrl `_, `wx.FontPickerCtrl `_, `wx.Gauge `_, `wx.GenericDatePickerCtrl `_, `wx.GenericDirCtrl `_, `wx.HyperlinkCtrl `_, `wx.ListBox `_, `wx.ListCtrl `_, `wx.ListView `_, `wx.Listbook `_, `wx.Notebook `_, `wx.PickerBase `_, `wx.PyControl `_, `wx.RadioBox `_, `wx.RadioButton `_, `wx.ScrollBar `_, `wx.SearchCtrl `_, `wx.Slider `_, `wx.SpinButton `_, `wx.SpinCtrl `_, `wx.StaticBitmap `_, `wx.StaticBox `_, `wx.StaticLine `_, `wx.StaticText `_, `wx.TextCtrl `_, `wx.ToggleButton `_, `wx.ToolBar `_, `wx.ToolBarBase `_, `wx.Toolbook `_, `wx.TreeCtrl `_, `wx.Treebook `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Command <#Command>`_ * `GetAlignment <#GetAlignment>`_ * `GetLabel <#GetLabel>`_ * `GetLabelText <#GetLabelText>`_ * `SetLabel <#SetLabel>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Alignment <#Alignment>`_ * `LabelText <#LabelText>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, validator=wx.DefaultValidator, name=wx.ControlNameStr) Create a Control. Normally you should only call this from a subclass' `__init__` as a plain old `wx.Control` is not very useful. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `validator` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.Control `_ -------- .. method:: Command(event) Simulates the effect of the user issuing a command to the item. **Parameters:** * `event` (`wx.CommandEvent <../Events/wx.CommandEvent.html>`_) .. seealso:: `wx.CommandEvent <../Events/wx.CommandEvent.html>`_ -------- .. method:: GetAlignment() Get the control alignment (left/right/centre, top/bottom/centre) | **Returns:** `int` -------- .. method:: GetLabel() Returns the control's text. | **Returns:** `string` .. note:: Note that the returned string contains the mnemonics (``&`` characters) if any, use `GetLabelText <#GetLabelText>`_ if they are undesired. -------- .. method:: GetLabelText() Returns the control's label or the given `label` string for the static version without the mnemonics characters. | **Returns:** `string` -------- .. method:: SetLabel(label) Sets the item's text. The ``&`` characters in the label are special and indicate that the following character is a mnemonic for this control and can be used to activate it from the keyboard (typically by using ``Alt`` key in combination with it). To insert a literal ampersand character, you need to double it, i.e. use ``&&``. **Parameters:** * `label` (string): the item label. -------- Properties ^^^^^^^^^^ .. attribute:: Alignment See `GetAlignment <#GetAlignment>`_ .. attribute:: LabelText See `GetLabelText <#GetLabelText>`_