Switch Icon on Button Bar ?
Moderators: Hacker, petermad, Stefan2, white
Switch Icon on Button Bar ?
Hi!
Is that possible to make a switch icon in the button bar of TC?
Example:
I press the button once, icon write ON
I press the button again, icon write OFF
Thanks
Is that possible to make a switch icon in the button bar of TC?
Example:
I press the button once, icon write ON
I press the button again, icon write OFF
Thanks
Last edited by islogged on 2016-11-08, 14:35 UTC, edited 1 time in total.
Hi,TC already do this if the command assigned to the button is toggle type e.g. cm_SwitchHidSys, cm_SwitchLongNames and many others. The button shown as pressed/unpressed but the icon remains as it is.
Yeah, i know already this, but as u tell it's not my question.
All buttons are not cm_commandes but some are personal shortcuts.
My button call a script, after one call script is ON, after tow call script is OFF.
I ve iconON.ico and iconOFF.ico files, how i can make it a switch visible icon in the button bar of TC.
That's my question...
Thanks

Last edited by islogged on 2016-11-09, 05:57 UTC, edited 1 time in total.
A related idea was to display a button that changes to the current folder as pushed:
http://www.ghisler.ch/board/viewtopic.php?p=315795#315795
http://www.ghisler.ch/board/viewtopic.php?p=315795#315795
I never told that!TC could not know if a script is "ON or OFF" since it could be triggered outside TC also.
Yah i deduce, but it can not manage most than one switch button.Another crazy way is thru making of two almost identical button bars, one with ON and one with OFF icon. The rest of this craziness you probably already deduce.
Ok!TC doesn't support custom switch buttons. And you can't tell TC to reread specific buttonbar icon, sorry.
Nice work around, but i got pb with.Of course there is a crazy way, but it is crazy (replace icon file, delete BR2 file and switch buttonbar off/on so TC will have to reread all icons).
Ur work around need to chain a script.cmd (for replace and delete job) + cm_VisButtonbar (bar off) + cm_VisButtonbar (bar on)
If i can chain multiples cm_commands on the commande button, example:
cm_VisButtonbar, cm_VisButtonbar
I can not chain:
path\script.cmd, cm_VisButtonbar, cm_VisButtonbar
or an em_command (who call the script):
em_Script, cm_VisButtonbar, cm_VisButtonbar
TC return an "File not found' Combo box in this case.
Then How to do?
Need also to find a work around for this

If u can fix that, ur work around will work i think ...
But actually it didn't !
Thx
Last edited by islogged on 2016-11-10, 07:49 UTC, edited 1 time in total.
2islogged
Another crazy way is to use indicator button beside your script button
1- Create user command to run your script, name it e.g. em_Script
2- Add two neighbor buttons,
3- Assign this to the first button em_Script, cm_VisHistHotButtons
4- Assign this to the second button cm_VisHistHotButtons with suitable icon
Now when you run the script, the second button will checked, and when run the script again, the second button will unchecked
I used cm_VisHistHotButtons because i cannt find other better command, i thinked for cm_ToggleLockCurrentTab, cm_SwitchHidSys or cm_SwitchHid but cm_VisHistHotButtons is less impact TC's UI than others
Another crazy way is to use indicator button beside your script button
1- Create user command to run your script, name it e.g. em_Script
2- Add two neighbor buttons,
3- Assign this to the first button em_Script, cm_VisHistHotButtons
4- Assign this to the second button cm_VisHistHotButtons with suitable icon
Now when you run the script, the second button will checked, and when run the script again, the second button will unchecked
I used cm_VisHistHotButtons because i cannt find other better command, i thinked for cm_ToggleLockCurrentTab, cm_SwitchHidSys or cm_SwitchHid but cm_VisHistHotButtons is less impact TC's UI than others
Exactly!The rest of this craziness appears when you use multiple switch buttons so you need 2^N bar files. Very Happy
Anyway my last post/pb stay open ^^
Because for this time i need 2 buttons.
One who call the script who do this: "replace icon file, delete BR2 file"
and One who do this: "switch buttonbar off/on so TC will have to reread all icons"
I can chain the both in one command button ...
Any ideas?
It seems you disliked the idea of using indicator button!
It is work with TC 9.0 even with spaces!!!
If you still using TC 8.52 then remove spaces, just em_Script,cm_VisButtonbar,cm_VisButtonbarislogged wrote:or an em_command (who call the script):
em_Script, cm_VisButtonbar, cm_VisButtonbar
TC return an "File not found' Combo box in this case.
Then How to do?
It is work with TC 9.0 even with spaces!!!
cm_FtpHiddenFiles could be a good alternative.I used cm_VisHistHotButtons because i cannt find other better command, i thinked for cm_ToggleLockCurrentTab, cm_SwitchHidSys or cm_SwitchHid but cm_VisHistHotButtons is less impact TC's UI than others
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Hi
Anyway yeah, i don't like so much the idea to have two buttons to do the job of one.
But still have another problem...
cm_VisButtonbar,cm_VisButtonbar are executed immediately after em_Script.
It's Ok, but em_Script don't have time to do the job (replace icon file and delete BR2 file) before than the button bar switch Off/On
I need something like this:
em_Script,cm_waitASecond,cm_VisButtonbar,cm_VisButtonbar
Any ideas?
Actually i call an autoitScript at the end of my mainScript (em_Script) which mimic a keyboard shortcut who switch On/Off the Button Bar in TC ... It work, but it's a fucking patch-up job
Ur post was not yet displayed when i wrote mine ^^It seems you disliked the idea of using indicator button!
Anyway yeah, i don't like so much the idea to have two buttons to do the job of one.
Nice, that's work!If you still using TC 8.52 then remove spaces, just em_Script,cm_VisButtonbar,cm_VisButtonbar
But still have another problem...
cm_VisButtonbar,cm_VisButtonbar are executed immediately after em_Script.
It's Ok, but em_Script don't have time to do the job (replace icon file and delete BR2 file) before than the button bar switch Off/On

I need something like this:
em_Script,cm_waitASecond,cm_VisButtonbar,cm_VisButtonbar
Any ideas?
Actually i call an autoitScript at the end of my mainScript (em_Script) which mimic a keyboard shortcut who switch On/Off the Button Bar in TC ... It work, but it's a fucking patch-up job
