Switch Icon on Button Bar ?

English support forum

Moderators: Hacker, petermad, Stefan2, white

islogged
Senior Member
Senior Member
Posts: 205
Joined: 2008-09-17, 00:57 UTC

Switch Icon on Button Bar ?

Post by *islogged »

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
Last edited by islogged on 2016-11-08, 14:35 UTC, edited 1 time in total.
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

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.
islogged
Senior Member
Senior Member
Posts: 205
Joined: 2008-09-17, 00:57 UTC

Post by *islogged »

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.
Hi,

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.
User avatar
silencer
Senior Member
Senior Member
Posts: 208
Joined: 2003-05-13, 13:18 UTC
Location: The Netherlands

Post by *silencer »

I don't think there is a way to configure this. TC could not know if a script is "ON or OFF" since it could be triggered outside TC also.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

TC doesn't support custom switch buttons. And you can't tell TC to reread specific buttonbar icon, sorry.

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).
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

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
User avatar
Damel
Member
Member
Posts: 130
Joined: 2003-02-06, 01:11 UTC
Location: Prague, Czech Republic

Post by *Damel »

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. :)
The best solution:
1. format C:
2. install TotalCmd
3. install Windows (optionally)
islogged
Senior Member
Senior Member
Posts: 205
Joined: 2008-09-17, 00:57 UTC

Post by *islogged »

TC could not know if a script is "ON or OFF" since it could be triggered outside TC also.
I never told that!
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. :)
Yah i deduce, but it can not manage most than one switch button.
TC doesn't support custom switch buttons. And you can't tell TC to reread specific buttonbar icon, sorry.
Ok!
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).
Nice work around, but i got pb with.
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.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Damel,
The rest of this craziness appears when you use multiple switch buttons so you need 2^N bar files. :D
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

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
islogged
Senior Member
Senior Member
Posts: 205
Joined: 2008-09-17, 00:57 UTC

Post by *islogged »

The rest of this craziness appears when you use multiple switch buttons so you need 2^N bar files. Very Happy
Exactly!

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?
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

It seems you disliked the idea of using indicator button!
islogged 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?
If you still using TC 8.52 then remove spaces, just em_Script,cm_VisButtonbar,cm_VisButtonbar
It is work with TC 9.0 even with spaces!!!
User avatar
petermad
Power Member
Power Member
Posts: 16134
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

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
cm_FtpHiddenFiles could be a good alternative.
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
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

petermad wrote:cm_FtpHiddenFiles could be a good alternative.
Indeed, i missed it!
islogged
Senior Member
Senior Member
Posts: 205
Joined: 2008-09-17, 00:57 UTC

Post by *islogged »

Hi
It seems you disliked the idea of using indicator button!
Ur post was not yet displayed when i wrote mine ^^
Anyway yeah, i don't like so much the idea to have two buttons to do the job of one.
If you still using TC 8.52 then remove spaces, just em_Script,cm_VisButtonbar,cm_VisButtonbar
Nice, that's work!
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 :(
Post Reply