From 0033b1dfbafe3460e936d5e113799289f6f59f76 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jun 2010 17:42:52 +0000 Subject: [PATCH] Use wxTE_RICH2 for in-place wxGrid text editor control. This works around a bug with the plain text edit control under MSW which seems to totally lose its caret when we hide it and show it again for another cell. This is not a proper fix for the problem, of course, but at least it does allow to edit wxGrid cells in the meanwhile. Closes #11681. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grideditors.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index 6ec2505ac8..a3cf424363 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -399,7 +399,10 @@ void wxGridCellTextEditor::DoCreate(wxWindow* parent, wxEvtHandler* evtHandler, long style) { - style |= wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB | wxNO_BORDER; + // Use of wxTE_RICH2 is a strange hack to work around the bug #11681: a + // plain text control seems to lose its caret somehow when we hide it and + // show it again for a different cell. + style |= wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB | wxNO_BORDER | wxTE_RICH2; m_control = new wxTextCtrl(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, -- 2.45.2