Ticket #15162 (closed defect: fixed)
wxGrid multiline problems with wxTE_RICH2 style
|Reported by:||Tiron||Owned by:|
Revision 64646 added wxTE_RICH2 to the grid text editor, this breaks editing multiline text under Windows. If a grid cell contains multiline text and you use a grid cell editor having the wxTE_RICH2 style, it truncates the text to a single line, losing everything else. Before this style, the newlines would show up within the single line of text as "block" characters (but it would not destroy the multiline string).
In my application, a single click in the selected cell will bring up the default inline editor and on a double click we bring up a special dialog intended to edit multiline text. The problem is that many times the double click is interpreted as one click to select the cell and a second click to inline edit the text. Before this wxTE_RICH2 change, the inline editor would handle it, but show boxes for the newline characters. With the wxTE_RICH2 style, it truncates the text at the first newline, destroying any multiline text that was there. More than that, you cannot seem to hit ESC to cancel it. So in the case of a misclick on a multiline cell, the wxTE_RICH2 style causes actual data loss.
I think being able to edit multiline text in the single line editor is nice to have, but the critical fix is to not destroy the multiline data.