Toggle button - how to make it?

Hello!

I'd like to create button which performs different operations for every odd and even click (I'd like to toggle between most used folder formats). How to do it?

X.

Some buttons can be set to cycle between options with each click.

e.g. You can have a button which toggles between Details and Thumbnails modes:
Set VIEW=Details,Thumbnails

Some buttons toggle automatically.

e.g. Filter buttons will clear the filter if it's already set the same as in the command:
Set SHOWFILTERFILENAME="*.(dll|exe|tlb|lib)"

But in other cases you will probably have to compromise by making a Three-Button where the left-click sets one thing and the right-click sets another.

Of course you could drop GPSoft a feature request if you want the cycling or toggling functionality extended to other commands, like the Folder Formats one. That seems like a reasonable idea to me, although I don't know how hard it would be to implement.

Thanks nudel.
I think I will simply assign the formats to RMB/LMB on the same button.

X.

Heh, you COULD fake such a button. It's not very nice, but I suppose it works.

Here is how:

  • Suppose you want to execute some command lets call it on the odd clicks and a command on the even clicks.
  • Duplicate the toolbar where you want to place your button. Lets call the original toolbar foo and the copy of the toolbar bar.
  • Create a button with the following body on toolbar foo:

Toolbar NAME=foo TOGGLE
Toolbar NAME=bar TOGGLE

  • Create a button with the following body on toolbar bar:

Toolbar NAME=foo TOGGLE
Toolbar NAME=bar TOGGLE

  • Turn on one toolbar and turn off the other one.

There you go. Depending on which toolbar you use, toolbar placement can become an issue.

This also scales to more actions like this: (initially: one is on)
Toolbar NAME=one TOGGLE
Toolbar NAME=two TOGGLE

Toolbar NAME=two TOGGLE
Toolbar NAME=three TOGGLE

Toolbar NAME=three TOGGLE
Toolbar NAME=one TOGGLE

However, toolbar content management WILL become annoying with so many duplicates.