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

English support forum

Moderators: sheep, Hacker, Stefan2, white

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

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?
User avatar
petermad
Power Member
Power Member
Posts: 9854
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, 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 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (2004) 64bit, 'Everything' 1.4.1.992 (x64)
TC 3.10 on Android 6.0
Get:
Extended TC Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MaxX
Power Member
Power Member
Posts: 700
Joined: 2012-03-23, 18:15 UTC
Location: Earth

Re: Menu commands encoding

Post by *MaxX »

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

Re: Menu commands encoding

Post by *Hacker »

Message from moderator Hacker

Moved to the English forum.
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: 700
Joined: 2012-03-23, 18:15 UTC
Location: Earth

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.
User avatar
petermad
Power Member
Power Member
Posts: 9854
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, 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 9.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (2004) 64bit, 'Everything' 1.4.1.992 (x64)
TC 3.10 on Android 6.0
Get:
Extended TC Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MaxX
Power Member
Power Member
Posts: 700
Joined: 2012-03-23, 18:15 UTC
Location: Earth

Re: Menu commands encoding

Post by *MaxX »

Thanks.
That needs to be tested.
Post Reply