Example: Manual sort ON/OFF state:
1) Add a custom user button to toolbar.
2) Then paste the below code in the on-click field.
You'll ofcourse need the icons from the zip file to be placed in xyicons folder for this to work.
Code: Select all
// Manual Sort toggle
if (ctbicon() == "hand.ico") {
ctbicon("drag-green.ico");
#414;//Toggle Manual Sort
} else {
ctbicon("hand.ico");
#414;//Toggle Manual Sort
}
Basically all I am doing is renaming the icons and refreshing them which gives the icon toggle effect.
Example: Manual sort ON/OFF state:
1) Add a custom user button to toolbar and set the icon as <xyicons>\hand.ico.
2) Then paste the below code in the on-click field.
Note that I have my OFF icon state as "hand" and ON icon state "drag-green". If you rename your icons to something else, make sure you change that in the first 2 lines below.
[code]
//Toggle Manual Sort
$icon1="hand";
$icon2="drag-green";
$fakename="fakeicon";
renameitem ("$fakename", "<xyicons>\$icon2.ico");
renameitem ("$icon2", "<xyicons>\$icon1.ico");
renameitem ("$icon1", "<xyicons>\$fakename.ico");
#502;//Refresh Icons
#414;//Toggle Manual Sort
[/code]
Edit: SC swapnames would have been perfect, but for that I have to preselect filenames.
XYplorer Beta Club