Questions on pluginmsg(toolbars ...
I am trying to understand the format of the pluginmsg(toolbars... functions. I have some code running with the "COMMAND" in the code but I wish to have the "COMMAND" come from a variable. I had that work where "COMMAND" was a Command ID, but now I am trying to use a macro. I have an alert to show me the value in $_KS_Command and it looks the same as information coded in the line. However when I use the pluginmsg with all variables the button does not work when clicked.
The second question has to do with setting and reading the button checked value. I am setting to a "1" but reading that it is a "0".
I will post my test code. I am sure I am making a simple mistake, but I cannot spot the errors. Thanks for any help.
KeyStop.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- KeyStop.kmm
# T E S T I N G
# Dependencies : main.kmm KMListBox
# Resources : panorama image keystop.bmp in SKINS\DEFAULT
# Preferences : -
# Version : 0.5 7/03/09
# --------------------------------------------------------------------------------
KeyStop_RunCode{
alert("Button Action", "KeyStop", INFO);
#pluginmsg(toolbars, "CheckButton", "KeyStopBar,CloseOther",1);
pluginmsg(toolbars, "CheckButton", "KeyStopBar,CloseOther,1");
alert("checked set to interger 1","DEBUG",INFO);
$_KeyStop_bChecked = pluginmsgex(toolbars, "IsButtonChecked", "KeyStopBar,CloseOther", INT);
alert($_KeyStop_bChecked, "Value for $_KeyStop_bChecked DEBUG", INFO);
}
#From plugin documentation
# $bChecked = pluginmsgex(toolbars, "IsButtonChecked", "<ToolbarName>, <ButtonID>", INT);
# $bEnabled = pluginmsgex(toolbars, "IsButtonEnabled", "<ToolbarName>, <ButtonID>", INT);
# pluginmsg(toolbars, "CheckButton", "<ToolbarName>, <ButtonID>, [0|1]");
# pluginmsg(toolbars, "EnableButton", "<ToolbarName>, <ButtonID>, [0|1]");
# pluginmsg(toolbars, "SetButtonImage", "<ToolbarName>, <ButtonID>, [HOT|COLD|DEAD], Path/to/new/image.bmp[0]");
# pluginmsg(toolbars, "AddToolbar", "<ToolbarName>, <ButtonWidth>, <ButtonHeight>","");
# pluginmsg(toolbars, "AddButton", "<ToolbarName>, <ButtonName>, <Command>, <MenuName>, <TooltipText>, <ButtonWidth>, <ButtonHeight>, hot.bmp[0], cold.bmp[0], dead.bmp[0]","");
_KeyStop_BuildBar{
$_KS_ToolbarName = "KeyStopBar" ;
$_KS_BSize = "16" ;
$_KS_LastItem = "" ;
$_KS_AddBarTag = $_KS_ToolbarName .",". $_KS_BSize .",". $_KS_BSize .",". $_KS_LastItem ;
pluginmsg(toolbars, "AddToolbar", $_KS_AddBarTag);
$_KS_ButtonName = "CloseOther" ;
#$_NB_Command = ID_CLOSE_ALLOTHERTAB ;
$_KS_Command = "macros(\".\"KeyStop_RunCode\".\")" ;
alert($_KS_Command, "$_KS_Command DEBUG", INFO);
$_KS_MenuName = "" ;
$_KS_tipText = "Disable/Enable local keys";
$_KS_ImageHot = "keystop.bmp[2]" ;
$_KS_ImageCold = "keystop.bmp[0]" ;
$_KS_ImageDead = "keystop.bmp[1]" ;
## Create third parameter for pluginmsg
#$_KS_AddButtonTag = $_KS_ToolbarName.",".$_KS_ButtonName.",".$_KS_Command.",".$_KS_MenuName.",".$_KS_tipText.",".$_KS_BSize.",".$_KS_BSize.",".$_KS_ImageHot.",".$_KS_ImageCold.",".$_KS_ImageDead.",".$_KS_LastItem ;
$_KS_AddButtonTag = $_KS_ToolbarName.",".$_KS_ButtonName.",macros("."KeyStop_RunCode"."),".$_KS_MenuName.",".$_KS_tipText.",".$_KS_BSize.",".$_KS_BSize.",".$_KS_ImageHot.",".$_KS_ImageCold.",".$_KS_ImageDead.",".$_KS_LastItem ;
pluginmsg(toolbars, "AddButton", $_KS_AddButtonTag);
}
$OnSetup=$OnSetup."_KeyStop_BuildBar;";
$macroModules=$macroModules."KeyStop;";