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

| |sub_classes| Known Subclasses ============================== :ref:`wx.PasswordEntryDialog` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.TextEntryDialog.__init__` Default constructor. :meth:`~wx.TextEntryDialog.Create` :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: **~~~** **__init__** `(self)` Default constructor. Call :meth:`Create` to really create the dialog later. .. versionadded:: 2.9.5 **~~~** **__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 **~~~** .. 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, :ref:`wx.TextCtrl` styles (such as ``TE_PASSWORD`` or ``TE_MULTILINE`` ) may be specified here. :type `style`: long :param `pos`: Dialog position. :type `pos`: wx.Point :rtype: `bool` .. versionadded:: 2.9.5 .. 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`