Can Usercmd request fixed number?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
thomasmo
Junior Member
Junior Member
Posts: 81
Joined: 2013-11-04, 01:31 UTC

Can Usercmd request fixed number?

Post by *thomasmo »

the Usercmd like em_xxx put in menu get it code number when the TC startup, if I often trange the cmd, it will be very very troublesome

I hope I can request fixed number for my cmd like that

[em_xxx]
code=32

and the number begin from 20000, the em_xxx would get the code 20032 or any other way
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6481
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

There is no need for any number in em_ commands.
I have a lot of them and none has any number, just meaningfull names.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

Horst.Epp wrote:There is no need for any number in em_ commands.
Code is required if you are mapping icons to external command

@thomasmo
Main Menu Editor has a feature to Customize TC's mapping file, it can auto update these codes for you.
Ultra TC Editors help wrote:(*) External commands takes high codes starting from 10,000 onward according to their order in the menu file, that's mean if their order changed while editing the menu file, they will lose their mapped icons because their code in the mapping file remains as before, and this will cause Total Commander maps their icons to different external commands.

(*) When saving the menu file, Main Menu Editor will update the mapping file if it detects difference between external command's new code and their previous code.
User avatar
thomasmolover
Member
Member
Posts: 167
Joined: 2016-12-12, 01:32 UTC

Post by *thomasmolover »

ts4242 wrote:
Horst.Epp wrote:There is no need for any number in em_ commands.
Code is required if you are mapping icons to external command

@thomasmo
Main Menu Editor has a feature to Customize TC's mapping file, it can auto update these codes for you.
Ultra TC Editors help wrote:(*) External commands takes high codes starting from 10,000 onward according to their order in the menu file, that's mean if their order changed while editing the menu file, they will lose their mapped icons because their code in the mapping file remains as before, and this will cause Total Commander maps their icons to different external commands.

(*) When saving the menu file, Main Menu Editor will update the mapping file if it detects difference between external command's new code and their previous code.
yes, it is my wish, thank you, but I think if it can be solve by TC self
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I think an even better idea was if TC's Menu could use the value of the button= parameter from the [em_command] - that way we could also use other icons in the Menu than just those in the icon library.

It might need a cache file that corresponds to the used menu file (like wcmd_mymenu_eng.mn2 to wcmd_mymenu_eng.mnu) just like the button bar has its .br2 files - but honestly - if I delete my .br2 files and restart TC, I don't see much of a difference in the speed of loading button bars, even with many external icons, so maybe a cache for menu icons isn't necessary.
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.50 on Android 6 & 13
Try: 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 »

Another idea is saving the external commands mapping in a new section where the command's name is used instead of the command's position, using the command's name guarantee the mapped icon will not change when the command's position change, it is also easier to work with command's name instead of command's code which is frequently change, e.g.

Code: Select all

[mappings]
69=26
70=52
100=21
.
.
.
[em_mappings]
em_ext_calc=91
em_ext_mspaint=92
em_ext_notepad=93
.
.
.
This is good for backward compatibility, if the section [em_mappings] exist then TC use its contents for mapping, otherwise use the section [mappings] as before.
User avatar
thomasmolover
Member
Member
Posts: 167
Joined: 2016-12-12, 01:32 UTC

Post by *thomasmolover »

ts4242 wrote:Another idea is saving the external commands mapping in a new section where the command's name is used instead of the command's position, using the command's name guarantee the mapped icon will not change when the command's position change, it is also easier to work with command's name instead of command's code which is frequently change, e.g.

Code: Select all

[mappings]
69=26
70=52
100=21
.
.
.
[em_mappings]
em_ext_calc=91
em_ext_mspaint=92
em_ext_notepad=93
.
.
.
This is good for backward compatibility, if the section [em_mappings] exist then TC use its contents for mapping, otherwise use the section [mappings] as before.

this is very good idear,
Actually, the em_xx cmds already specify to the icon file, and the toolbar can displayit but the menu not. I only think it can
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ts4242
This is also a good idea - it doesn't give us external icons though.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply