]> git.saurik.com Git - wxWidgets.git/commitdiff
Added some missing SetupTextCtrlValue() calls
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 20 Dec 2009 12:31:24 +0000 (12:31 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 20 Dec 2009 12:31:24 +0000 (12:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/editors.cpp

index 3dfbb8a12c472261d2f73abaaa87098464aa3ea9..d20d1d6137b0df7f0c1e554e7926dbb0ef0920d2 100644 (file)
@@ -280,6 +280,9 @@ void wxPGTextCtrlEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl )
     else
         s = property->GetDisplayedString();
 
+    wxPropertyGrid* pg = property->GetGrid();
+
+    pg->SetupTextCtrlValue(s);
     tc->SetValue(s);
 
     //
@@ -367,7 +370,11 @@ void wxPGTextCtrlEditor::SetValueToUnspecified( wxPGProperty* property, wxWindow
     wxPropertyGrid* pg = property->GetGrid();
     wxASSERT(pg);  // Really, property grid should exist if editor does
     if ( pg )
-        tc->SetValue(wxEmptyString);
+    {
+        wxString unspecValueText;
+        pg->SetupTextCtrlValue(unspecValueText);
+        tc->SetValue(unspecValueText);
+    }
 }
 
 
@@ -378,7 +385,10 @@ void wxPGTextCtrlEditor::SetControlStringValue( wxPGProperty* property, wxWindow
     wxPropertyGrid* pg = property->GetGrid();
     wxASSERT(pg);  // Really, property grid should exist if editor does
     if ( pg )
+    {
+        pg->SetupTextCtrlValue(txt);
         tc->SetValue(txt);
+    }
 }
 
 
@@ -896,9 +906,14 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
             cb->SetText( defString );
     }
     else if ( !(extraStyle & wxCB_READONLY) && defString.length() )
+    {
+        propGrid->SetupTextCtrlValue(defString);
         cb->SetValue( defString );
+    }
     else
+    {
         cb->SetSelection( -1 );
+    }
 
 #ifdef __WXMSW__
     cb->Show();
@@ -970,7 +985,11 @@ bool wxPGChoiceEditor::OnEvent( wxPropertyGrid* propGrid, wxPGProperty* property
                     propGrid->SetInternalFlag(wxPG_FL_VALUE_CHANGE_IN_EVENT);
                 property->SetValueToUnspecified();
                 if ( !cb->HasFlag(wxCB_READONLY) )
-                    cb->GetTextCtrl()->SetValue(wxEmptyString);
+                {
+                    wxString unspecValueText;
+                    propGrid->SetupTextCtrlValue(unspecValueText);
+                    cb->GetTextCtrl()->SetValue(unspecValueText);
+                }
                 return false;
             }
         }
@@ -998,10 +1017,13 @@ bool wxPGChoiceEditor::GetValueFromControl( wxVariant& variant, wxPGProperty* pr
 }
 
 
-void wxPGChoiceEditor::SetControlStringValue( wxPGProperty* WXUNUSED(property), wxWindow* ctrl, const wxString& txt ) const
+void wxPGChoiceEditor::SetControlStringValue( wxPGProperty* property,
+                                              wxWindow* ctrl,
+                                              const wxString& txt ) const
 {
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
     wxASSERT( cb );
+    property->GetGrid()->SetupTextCtrlValue(txt);
     cb->SetValue(txt);
 }
 
@@ -1043,7 +1065,9 @@ WX_PG_IMPLEMENT_INTERNAL_EDITOR_CLASS(ComboBox,
 void wxPGComboBoxEditor::UpdateControl( wxPGProperty* property, wxWindow* ctrl ) const
 {
     wxOwnerDrawnComboBox* cb = (wxOwnerDrawnComboBox*)ctrl;
-    cb->SetValue(property->GetValueAsString(wxPG_EDITABLE_VALUE));
+    wxString s = property->GetValueAsString(wxPG_EDITABLE_VALUE);
+    property->GetGrid()->SetupTextCtrlValue(s);
+    cb->SetValue(s);
 
     // TODO: If string matches any selection, then select that.
 }