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?