Macro Event Handlers

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' keyword to define a function, you use the 'event' keyword. For example:

event FileOpen(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

Event handler names and their function parameters are pre-defined. Your event handlers must use the exact spelling of the function names and parameters.

The following are events supported by Source Insight:

Application Events

event AppStart()
event AppShutdown()
event AppCommand(sCommand)

Document Events

event DocumentNew(sFile)
event DocumentOpen(sFile)
event DocumentClose(sFile)
event DocumentSave(sFile)
event DocumentSaveComplete(sFile)
event DocumentChanged(sFile)
event DocumentSelectionChanged(sFile)

Project Events

event ProjectOpen(sProject)
event ProjectClose(sProject)

Statusbar Events

event StatusbarUpdate(sMessage)