开发者

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

开发者 https://www.devze.com 2022-12-25 01:28 出处:网络
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 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(wxStyl开发者_StackOverflowedTextEvent & 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?


See http://www.yellowbrain.com/stc/stc_event.html#modtype for possible values.

0

精彩评论

暂无评论...
验证码 换一张
取 消