.. 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 <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>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.TextEntryDialog.html" title="wx.TextEntryDialog" alt="" coords="35,469,183,499"/> <area shape="rect" id="node2" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="65,392,152,421"/> <area shape="rect" id="node3" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="31,315,186,344"/> <area shape="rect" id="node4" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="25,237,193,267"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="60,160,157,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="50,83,167,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="117,5,223,35"/> </map> 
   </p>
   </div>

|


|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=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:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor.                  
      
      Call :meth:`Create`   to really create the dialog later. 
      
                       
      
      
      
      .. versionadded:: 2.9.5 
           
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__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
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. 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, 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`

