Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

event in codeblocks being sent on a "undo" or "redo" command

(1/2) > >>

frithjofh:
Hi everybody,

is there an event in c::b which is emitted when the user calls the "undo" or "redo" functionality either by tool button or menu? I looked around in the forum and in the source code of c::b and didn't find anything ( which doesn't mean that there may be none  :) ). Such an event would come in handy for instance for a plugin to notice that there was a change in the active editor and adapt accordingly.

Regards

frithjofh

ollydbg:
I think the cbEVT_EDITOR_UPDATE_UI event is the right event you want.
see the posts around Re: A feature request about CC and BrowseTracker

frithjofh:
HI, and thank you for the answer.

Isn't the cbEVT_EDITOR_UPDATE fired everytime any change happens in the editor, even if somebody adds a whitespace? If some body writes a word, it gets fired for every char written, right? Doesn't that mean really a lot of traffic if I use it in a plugin? I mean additional traffic to the c::b app if the plugin does some calculating, checking or parsing of the editors contents on every cbEVT_EDITOR_UPDATE. Scares me a bit ...

But I'll give it a try  :D and see what happens. If this is the way to do it ...

Regards

frithjofh

ollydbg:

--- Quote ---Isn't the cbEVT_EDITOR_UPDATE fired everytime any change happens in the editor, even if somebody adds a whitespace?
--- End quote ---

I think it is. But you can check the scintilla document(this message is send from the scintilla control, cb just do a wrapper) for more information. Currently, this event is used to record the "edit position" in the browser tracker plugin. :D

Jenna:
wxScintilla sends the wxEVT_SCI_MODIFIED.
This event should be send with notification-type wxSCI_PERFORMED_UNDO or wxSCI_PERFORMED_REDO if an undo or redo is done.

See wxScintilla.h for the notification-types and cbEditor::OnEditorModified(wxScintillaEvent& event) for an example how to filter the notification-type.

Navigation

[0] Message Index

[#] Next page

Go to full version