]> git.saurik.com Git - wxWidgets.git/commitdiff
Use wxTE_RICH2 for in-place wxGrid text editor control.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jun 2010 17:42:52 +0000 (17:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jun 2010 17:42:52 +0000 (17:42 +0000)
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

index 6ec2505ac8af1e89894865825f2acffcba18c231..a3cf424363a65df3ff89d969d4ce96f89d918008 100644 (file)
@@ -399,7 +399,10 @@ void wxGridCellTextEditor::DoCreate(wxWindow* parent,
                                     wxEvtHandler* evtHandler,
                                     long style)
 {
                                     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,
 
     m_control = new wxTextCtrl(parent, id, wxEmptyString,
                                wxDefaultPosition, wxDefaultSize,