From 0bdc9bedbe445c97d70387040aed650d7a20472e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 26 May 2019 00:45:30 +0200 Subject: [PATCH] Enable setting maximum length of the entered text in wxLongStringProperty editor Editor used by wxLongStringProperty is wxTextCtrl-based and it should be possible to set the limit of the length of the entered text just like it's done for such editors in another properties like wxStringProperty. --- src/propgrid/props.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index cf13a6b2b8..69b636be36 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -2266,6 +2266,9 @@ bool wxLongStringProperty::DisplayEditorDialog( wxPGProperty* prop, wxPropertyGr edStyle |= wxTE_READONLY; wxTextCtrl* ed = new wxTextCtrl(dlg,wxID_ANY,value, wxDefaultPosition,wxDefaultSize,edStyle); + int maxLen = prop->GetMaxLength(); + if ( maxLen > 0 ) + ed->SetMaxLength(maxLen); rowsizer->Add(ed, wxSizerFlags(1).Expand().Border(wxALL, spacing)); topsizer->Add(rowsizer, wxSizerFlags(1).Expand());