***************************************************************** *** ToolBar AkelPad plugin v7.3 *** ***************************************************************** 2011 Shengalts Aleksander aka Instructor (Shengalts@mail.ru) *** Description *** Displays customizable tool bar menu. Remarks: - Right mouse click on the toolbar button opens the preferences dialog with the button code selected. *** Functions *** ToolBar::Main Main function for start and stop plugin. *** Syntax *** Variables: %f active file %d directory of active file %a AkelPad's directory %m tool bar ID (handle) %i button item ID %% symbol % %system variable% Comments: # comment ; comment Special buttons: SEPARATOR separator button. Button creation: [-]"[button text]" [Command() | Call() | +Call() | Exec() | OpenFile() | SaveFile() | Font() | Recode() | Insert()] Icon() [-]"[button text]" "My Button" text appearing in the screen tip at mouse moving on the button. -"My Button" at presence of a minus sign the button status will not change somehow (become inactive, be pressed). "" at absence of the button 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. 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. 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. OpenFile("file", [OpenCodepage], [OpenBOM]) "file" File to open. OpenCodepage Open codepage. If -1 or not specified, it will be autodetected. OpenBOM File byte order mark. If -1 or not specified, it will be autodetected. OpenFile("C:\File.txt", 65001, -1) method opens file in UTF-8 codepage. SaveFile("file", [SaveCodepage], [SaveBOM]) "file" Save current document to a specified file name. SaveCodepage Save codepage. If -1 or not specified, current codepage will be used. SaveBOM File byte order mark. 1 - exist, 0 - doesn't exist, -1 or not specified - current BOM will be used. SaveFile("C:\File.txt", 65001, 0) method saves file in UTF-8 codepage without BOM. 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", [Esc-sequences]) "text" Inserted text. Esc-sequences: 0 "text" isn't contain Esc-sequences (default). 1 "text" contain Esc-sequences. A set of sequences similar to the find/replace dialog in the program, and also: "\s" - replaced by the selected text of the editing window; "\|" - set the caret position after text insertion. Insert("Some string") method replaces selection with the specified text. Insert("\s", 1) method enclose selection. Insert("\[0031 0032 0033]", 1) method replaces selection with "123". Icon(["file"], [index]) Icon("Shell32.dll", 47) icon located in file Shell32.dll under index 47. Icon("%a\AkelFiles\Plugs\Explorer.dll") icon located in file Explorer.dll under index 0. Icon("%a\AkelFiles\Plugs\Toolbar\MyIcon.ico") icon located in file MyIcon.ico. Icon(12) icon located in file ToolBar.dll under index 12. Examples: "Recode selection" Command(4182) Icon(0) "" Command(4182) Icon(0) "Sort lines" Call("Format::LineSortStrAsc") Icon(0) -"Spell check" Call("Scripts::Main", 1, "SpellCheck.js", "") Icon(0) "Syntax highlighting" +Call("Coder::Highlight") Icon(0) "Registry editor" Exec("regedit.exe") Icon("regedit.exe")