SlickEdit Community
SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: ronburk on September 02, 2006, 05:22:49 PM
-
There doesn't seem to be an on_change event for Editor Controls.
How do I, well, detect when a change has been made?
-
I couldn't find one either so when i wrote my GenComment,
http://www.wideopenwest.com/~gary_ash/GenComment.htm, package i just created a very wide ranging keyboard hook. What is it you're trying to do?
-
Right now, just the typical: "Save" button is enabled/disabled
to indicate whether there are unsaved changes in the
Editor Control.
I considered the "hook every dang thing" approach, but worried
I would miss some route to modifying the buffer. So now I poll
the p_modify flag with a timer (ugh). Hard to decide which evil
is lesser.
It seems very strange to have an on_change event for other
object times and not for the Editor Control.
On the bright side, I found there is an xml_mode() method
for Editor Controls, even though no such method appears in
the documentation.
-
Have you tried writing an _OnUpdate handler. I don't think they work for forms though
a keyboard hook my be your only option
-
There is the VSCALLBACK_AR_BUF_TEXT_CHANGE callback - dunno if it works though.
I use a timer for this - works fine for me.
You could also modify the _update_mod_file_status in bufftabs.e or the _as_callback function in autosave.e to add a call to your own function.
Graeme
-
Thanks for the additional tips!