.. 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.TextEntryDialog: ========================================================================================================================================== |phoenix_title| **wx.TextEntryDialog** ========================================================================================================================================== This class represents a dialog that requests a one-line text string from the user. It is implemented as a generic wxWidgets dialog. .. seealso:: :ref:`TextEntryDialog Overview ` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class TextEntryDialog:
| |appearance| Control Appearance =============================== | .. figure:: _static/images/widgets/fullsize/wxmsw/wx.textentrydialog.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: _static/images/widgets/fullsize/wxgtk/wx.textentrydialog.png :alt: wxGTK :figclass: floatcenter **wxGTK** | |sub_classes| Known Subclasses ============================== :ref:`wx.PasswordEntryDialog` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.TextEntryDialog.__init__` Default constructor. :meth:`~wx.TextEntryDialog.Create` :meth:`~wx.TextEntryDialog.ForceUpper` Convert all text entered into the text control used by the dialog to upper case. :meth:`~wx.TextEntryDialog.GetClassDefaultAttributes` :meth:`~wx.TextEntryDialog.GetValue` Returns the text that the user has entered if the user has pressed ``wx.OK``, or the original value if the user has pressed Cancel. :meth:`~wx.TextEntryDialog.SetMaxLength` This function sets the maximum number of characters the user can enter into this dialog. :meth:`~wx.TextEntryDialog.SetValue` Sets the default text value. :meth:`~wx.TextEntryDialog.ShowModal` Shows the dialog, returning ``wx.ID_OK`` if the user pressed ``wx.OK``, and ``wx.ID_CANCEL`` otherwise. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.TextEntryDialog.Value` See :meth:`~wx.TextEntryDialog.GetValue` and :meth:`~wx.TextEntryDialog.SetValue` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.TextEntryDialog(Dialog) **Possible constructors**:: TextEntryDialog() TextEntryDialog(parent, message, caption=GetTextFromUserPromptStr, value="", style=TextEntryDialogStyle, pos=DefaultPosition) This class represents a dialog that requests a one-line text string from the user. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self)` Default constructor. Call :meth:`Create` to really create the dialog later. .. versionadded:: 2.9.5 :html:`

` **__init__** `(self, parent, message, caption=GetTextFromUserPromptStr, value="", style=TextEntryDialogStyle, pos=DefaultPosition)` Constructor. Use :meth:`ShowModal` to show the dialog. See :meth:`Create` method for parameter description. :param `parent`: :type `parent`: wx.Window :param `message`: :type `message`: string :param `caption`: :type `caption`: string :param `value`: :type `value`: string :param `style`: :type `style`: long :param `pos`: :type `pos`: wx.Point :html:`

` .. method:: Create(self, parent, message, caption=GetTextFromUserPromptStr, value="", style=TextEntryDialogStyle, pos=DefaultPosition) :param `parent`: Parent window. :type `parent`: wx.Window :param `message`: Message to show on the dialog. :type `message`: string :param `caption`: The caption of the dialog. :type `caption`: string :param `value`: The default value, which may be the empty string. :type `value`: string :param `style`: A dialog style, specifying the buttons (wx``wx.OK``, ``wx.CANCEL``) and an optional ``wx.CENTRE`` style. Additionally, most :ref:`wx.TextCtrl` styles (such as ``TE_PASSWORD`` or ``TE_MULTILINE`` ) may be specified here, but ``TE_READONLY`` may not be used, as it doesn't make sense for this dialog, used for text input. :type `style`: long :param `pos`: Dialog position. :type `pos`: wx.Point :rtype: `bool` .. versionadded:: 2.9.5 .. method:: ForceUpper(self) Convert all text entered into the text control used by the dialog to upper case. Call this method to ensure that all text entered into the text control used by the dialog is converted on the fly to upper case. If the text control is not empty, its existing contents is also converted to upper case. .. versionadded:: 4.1/wxWidgets-3.1.0 .. seealso:: :meth:`wx.TextEntry.ForceUpper` .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: :ref:`wx.VisualAttributes` .. method:: GetValue(self) Returns the text that the user has entered if the user has pressed ``wx.OK``, or the original value if the user has pressed Cancel. :rtype: `string` .. method:: SetMaxLength(self, len) This function sets the maximum number of characters the user can enter into this dialog. :param `len`: :type `len`: long .. versionadded:: 2.9.5 .. seealso:: :meth:`wx.TextEntry.SetMaxLength` .. method:: SetValue(self, value) Sets the default text value. :param `value`: :type `value`: string .. method:: ShowModal(self) Shows the dialog, returning ``wx.ID_OK`` if the user pressed ``wx.OK``, and ``wx.ID_CANCEL`` otherwise. Call :meth:`GetValue` to retrieve the values of the string entered by the user after showing the dialog. :rtype: `int` .. attribute:: Value See :meth:`~wx.TextEntryDialog.GetValue` and :meth:`~wx.TextEntryDialog.SetValue`