.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 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 <textentrydialog overview>`    







|

|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>TextEntryDialog</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.TextEntryDialog_inheritance.png" alt="Inheritance diagram of TextEntryDialog" 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.Trackable.html" title="wx.Trackable" alt="" coords="5,5,107,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="57,83,168,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="131,5,212,35"/> <area shape="rect" id="node3" href="wx.Window.html" title="wx.Window" alt="" coords="69,160,157,189"/> <area shape="rect" id="node6" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="34,237,192,267"/> <area shape="rect" id="node5" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="42,315,184,344"/> <area shape="rect" id="node7" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="72,392,153,421"/> <area shape="rect" id="node8" href="wx.TextEntryDialog.html" title="wx.TextEntryDialog" alt="" coords="43,469,183,499"/> </map> 
   </p>

|


|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=EmptyString, 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=EmptyString, 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=EmptyString, 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`

