cm_Null - Null command, always inactive
Moderators: white, Hacker, petermad, Stefan2
cm_Null - Null command, always inactive
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.
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.
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.
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
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
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
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:
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.
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
Neither solution is particularly convenient or elegant - but they'll work until we can be allowed to use cm_Null or cm_MenuItemDisabled.
- ghisler(Author)
- Site Admin
- Posts: 48021
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
You can use
CM_WAIT 0
on a button (doesn't work in command line).
CM_WAIT 0
on a button (doesn't work in command line).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Oh. Thanks.ghisler(Author) wrote:You can use
CM_WAIT 0
on a button (doesn't work in command line).
But I try to add string to main menu:Added: The following commands now accept a numeric parameter in the button bar or start menu: CM_WAIT ...
Code: Select all
MENUITEM "Commentary", CM_WAIT 0
"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
- ghisler(Author)
- Site Admin
- Posts: 48021
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
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
https://www.ghisler.com
But em command are alwaws active in main menu.ghisler(Author) wrote:Since it's a command with parameter, you need to put it inside a user command em_something.
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
With 2-3 thousand commands in menu any ways are good.Lefteous wrote:The normal way ...
Creating inactive menu items sounds quite unusual for me.
"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
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
Off the top of my head, Inactive Menu Items can be used for: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.
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.