]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug: wxEditEnumProperty's initial string value could not be outside the list...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 1 Oct 2009 16:06:58 +0000 (16:06 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 1 Oct 2009 16:06:58 +0000 (16:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/propgrid/propgrid.cpp
src/propgrid/props.cpp

index 74742446d12690bc8d2d26fbdddfc02d0d0801f0..98286772bb91a028e8f17643938277625480fb9f 100644 (file)
@@ -1637,7 +1637,10 @@ void FormMain::PopulateWithExamples ()
     eech.Add(wxT("Choice 1"));
     eech.Add(wxT("Choice 2"));
     eech.Add(wxT("Choice 3"));
-    pg->Append( new wxEditEnumProperty(wxT("EditEnumProperty"), wxPG_LABEL, eech) ); // , wxT("Choice 2")
+    pg->Append( new wxEditEnumProperty("EditEnumProperty",
+                                       wxPG_LABEL,
+                                       eech,
+                                       "Choice not in the list") );
 
     //wxString v_;
     //wxTextValidator validator1(wxFILTER_NUMERIC,&v_);
index 4bc4d1c0862f817d2bde6400ac4ebf9aa1ed7c78..4a5442bf9c9cd6acdf739365c66eb3d6cbb6f90a 100644 (file)
@@ -1034,9 +1034,7 @@ bool wxEnumProperty::ValueFromString_( wxVariant& value, const wxString& text, i
 
     // If text not any of the choices, store as text instead
     // (but only if we are wxEditEnumProperty)
-    if ( useIndex == -1 &&
-         (value.GetType() != wxPG_VARIANT_TYPE_STRING || (m_value.GetString() != text)) &&
-         isEdit )
+    if ( useIndex == -1 && isEdit )
     {
         asText = true;
     }