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.
This commit is contained in:
Artur Wieczorek 2019-05-26 00:45:30 +02:00
parent 7a29f5dd2c
commit 0bdc9bedbe

View File

@ -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());