I have your new version working with a left or right click which would add different CTBs. Something like this in the beginning...
Code: Select all
if (<get trigger> == 1) {
$added_CTBs = "ctb10,ctb14,ctb15"; }
if (<get trigger> == 2) {
$added_CTBs = "cks,cfi,cbx"; }One item I was wondering about even before you posted version 2 though has nothing to do with left or right click, it has to do with $curctb and if you have a timed collapse, where $collapse is either -1 or any positive number, the variable $curctb really doesn't need to be on the new toolbar, only the new additions have to be there (i.e., why would you need $curctb in the timed state because you know if you don't do anything it's going away in "x" number of second anyway). On the other hand if you have $collapse set to "0" for a manual collapse it is absolutely necessary. So I added something like this...
Code: Select all
if ($collapse == "0") {
$newtoolbar=replace($toolbar,"$curctb","$curctb,$added_CTBs,-") ; }
else {$newtoolbar=replace($toolbar,"$curctb","$added_CTBs,-") ; }
I suppose if we wanted to get really fancy and stick with just a left click as you have it, you could have the right click bring up a edit menu with a listing of the CTBs and select which ones you want to add. Thanks again for the script. It will become very handy.
Ken
XYplorer Beta Club