Xailer plugin system - December 2018.

Copyright 2015-2019, José Lalín

Whenever somebody misses some functionality or needs specialized tools which
are not included in the IDE, plugins are the way to go.

A plugin is just a kind of object which must follow some basic and simple
rules to be used from the IDE:

  1. Inherit from TIDEPlugin.
  2. Registered in the IDE and initialized.
  3. Define a way to be executed: a menu option, a toolbar button, a shortcut,
    an event, or any combination of them.

TIDEPlugin  
IDEMenu  
IDEEditor  
IDEProject  
IDEProjectMan  
IDEOutput  
IDEConfig  
IDETabUser  
IDECodeHelper  
IDEInspector


TIDEPlugin

This is the main class of the system and handles the task of linking the plugin
with the IDE.

NOTE: Do not forget to declare it in the same module of the main plugin class: DYNAMIC TIDEPlugin

Properties

Methods

<cEvent>: the event name.

<bAction>: a codeblock with the action to execute.

Each interface has his own list of predefined events which are fired by the
IDE for some actions.
See the Events section in each of the interfaces for a list of supported
events and its parameters.

::RegisterEvent( "IDE_Start", {|| MsgInfo( "The IDE is alive!" ) } )

::RegisterEvent( "IDE_Exit", {|| MsgInfo( "The IDE is closing!" ) } )

<nKey>: key code and modifiers of the shortcut.

The key code and modifiers must be packed with the MakeLong() function.
The first parameter is the numeric ORing of the MOD_CONTROL, MOD_SHIFT and/or
MOD_ALT flags and the second parameter is the key code.

nKey := MakeLong( nOr( MOD_CONTROL, MOD_SHIFT ), Asc( "C" ) )

nKey := MakeLong( MOD_ALT, VK_F5 )

<bAction>: a codeblock with the action to execute.

{|| MsgInfo( "Yep! It works!" ) }

To register a shortcut and its action:

::RegisterKey( MakeLong( MOD_ALT, VK_F5 ), {|| MsgInfo( "Yep! It works!" ) } )

<nKey>: key code and modifiers of the shortcut.

<nKey>: key code and modifiers of the shortcut.

<oItem>: the TMenuItem object.

It is useful in development mode to let the IDE see the item so it can be
destroyed each time the plugin is compiled. If you do not do so you will end
up with a new menu entry for each compilation.

This could be done destroying the menuitem in the Unregister() method but if
the plugin does not need an own Unregister() method to free resources this is
the easy way.

<b>HelloWorld</b>
This is my first plugin...

<b>Version</b> 1.0

<cDescription>: description of the action.

<bAction>: a codeblock with the action to execute.

<nKey>: key code and modifiers of the shortcut. See RegisterKey() for
details.

::RegisterCommand( "A command", {|| MsgInfo( "Yep! It works!" ) }, MakeLong( MOD_ALT, VK_F5 ) )

<cDescription>: description of the action.

<cDescription>: description of the action.

NOTE: If the title is ommited in any of these calls, it defaults to “Plugin manager”.

Interfaces

Events


IDEEditor

Define the interface to access the code editor.

Properties

1 : Automatic
2 : Delayed
3 : Manual
0 : Invisible
1 : Line
2 : Block
0 : Invisible
1 : Visible always
2 : Visible after indent
3 : Visible only in indent
0 : CRLF
1 : CR
2 : LF
0 : Box
1 : Circle
2 : PlusMinus
3 : Arrow
0 : Normal
1 : Invert light
2 : Black on white
3 : Color on white
4 : Color on white plus line numbers
0 : None
1 : Word
2 : Character
0 : None
1 : Box
2 : Line
0 : Normal
1 : Upper
2 : Lower
3 : CamelCase

NOTE: For parentheses only works when calltips are disabled.

Methods

<lStart>: find from the beginning or from a given position.

<cText>: text to find.

<nScope>: scope to find. Defaults to nFindScope property.

1: from start
2: backward

<nFlags>: find flags. Defaults to nFindFlags property.

SCFIND_MATCHCASE: text matches the case of the search string.
SCFIND_WHOLEWORD: match only occurs if the characters before and after are not word characters.
SCFIND_REGEXP   : the search string is a regular expression.

lPrev: find previous match. Default to false.
lMsg: show message when there no more matchs. Default to true.

<nMark>: type of mark.

0 : Bookmark
1 : Breakpoint
Other: User defined

<lNoMove>: do not set the line as active line.

<cLang>: language identifier.

xbase: .prg, .xfm and .ch files
xml: .prj, .xml, .xsl
cpp: .c, .h, .api, .cpp, .cxx, .js
makefile: .mak
markdown: .md
props: .ini, .cfg, .xdt, .iss
batch: .bat
errorlist: .lst
rc: .rc
hypertext: .htm, .html, .php, .inc
css: .css
diff: .dif, .diff, .patch

<nChar>: last typed character.

<cFile>: full name of the file.

<lSelect>: select file as active document.

<cFile>: full name of the file.

<cText>: initial content. Optional.

<lCopy>: copy to a new file.

<cTemplate>: name for the file.

Events


IDEMenu

Define the interface to access the main menu.

Properties

Methods

<cText>: display text.

<nMenu>: number of menu item. If empty, the menu is added to the main
menu bar.

<nPos>: position in the submenu. If empty, the menu is added to the end.

<xImage>: name of an image resource file to show with the option.

<nMenu>: number of menu item. If empty, the menu is added to the main
menu bar.

<nPos>: position in the submenu. If empty, the menu is added to the end.


IDEProject

Define the interface to access the active project.

Properties

exe: executable file.
lib: static library file.
dll: dynamic link library file.
vcNONE: None
vcCVS : CVS
vcSVN : SVN

Methods

nType: type of VCS system.

vcNONE: None
vcCVS : CVS
vcSVN : SVN

Events


IDEProjectMan

Define the interface to access the project manager.

Properties

Methods

Events


IDEOutput

Define the interface to access the output area.

Properties

Methods

Events


IDEConfig

Define the interface to access the configuration options.

Properties

0 : Top
1 : Bottom
0 : Top
1 : Bottom

IDEInspector

Define the interface to access the object inspector and the form designer.

Properties

Methods

Events


IDECodeHelper

Define the interface to access the intellisense.

Properties

Methods


IDETabUser

Define the interface to access the user area.

Properties

Methods

Events


Debug

Common debug events.

Events