The Structure of an Editor Extension

GFA Editor Extensions have no main program and cannot be executed (F5). Initializations, otherwise made in the main part of a GFA BASIC 32 program, must take place in the Sub with the name Gfa_Init. This sub is executed automatically while loading the editor Extension of the GFA BASIC 32. This sub is also the place for Gfa_AddMenu, in order to add entries to the Extra submenu.

Global Enum LangEng = 0, LangGer        ' values CurrentLanguage

 

Sub Gfa_Init

Global CurrentLanguage As Int = Gfa_IntSetting("Language")

If CurrentLanguage = LangEng  // English

IdxMerge = Gfa_AddMenu("Insert file ...", Gfa_MenuMerge)

Gfa_MenuDesc(IdxMerge) = "Inserts the contents “ _"

Else

IdxMerge = Gfa_AddMenu("Merge Datei ...", Gfa_MenuMerge)

Gfa_MenuDesc(IdxMerge) = "Merge Datei .."

EndIf

'

' Create a font resource …

Global Handle hMyFont = CreateMyFont("Arial")

End Sub

The menu entries are removed automatically when the GLL is unloaded. Any resource allocation can be released in the Gfa_Exit sub, which is automatically executed when the GLL is unloaded from memory.

 

Sub Gfa_Exit

~DeleteObject(hMyFont)

EndSub

Using Keyboard Shortcuts

Using The Extra Menu

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}