wxTextCtrl Selected Text Topic is solved
wxTextCtrl Selected Text
Hi. How do you make it so text stays selected when the contents of a text control change? Every time the contents change, my selection gets unselected...
Ok, I traced it to this function:
Since AppendText doesn't use the flags, it can only be that InsertTextWithUndo line.
Any ideas how to stop it from deselecting selected text?
Code: Select all
void wxRichTextCtrl::DoWriteText(const wxString& value, int flags)
{
wxString valueUnix = wxTextFile::Translate(value, wxTextFileType_Unix);
GetBuffer().InsertTextWithUndo(m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
if ( flags & SetValue_SendEvent )
SendTextUpdatedEvent();
}
Any ideas how to stop it from deselecting selected text?