From: Jaakko Salli Date: Sun, 20 Dec 2009 12:31:24 +0000 (+0000) Subject: Added some missing SetupTextCtrlValue() calls X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0871417690729a7dfe4f998c367e5b0b6f377459 Added some missing SetupTextCtrlValue() calls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 3dfbb8a12c..d20d1d6137 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -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. }