Navigation: TextEd > Extension and Scripts >

Events object

 

 

 

 

Application events are collected in the "Events" object for easy access. Events can be used in extension to execute a script function when an event occur.

The "Sender" argument is of type TObject, but you will probably never have to use it.   

   

Below is a very simple JScript example:

   

    ---------------------------------------------------

    ExitExtension()

    {

      // Free created objects and added GUI objects

 

    }

 

    function OnNewDocument(Sender) {

           Document.Text = "Testing events...";

    }

 

    // Main code

    {

           Events.OnNewDocument = &OnNewDocument;

    }

    ---------------------------------------------------

   

The extension will simply wait for a new document to be created.

When the user press "New" and a new document is created, the OnNewDocument()

function is executed. A simple text is then inserted into the new document.


OnApplicationActivate(Sender)

Executed when the main window receives focus, e.g. when the user moves the main window to the front.


OnApplicationDeactivate(Sender)

Executed when the main window loses focus, e.g. when another program is focused.

 

OnBeforeProjectClose(Sender)

Executed just before a project is closed.

 

OnBeforeSaveAll(Sender)

Executed just before all files are saved.

 

OnBeforeSaveDocument(Sender)

Executed just before the current file is saved.


OnBottombarTabChange(Sender)

Executed when a tab has been changed in the bottom-bar.

 

OnDocumentCursorChange(Sender)

Executed when the text cursor has been moved.


OnDocumentFocused(Sender)

Executed when a document has been focused.

 

OnDocumentHScroll(Sender)

Executed when the editor window has been scrolled.


OnDocumentReload(Sender)

Executed when a document is reloaded.


OnDocumentSelectionChange(Sender)

Executed when a selection has been made in the editor.


OnDocumentTabChange(Sender)

Executed when a document tab has been changed.


OnDocumentVScroll(Sender)

Executed when the editor window has been scrolled.


OnMainTabChange(Sender)

Executed when a main window tab has been changed.

 

OnNewDocument(Sender)

Executed when a new document has been created.


OnOpenDocument(Sender)

Executed when a document has been opened from file.


OnProjectClose(Sender)

Executed when a project has been closed.


OnProjectOpen(Sender)

Executed when a project has been opened.


OnQuickbarTabChange(Sender)

Executed when a tab has been changed in the quick-bar.


OnSaveAll(Sender)

Executed when all documents have been saved to file.


OnSaveDocument(Sender)

Executed when the current document has been saved to file.


OnSidebarTabChange(Sender)

Executed when a tab has been changed in the side-bar.


 


 

 

 

 

 

Copyright © 2024 Rickard Johansson