MNU: best encoding,notation,syntax of commands for menu files?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MaxX
Power Member
Power Member
Posts: 1024
Joined: 2012-03-23, 18:15 UTC
Location: UA

MNU: best encoding,notation,syntax of commands for menu files?

Post by *MaxX »

Hi all.
As I see, wcmd_eng.mnu and another menus use some DEC code from totalcmd.inc to get cm_... action.
Also I see some people's menus with $HEX codes.
Even more, I also see some cm_... and em_... just instead of the any codes.
Wich practice is the best? And reliably?
Wich of these works good on old TC versions or old Windows?
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Menu commands encoding

Post by *petermad »

One benefit of using the numbers like: 2950 instead of cm_SwitchDarkmode is that if you use the menu with an older version of TC which does not support the command, then TC will not generate an error on startup, but simply just disable the menu item (grey it out).

em_commands cannot be replaced with numbers in the menu.

But em_commands can be given a number in the wcmicons.inc file (to use an icon from wcmicons.dll for that em_command in the menu) - the first em_command in a menu has number 10000 and so on

It is tough to maintain those 10000+ numbers in wcmicons.inc because each time a new em_command is put into the .mnu file, all the em_commands that comes after that has to have their number changed in wcmicons.inc
Last edited by petermad on 2020-01-24, 12:26 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MaxX
Power Member
Power Member
Posts: 1024
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: Menu commands encoding

Post by *MaxX »

Could anyone move the topic to "Total Commander (English)" folder, please.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Menu commands encoding

Post by *Hacker »

[mod="Hacker"]Moved to the English forum.[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
MaxX
Power Member
Power Member
Posts: 1024
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: Menu commands encoding

Post by *MaxX »

Thanks.

As I see, the best should be DEX code? AFAIK, inc files include DEC numbers for commands, it should be easier to just copy/paste needed item instead of conversion DEC-HEX.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Menu commands encoding

Post by *petermad »

The "Main Menu Editor" from Ultra TC Editors can do that automatically for you - https://madsenworld.dk/tcmd/ultratceditor.png

https://sites.google.com/site/ultratceditors/ultra_tc_editors
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MaxX
Power Member
Power Member
Posts: 1024
Joined: 2012-03-23, 18:15 UTC
Location: UA

Re: Menu commands encoding

Post by *MaxX »

Thanks.
That needs to be tested.
Ukrainian Total Commander Translator. Feedback and discuss.
Post Reply