Extensions
: K-Meleon Forum
All about K-Meleon extensions.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=rodocop] OK. Lesson 1 :D 1) Open your [b]quicknote.kmm[/b] by notepad (or your preferred text editor) 2) Add this portion of code somewhere near the end of macro (I've put it between '[b]Accels[/b]' section and [b]$OnInit[/b] command) [code] QN_BuildToolbar{ $qn_tip1=_("Add to QuickNote"); pluginmsg(toolbars,"AddToolbar","QuickNote,16,16",""); pluginmsg(toolbars,"AddButton","QuickNote,quicknote1,macros("."QuickNote_Text"."),"."App Launchers".",".$qn_tip1.",16,16,"."TabDinBkGnd.bmp[1],TabDinBkGnd.bmp[1]",""); } [/code] This creates new toolbar with 1 button which sends [b]selected text[/b] to QuickNote How it works? Look: • [b][color=#006600]$qn_tip1=_("Add to QuickNote");[/color][/b] - this line sets tooltip for your button (you need as many such lines as many buttons you want to create - give them unique names, changing number after [b]$qn_tip[/b] - 2, 3, 4 etc. Real coders prefer to start numeration from 0 but I've started from 1 - no matter, it make sense only whether name is unique across all the macros bunch and it wouldn't confuse yourself:P) • [b][color=#006600]pluginmsg(toolbars,"AddToolbar","QuickNote,16,16","");[/color][/b] Your plugin (macro) sends to KM a message to '[b]Add Toolbar[/b]' which is named '[b]QuickNote[/b]' and consists of buttons which are [b]16x16[/b] pixels in size [sub]In other macros you can skip this step if you plan to add buttons from other extensions to this toolbar not creating their own bars.[/sub] • [b][color=#006600]pluginmsg(toolbars,"AddButton","QuickNote,quicknote1,macros("."QuickNote_Text"."),"."&QuickNote".",".$qn_tip1.",16,16,"."TabDinBkGnd.bmp[1],TabDinBkGnd.bmp[1]","");[/color][/b] This is message to '[b]Add button[/b]' to the '[b]QuickNote[/b]' toolbar; '[b]qiucknote1[/b]' is the button name (you define this); [b]macros("."QuickNote_Text".")[/b] is the command that refers to one of the functions defined in macro earlier (by author). I've chosen [b]QuickNote_Text[/b] to send selected text, but one can choose another function or create 2nd (3rd, 4th, etc.) button on the toolbar [sub](for next buttons you need more [b]pluginmsg(toolbars,"AddButton",...)[/b] lines in macro)[/sub] Next goes tooltip ([b]".$qn_tip1."[/b]), button sizes ([b]16,16[/b]) and then image address for 'hot', 'cold' and 'dead' states of the button. I've inserted here address of one random button from my installationbut you need to get or create specific bmp-file with needed icons, place it in [b]skins\default[/b] folder and paste its filename in this macro command. 3) add the next line [code] $OnSetup=$OnSetup."QN_BuildToolbar;"; [/code] after this one[code] $OnInit=$OnInit."_QuickNote_BuildMenu;"; [/code] 4) save your macro and restart KM if was running. If you need additional explanation about buttons creation and handling - this will be Lesson 2.:D[/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development