Hello again siria, Johnhell, Rodocop.
I think this version is finally correct. I have used this page to test.
http://www.adobe.com/software/flash/about/
At least I now know that I can do this in the new style code.
Siria, I guess you can't test unless you get you 'other' machine going. You are most helpful at pointing out the things I often overlook when coding. I sometimes cannot see the forest because all the trees are in the way.
JohnHell, I am going to test this code on KM 75.0 right after this post. I think it should work. My memory is bad, but I think the problem that I had with 75 was the very tight sweet spot for the cursor when clicking on the button. I will check. EDIT:: Seems to work fine in 75.
Rodocop, I hope this will run in your system. Please let me know either way.
I did find that I was too much focused on the value for $_F2AF_Current in toggle when I needed to change the one in sync. Once I figured that out things went much better. Looks like the docs are OK.
fa2_flag.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#
# ---------- fa2_flag.kmm
# ---------- Allow user to set the status of "plugin.state.flash" between always and never.
# ---------- The "ask before" option is not addressed here
#
# Dependencies : main.kmm
# Reference : "http://kmeleonbrowser.org/forum/read.php?1,140996"
# Resources : flashB.png
# Preferences : "plugin.state.flash"
# Version : 3.0 2017_03_13
# Author : JamesD
# -----------------------------------------------------------------------------------------------
_fa2_flag_RunCode {
$_fa2_flag_TTip = "Flip Flash activate between\n ALWAYS ON (gold) / NEVER ON (red)";
addtoolbar("fa2_flag") ;
addbutton("fa2_flag", "macros(_fa2_flag_Toggle)", "fa2_flag", $_fa2_flag_TTip);
setcmdicon( "macros(_fa2_flag_Toggle)", "flashB.png[1,16,16]", "flashB.png[2,16,16]" );
macros("_fa2_flag_Button_Sync");
}
_fa2_flag_Button_Sync {
## --- SYNC BUTTON TO PREF --- ##
$_F2AF_Current = getpref( INT, "plugin.state.flash");
$_F2AF_Current == 2 ? $__v = 0 : $__v = 1 ;
checkbutton( "fa2_flag", "macros(_fa2_flag_Toggle)", $__v ) ;
}
_fa2_flag_Toggle {
togglepref( INT, "plugin.state.flash", 0,2);
macros("_fa2_flag_Button_Sync");
if ($_F2AF_Current == 2 ) {
statusbar( "Flash activate is ALWAYS ON. ");
} else {
statusbar( "Flash activate is NEVER ON. " );
}
}
#------------------------------------------------------------------
$OnSetup=$OnSetup."_fa2_flag_RunCode;";
$macroModules=$macroModules."fa2_flag;";
Edited 1 time(s). Last edit at 03/13/2017 07:21PM by JamesD.