.. 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.PickerBase: ========================================================================================================================================== |phoenix_title| **wx.PickerBase** ========================================================================================================================================== Base abstract class for all pickers which support an auxiliary text control. This class handles all positioning and sizing of the text control like a a horizontal :ref:`wx.BoxSizer` would do, with the text control on the left of the picker button. The proportion (see :ref:`wx.Sizer` documentation for more info about proportion values) of the picker control defaults to 1 when there isn't a text control associated (see ``PB_USE_TEXTCTRL`` style) and to 0 otherwise. ^^ .. _PickerBase-styles: |styles| Window Styles ================================ This class supports the following styles: - ``wx.PB_USE_TEXTCTRL``: Creates a text control to the left of the picker which is completely managed by this :ref:`wx.PickerBase` class. ^^ .. seealso:: :ref:`wx.ColourPickerCtrl` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class PickerBase:
| |sub_classes| Known Subclasses ============================== :ref:`wx.ColourPickerCtrl`, :ref:`wx.DirPickerCtrl`, :ref:`wx.FilePickerCtrl`, :ref:`wx.FontPickerCtrl` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.PickerBase.__init__` :meth:`~wx.PickerBase.CreateBase` :meth:`~wx.PickerBase.GetInternalMargin` Returns the margin (in pixel) between the picker and the text control. :meth:`~wx.PickerBase.GetPickerCtrl` Returns the native implementation of the real picker control. :meth:`~wx.PickerBase.GetPickerCtrlProportion` Returns the proportion value of the picker. :meth:`~wx.PickerBase.GetPickerStyle` :meth:`~wx.PickerBase.GetTextCtrl` Returns a pointer to the text control handled by this window or ``None`` if the ``PB_USE_TEXTCTRL`` style was not specified when this control was created. :meth:`~wx.PickerBase.GetTextCtrlProportion` Returns the proportion value of the text control. :meth:`~wx.PickerBase.GetTextCtrlStyle` :meth:`~wx.PickerBase.HasTextCtrl` Returns ``True`` if this window has a valid text control (i.e. if the ``PB_USE_TEXTCTRL`` style was given when creating this control). :meth:`~wx.PickerBase.IsPickerCtrlGrowable` Returns ``True`` if the picker control is growable. :meth:`~wx.PickerBase.IsTextCtrlGrowable` Returns ``True`` if the text control is growable. :meth:`~wx.PickerBase.PostCreation` :meth:`~wx.PickerBase.SetInternalMargin` Sets the margin (in pixel) between the picker and the text control. :meth:`~wx.PickerBase.SetPickerCtrl` :meth:`~wx.PickerBase.SetPickerCtrlGrowable` Sets the picker control as growable when ``grow`` is ``True``. :meth:`~wx.PickerBase.SetPickerCtrlProportion` Sets the proportion value of the picker. :meth:`~wx.PickerBase.SetTextCtrl` :meth:`~wx.PickerBase.SetTextCtrlGrowable` Sets the text control as growable when ``grow`` is ``True``. :meth:`~wx.PickerBase.SetTextCtrlProportion` Sets the proportion value of the text control. :meth:`~wx.PickerBase.UpdatePickerFromTextCtrl` :meth:`~wx.PickerBase.UpdateTextCtrlFromPicker` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.PickerBase.InternalMargin` See :meth:`~wx.PickerBase.GetInternalMargin` and :meth:`~wx.PickerBase.SetInternalMargin` :attr:`~wx.PickerBase.PickerCtrl` See :meth:`~wx.PickerBase.GetPickerCtrl` and :meth:`~wx.PickerBase.SetPickerCtrl` :attr:`~wx.PickerBase.PickerCtrlProportion` See :meth:`~wx.PickerBase.GetPickerCtrlProportion` and :meth:`~wx.PickerBase.SetPickerCtrlProportion` :attr:`~wx.PickerBase.TextCtrl` See :meth:`~wx.PickerBase.GetTextCtrl` and :meth:`~wx.PickerBase.SetTextCtrl` :attr:`~wx.PickerBase.TextCtrlProportion` See :meth:`~wx.PickerBase.GetTextCtrlProportion` and :meth:`~wx.PickerBase.SetTextCtrlProportion` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.PickerBase(Control) **Possible constructors**:: PickerBase() Base abstract class for all pickers which support an auxiliary text control. .. method:: __init__(self) .. method:: CreateBase(self, parent, id=ID_ANY, text="", pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ButtonNameStr) :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `text`: :type `text`: string :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :param `validator`: :type `validator`: wx.Validator :param `name`: :type `name`: string :rtype: `bool` .. method:: GetInternalMargin(self) Returns the margin (in pixel) between the picker and the text control. This function can be used only when :meth:`HasTextCtrl` returns ``True``. :rtype: `int` .. method:: GetPickerCtrl(self) Returns the native implementation of the real picker control. :rtype: :ref:`wx.Control` .. note:: The returned control in the generic implementation of :ref:`wx.FilePickerCtrl`, :ref:`wx.DirPickerCtrl`, :ref:`wx.FontPickerCtrl` and :ref:`wx.ColourPickerCtrl` is a specialized :ref:`wx.Button` class so that you can change its label doing, e.g.: :: if wx.Platform == '__WXMSW__': # wxMSW is one of the platforms where the generic implementation # of wx.FilePickerCtrl is used... pButt = myFilePickerCtrl.GetPickerCtrl() if pButt is not None: pButt.SetLabel('Custom browse string') .. method:: GetPickerCtrlProportion(self) Returns the proportion value of the picker. :rtype: `int` .. method:: GetPickerStyle(self, style) :param `style`: :type `style`: long :rtype: `long` .. method:: GetTextCtrl(self) Returns a pointer to the text control handled by this window or ``None`` if the ``PB_USE_TEXTCTRL`` style was not specified when this control was created. :rtype: :ref:`wx.TextCtrl` .. note:: The contents of the text control could be an invalid representation of the entity which can be chosen through the picker (e.g. when the user enters an invalid colour syntax because of a typo). Thus you should never parse the content of the textctrl to get the user's input; rather use the derived-class getter (e.g. :meth:`wx.ColourPickerCtrl.GetColour` , :meth:`wx.FilePickerCtrl.GetPath` , etc). .. method:: GetTextCtrlProportion(self) Returns the proportion value of the text control. This function can be used only when :meth:`HasTextCtrl` returns ``True``. :rtype: `int` .. method:: GetTextCtrlStyle(self, style) :param `style`: :type `style`: long :rtype: `long` .. method:: HasTextCtrl(self) Returns ``True`` if this window has a valid text control (i.e. if the ``PB_USE_TEXTCTRL`` style was given when creating this control). :rtype: `bool` .. method:: IsPickerCtrlGrowable(self) Returns ``True`` if the picker control is growable. :rtype: `bool` .. method:: IsTextCtrlGrowable(self) Returns ``True`` if the text control is growable. This function can be used only when :meth:`HasTextCtrl` returns ``True``. :rtype: `bool` .. method:: PostCreation(self) .. method:: SetInternalMargin(self, margin) Sets the margin (in pixel) between the picker and the text control. This function can be used only when :meth:`HasTextCtrl` returns ``True``. :param `margin`: :type `margin`: int .. method:: SetPickerCtrl(self, picker) :param `picker`: :type `picker`: wx.Control .. method:: SetPickerCtrlGrowable(self, grow=True) Sets the picker control as growable when ``grow`` is ``True``. :param `grow`: :type `grow`: bool .. method:: SetPickerCtrlProportion(self, prop) Sets the proportion value of the picker. Look at the detailed description of :ref:`wx.PickerBase` for more info. :param `prop`: :type `prop`: int .. method:: SetTextCtrl(self, text) :param `text`: :type `text`: wx.TextCtrl .. method:: SetTextCtrlGrowable(self, grow=True) Sets the text control as growable when ``grow`` is ``True``. This function can be used only when :meth:`HasTextCtrl` returns ``True``. :param `grow`: :type `grow`: bool .. method:: SetTextCtrlProportion(self, prop) Sets the proportion value of the text control. Look at the detailed description of :ref:`wx.PickerBase` for more info. This function can be used only when :meth:`HasTextCtrl` returns ``True``. :param `prop`: :type `prop`: int .. method:: UpdatePickerFromTextCtrl(self) .. method:: UpdateTextCtrlFromPicker(self) .. attribute:: InternalMargin See :meth:`~wx.PickerBase.GetInternalMargin` and :meth:`~wx.PickerBase.SetInternalMargin` .. attribute:: PickerCtrl See :meth:`~wx.PickerBase.GetPickerCtrl` and :meth:`~wx.PickerBase.SetPickerCtrl` .. attribute:: PickerCtrlProportion See :meth:`~wx.PickerBase.GetPickerCtrlProportion` and :meth:`~wx.PickerBase.SetPickerCtrlProportion` .. attribute:: TextCtrl See :meth:`~wx.PickerBase.GetTextCtrl` and :meth:`~wx.PickerBase.SetTextCtrl` .. attribute:: TextCtrlProportion See :meth:`~wx.PickerBase.GetTextCtrlProportion` and :meth:`~wx.PickerBase.SetTextCtrlProportion`