Is there a way to be notified when the user makes changes in a wxStyledTextCtrl?

Posted by George Edison on Stack Overflow See other posts from Stack Overflow or by George Edison
Published on 2010-03-27T20:41:52Z Indexed on 2010/03/27 20:43 UTC
Read the original article Hit count: 195

Filed under:
|
|

I have a wxWidgets application that has a wxStyledTextCtrl. But for the life of me, I cannot figure out how to get notified of modification events.

I have the following code:

void CMainWindow::OnDocumentModified(wxStyledTextEvent & event)
{
    wxString msg;
    msg << event.GetModificationType();
    wxMessageBox(msg);
}

This gets called for EVT_STC_MODIFIED.

When I run the application and press a key, the message box displays 1040 and 8209. When I call SetText the same two messages are displayed.

How can I differentiate between user events and programmatically-generated events?

© Stack Overflow or respective owner

Related posts about wxstyledtextctrl

Related posts about wxwidgets