*****************************************************************
***              ContextMenu AkelPad plugin v5.8              ***
*****************************************************************

2010 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)


*** Description ***

Configure main menu and context menu for edit control, MDI tabs,
hyperlinks and recent files.

Note:
Recent files menu doesn't work in Win95.


*** Functions ***

ContextMenu::Main
Main dialog.

ContextMenu::Show
Show context menu.


*** Syntax ***

Variables:
  %f active file
  %d directory of active file
  %a AkelPad's directory
  %m menu ID (handle)
  %i menu item ID
  %u URL address (work in "URL menu" only)
  %% symbol %

Comments:
  # comment
  ; comment

Special menu items:
  SEPARATOR
    separator menu item.
  EXPLORER
    explorer menu.
  RECENTFILES
    recent files list.
  LANGUAGES
    language modules list.
  MDIDOCUMENTS
    MDI documents list (work in "Main menu" with MDI mode only).
  CLEAR
    clear menu (work in "Main menu" only)

Menu item creation:
  [-]"[menu item text]" [Command(..) | Exec(..) | Call(..) | +Call(..) | Font(..) | Recode(..) | Insert(..) | Link(..)]

  [-]"[menu item text]"
    "My Menu Item"
      menu item text.
    -"My Menu Item"
      at presence of a minus sign the menu item status will not change somehow (become inactive,
      be checked).
    ""
      at absence of the menu item text, and also use of method Command(), plugin uses main menu
      item text instead, to which Command() method refers.

    Command(number)
      Command(4162)
        method calls the internal command at number 4162. In this case this code
        is responsible for opening a dialog box "Go to line...".
        For the full list of commands: see AkelHelp-Eng.htm or AkelDLL.h in source code of a plugin.
    Exec("command line", ["working directory"])
      Exec("notepad.exe")
        method calls notepad.
      Exec(`notepad.exe`)
        method calls notepad.
      Exec('notepad.exe')
        method calls notepad.
      Exec('%windir%\notepad.exe')
        method calls notepad.
      Exec(`rundll32.exe shell32,ShellExec_RunDLL "%f"`, "%d")
        method pass an active file for opening on Windows association.
    Call("Plugin::Function", [additional parameters])
      Call("Scripts::Main")
        method calls Scripts plugin and Main function.
    +Call("Plugin::Function", [additional parameters])
      +Call("LineBoard::Main")
        method calls LineBoard plugin and Main function. Plug-in will work also after
        program restart.
    Font("FaceName", Style, Size)
      "FaceName"
        Font face, for example, "Courier". Unchanged, if "".
      Style (one of the following):
        0  ignored.
        1  normal.
        2  bold.
        3  italic.
        4  bold italic.
      Size
        Font size. Unchanged, if 0.
      Font("Courier", 4, 10)
        method sets Courier bold italic font with 10 pt.
    Recode(RecodeFrom, RecodeTo)
      Recode(1252, 437)
        method recodes the text from 1252 codepage to 437.
    Insert("text")
      Insert("Some string")
        method replaces selection with the specified text.
    Link(number)
      Link(1)
        method opens hyperlink (work in "URL menu" only).
      Link(2)
        method copies hyperlink (work in "URL menu" only).
      Link(3)
        method selects hyperlink (work in "URL menu" only).

Examples:
  "Recode selection" Command(4182)
  "" Command(4182)
  "Sort lines" Call("Lines::SortStrAsc")
  -"Spell check" Call("Scripts::Main", 1, "SpellCheck.js", "")
  "Syntax highlighting" +Call("HighLight::Main")
  "Registry editor" Exec("regedit.exe")


*** External call ***

Call("ContextMenu::Main", 1, INDEX, "STRING")
  Parameters:
    1
      Open dialog and select menu.
    INDEX
      Combobox index number (default is 0).
    STRING
      Find string and select (default is "").
