From b744e271e35ef6c7396461d11577ad41d837f852 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 27 Oct 2021 21:41:30 +0100 Subject: [PATCH] Create multiline controls with wxTE_RICH2 in wxTextEntryDialog While wxMSW now turns this style on automatically if necessary, it's still better to avoid the failure during the initial control creation, so enable wxTE_RICH2 from the beginning in wxTextEntryDialog, where it shouldn't result in any incompatibilities. --- src/generic/textdlgg.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/generic/textdlgg.cpp b/src/generic/textdlgg.cpp index 912b46ef00..b9d2e10995 100644 --- a/src/generic/textdlgg.cpp +++ b/src/generic/textdlgg.cpp @@ -97,7 +97,11 @@ bool wxTextEntryDialog::Create(wxWindow *parent, topsizer->Add(CreateTextSizer(message), flagsBorder2); #endif - // 2) text ctrl + // 2) text ctrl: create it with wxTE_RICH2 style to allow putting more than + // 64KiB of text into it + if ( style & wxTE_MULTILINE ) + style |= wxTE_RICH2; + m_textctrl = new wxTextCtrl(this, wxID_TEXT, value, wxDefaultPosition, wxSize(300, wxDefaultCoord), style & ~wxTextEntryDialogStyle);