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
This commit is contained in:
Vadim Zeitlin 2010-06-20 17:42:52 +00:00
parent 3cb332c155
commit 0033b1dfba

View File

@ -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,