.. 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.svg" 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="This class represents a dialog that requests a one-line text string from the user." alt="" coords="38,466,204,495"/> <area shape="rect" id="node2" href="wx.Dialog.html" title="A dialog box is a window with a title bar and sometimes a system menu, which can be moved around the screen." alt="" coords="72,389,171,418"/> <area shape="rect" id="node3" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow  is a common base class for wx.Dialog  and wx.Frame." alt="" coords="34,313,209,341"/> <area shape="rect" id="node4" href="wx.NonOwnedWindow.html" title="Common base class for all non-child windows." alt="" coords="26,236,217,265"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="66,159,177,188"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="55,82,188,111"/> <area shape="rect" id="node7" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="5,5,104,34"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="128,5,251,34"/> </map> 
   </p>
   </div>

|


|appearance| Control Appearance
===============================

|

.. container:: control-appearance-figures

   .. figure:: _static/images/widgets/fullsize/wxmsw/wx.textentrydialog.png
      :alt: wxMSW
      :figclass: appearance-figure

      **wxMSW**


   .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
      :alt: wxMAC
      :figclass: appearance-figure

      **wxMAC**


   .. figure:: _static/images/widgets/fullsize/wxgtk/wx.textentrydialog.png
      :alt: wxGTK
      :figclass: appearance-figure

      **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() -> None
       
       TextEntryDialog(parent, message, caption=GetTextFromUserPromptStr,
                       value='', style=TextEntryDialogStyle, pos=DefaultPosition) -> None
       
   
   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. 
      
      
                      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      .. versionadded:: 2.9.5 
           
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

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






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


                

      :rtype: `None`     







      .. 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: `str`








   .. method:: SetMaxLength(self, len)

      This function sets the maximum number of characters the user can enter into this dialog. 
                 


                


      :param `len`: 
      :type `len`: long




      :rtype: `None`     







      .. versionadded:: 2.9.5 
     







      .. seealso:: :meth:`wx.TextEntry.SetMaxLength`   








   .. method:: SetValue(self, value)

      Sets the default text value. 
                 


      :param `value`: 
      :type `value`: string




      :rtype: `None`     








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