cm_Null - Null command, always inactive

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

cm_Null - Null command, always inactive

Post by *LonerD »

When creating your own main menu commands are grouped similar purpose. For example, - opening a file, copying a variety of ways, archiving, administration, multimedia etc.
I would like to make comments in the menu for these groups.
For now I use this command 555 - cm_FtpResumeDownload. It displays the inactive (blocked) menu item. But if connected FTP, - then menu are active and can be accidentally pressed.

Request to add new command that would do nothing and always displayed on the main menu as inactive.
Last edited by LonerD on 2016-06-09, 13:28 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Support++

As a workaround you can make a userdefined command like:

[em_comment]
cmd=cd

This can be used in the Menu for comments, but it will not be shown as inactive. If you accidently click on a line with that command, nothing happens, but you don't get an error message.
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
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

You can also put in a fake cm_, such as "cm_"
It will be disabled, but it will also announce (every instance of) the error via a pop-up when the MainMenu/Language is loaded.

To handle the pop-up - you could use something like this:

Code: Select all

return
#ifWinActive ahk_class #32770
!Enter::SetTimer, TCLanguageUnknownID, 50
#ifWinActive


TCLanguageUnknownID:
	ControlGetText, unknown, Static2, ahk_class #32770
	if(RegExMatch(unknown, "^Unknown identifier in line (\d+) of menu file:.cm_", rTmp))
		ControlClick, Button1, ahk_class #32770
	else
		SetTimer, TCLanguageUnknownID, OFF
	WinWaitActive, ahk_class #32770,,1
return

Press Alt+Enter when the error comes up. Then all the error boxes will get "auto-clicked" until there are no more.


Neither solution is particularly convenient or elegant - but they'll work until we can be allowed to use cm_Null or cm_MenuItemDisabled.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

BTW information menu items may be used to display detailed message box with hint. :) You just need to create corresponding EM-command.
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Post by *LonerD »

2 year UP
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Post by *LonerD »

Hope it will be added in TC9
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can use
CM_WAIT 0
on a button (doesn't work in command line).
Author of Total Commander
https://www.ghisler.com
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Post by *LonerD »

ghisler(Author) wrote:You can use
CM_WAIT 0
on a button (doesn't work in command line).
Oh. Thanks.
Added: The following commands now accept a numeric parameter in the button bar or start menu: CM_WAIT ...
But I try to add string to main menu:

Code: Select all

MENUITEM "Commentary", CM_WAIT 0
and Total can't start.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Since it's a command with parameter, you need to put it inside a user command em_something.
Author of Total Commander
https://www.ghisler.com
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Post by *LonerD »

ghisler(Author) wrote:Since it's a command with parameter, you need to put it inside a user command em_something.
But em command are alwaws active in main menu.
It would be great to make inactive command (always grey without possibility to press it) for commentaries or titles.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2LonerD
The normal way to group menu items would be to put them between two menu separators. If it's a main group consider creating a top level menu item.
Creating inactive menu items sounds quite unusual for me.
User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

Post by *LonerD »

Lefteous wrote:The normal way ...
Creating inactive menu items sounds quite unusual for me.
With 2-3 thousand commands in menu any ways are good.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Lefteous wrote:2LonerD
The normal way to group menu items would be to put them between two menu separators. If it's a main group consider creating a top level menu item.
Creating inactive menu items sounds quite unusual for me.
Off the top of my head, Inactive Menu Items can be used for:
1) TITLE/separator for commands underneath.
2) A Menu list of Keyboard shortcuts.

I've used "cm_return" as the command target for #2, but its quite hacky.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Post Reply