An event handler is a function written in Source Insight's macro language that gets called when specific events occur. Instead of using the macro or function keyword to define a function, you use the event keyword. For example:
event ProjectOpen(sFile)
{
}
Event handler functions do not return a value. They cannot be used to abort the event, or to return a value to the program. Also take note of the spelling of the event function parameters. They must be spelled correctly.
Event handler names and their function parameters are predefined. Your event handlers must use the exact spelling of the function names and parameters.
The following are events supported by Source Insight:
event AppStart()
event AppShutdown()
event AppCommand(sCommand)
event DocumentNew(sFile)
event DocumentOpen(sFile)
event DocumentClose(sFile)
event DocumentSave(sFile)
event DocumentSaveComplete(sFile)
event DocumentChanged(sFile)
event DocumentSelectionChanged(sFile)
event ProjectOpen(sProject)
event ProjectClose(sProject)
event StatusbarUpdate(sMessage)