.. 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.propgrid.EditEnumProperty:

==========================================================================================================================================
|phoenix_title|  **wx.propgrid.EditEnumProperty**
==========================================================================================================================================

:ref:`wx.propgrid.EnumProperty`  with `String`       value and writable combo box editor. 
         


         



.. note:: 

   Uses int value, similar to :ref:`wx.propgrid.EnumProperty`, unless text entered by user is not in choices (in which case string value is used).   







|

|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>EditEnumProperty</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.propgrid.EditEnumProperty_inheritance.svg" alt="Inheritance diagram of EditEnumProperty" 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.propgrid.EditEnumProperty.html" title="wx.propgrid.EnumProperty  with String  value and writable combo box editor." alt="" coords="5,236,251,265"/> <area shape="rect" id="node2" href="wx.propgrid.EnumProperty.html" title="You can derive custom properties with choices from this class." alt="" coords="19,159,237,188"/> <area shape="rect" id="node3" href="wx.propgrid.PGProperty.html" title="wx.propgrid.PGProperty  is base class for all wx.propgrid.PropertyGrid  properties and as such it is not intended to be instantiated directly." alt="" coords="29,82,228,111"/> <area shape="rect" id="node4" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="79,5,178,34"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.propgrid.EditEnumProperty.__init__`                                   
:meth:`~wx.propgrid.EditEnumProperty.OnSetValue`                                 This virtual function is called after m_value has been set.
:meth:`~wx.propgrid.EditEnumProperty.StringToValue`                              Converts text into `Variant`       value appropriate for this property.
:meth:`~wx.propgrid.EditEnumProperty.ValidateValue`                              Implement this function in derived class to check the value.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.propgrid.EditEnumProperty(EnumProperty)

   **Possible constructors**::

       EditEnumProperty(label=PG_LABEL, name=PG_LABEL, labels=[], values=[],
                        value="") -> None
       
       EditEnumProperty(label, name, choices, value="") -> None
       
   
   EnumProperty with string value and writable combo box editor.



   .. method:: __init__(self, *args, **kw)



      |overload| **Overloaded Implementations:**

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

      
      **__init__** `(self, label=PG_LABEL, name=PG_LABEL, labels=[], values=[], value="")`
      
      
      
      
      :param `label`: 
      :type `label`: string
      :param `name`: 
      :type `name`: string
      :param `labels`: 
      :type `labels`: list of strings
      :param `values`: 
      :type `values`: list of integers
      :param `value`: 
      :type `value`: string
      
      
      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, label, name, choices, value="")`
      
      
      
      
      :param `label`: 
      :type `label`: string
      :param `name`: 
      :type `name`: string
      :param `choices`: 
      :type `choices`: wx.propgrid.PGChoices
      :param `value`: 
      :type `value`: string
      
      
      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: OnSetValue(self)

      This virtual function is called after m_value has been set. 
                 


                

      :rtype: `None`     







      .. note:: 

   

         - If m_value was set to Null variant (i.e. unspecified value), :meth:`OnSetValue`   will not be called. 
         - m_value may be of any variant type. Typically properties internally support only one variant type, and as such :meth:`OnSetValue`   provides a good opportunity to convert supported values into internal type. 
         - Default implementation does nothing.  











   .. method:: StringToValue(self, text, flags=PGPropValFormatFlags.Null)

      Converts text into `Variant`       value appropriate for this property. 
                 




      :param `text`: Text to be translated into variant.  
      :type `text`: string
      :param `flags`: If :meth:`wx.propgrid.PGPropValFormatFlags.FullValue`   is set, returns complete, storable value instead of displayable one (they may be different). If :meth:`wx.propgrid.PGPropValFormatFlags.CompositeFragment`   is set, text is interpreted as a part of composite property string value (as generated by :meth:`~wx.propgrid.EnumProperty.ValueToString`   called with this same flag).  
      :type `flags`: wx.propgrid.PGPropValFormatFlags










      :rtype: :ref:`Tuple[bool, PGVariant]`




      You might want to take into account that m_value is Null variant if property value is unspecified (which is usually only case if you explicitly enabled that sort behaviour).  
                  



      :returns: 

         Returns ``True`` if resulting `Variant`       value was different.  







      .. note:: 

         Default implementation converts semicolon delimited tokens into child values. Only works for properties with children.  








   .. method:: ValidateValue(self, value, validationInfo)

      Implement this function in derived class to check the value. 
                 

      Return ``True`` if it is ok. Returning ``False`` prevents property change events from occurring. 


                


      :param `value`: 
      :type `value`: PGVariant
      :param `validationInfo`: 
      :type `validationInfo`: wx.propgrid.PGValidationInfo




      :rtype: `bool`







      .. note:: 

   

         - Default implementation always returns ``True``.  










