TC 9: 'numeric parameter for commands'; allow ? parameter

Here you can propose new features, make suggestions etc.

Moderators: sheep, Hacker, Stefan2, white

User avatar
Stefan2
Power Member
Power Member
Posts: 2240
Joined: 2007-09-13, 22:20 UTC
Location: Europa

TC 9: 'numeric parameter for commands'; allow ? parameter

Post by *Stefan2 » 2016-06-10, 12:31 UTC

Related to
HISTORY.TXT wrote:5.05.16 Added: The following commands now accept a numeric parameter in the button bar or start menu:
CM_WAIT CM_SELECT CM_UNSELECT CM_REVERSE CM_GOTOFIRSTENTRY M_GOTOFIRSTFILE
CM_SWITCHDRIVE CM_DELETE CM_LEFTSWITCHTOTHISCUSTOMVIEW
CM_RIGHTSWITCHTOTHISCUSTOMVIEW CM_SEARCHFORINCURDIR CM_DIRECTORYHOTLIST (32/64)

I want to use CM_SELECT in button.

But since I can't add a question-mark '?' into the parameter box, (to prompt the user for wanted amount)

I want to suggest to let TC interpret a '?' entered as 'numeric parameter' as user wish
to show the command-preview box (like the '?' would be if entered into the parameter field).


CMD: CM_SELECT ?
PARAM:
ICON:
TOOLTIP:
Prompt user how many to select down.



 

User avatar
nsp
Power Member
Power Member
Posts: 1195
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: TC 9: 'numeric parameter for commands'; allow ? paramete

Post by *nsp » 2016-06-10, 15:39 UTC

Stefan2 wrote:Related to
HISTORY.TXT wrote:5.05.16 Added: The following commands now accept a numeric parameter in the button bar or start menu:
CM_WAIT CM_SELECT CM_UNSELECT CM_REVERSE CM_GOTOFIRSTENTRY M_GOTOFIRSTFILE
CM_SWITCHDRIVE CM_DELETE CM_LEFTSWITCHTOTHISCUSTOMVIEW
CM_RIGHTSWITCHTOTHISCUSTOMVIEW CM_SEARCHFORINCURDIR CM_DIRECTORYHOTLIST (32/64)
....
CMD: CM_SELECT ?
PARAM:
ICON:
TOOLTIP:
Prompt user how many to select down.
In fact the issue is that is it not known as command with parameter which allows you to add a question mark or use a %A if you embed it into em_command. The worst is that even on the command bar, you cannot use cm_select 3 (you only select one file at the time whatever the number you pass !).

It makes the command useless if you cannot enter any parameter from the command line or using a flexible em_cmd with %A.... and adding just ? on the cmd definition will not help.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36665
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-06-10, 19:49 UTC

Nice idea, I will try to add ? support and command line support.
Author of Total Commander
http://www.ghisler.com

User avatar
Stefan2
Power Member
Power Member
Posts: 2240
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 » 2016-06-16, 19:07 UTC

Total Commander 9.0 beta 2


CMD: CM_SELECT ? (Prompt user for wanted amount)
and
CMD: CM_SELECT ?50 (Prompt user with default amount)


works as button and on command line.




Good additional idea and very useful, thanks Mr. Ghisler.


Will test other commands too, if time permits.

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-16, 20:13 UTC

Would be useful also to send commands with parameters via WM_COPYDATA, just like EM-commands.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36665
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-06-17, 15:53 UTC

You can send them via wm_user+51, just put CM_SELECT in wParam and the number in lParam!
Author of Total Commander
http://www.ghisler.com

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-17, 17:01 UTC

ghisler(Author),
I mean that there are some commands with string parameters that can't be sent this way (e.g. SELECTFILES or OPENBAR1). So it would be nice to be able to send all commands from section 'with parameters' by sending them like they were typed in command line.

User avatar
nsp
Power Member
Power Member
Posts: 1195
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp » 2016-06-19, 06:27 UTC

MVV wrote:ghisler(Author),
I mean that there are some commands with string parameters that can't be sent this way (e.g. SELECTFILES or OPENBAR1). So it would be nice to be able to send all commands from section 'with parameters' by sending them like they were typed in command line.
MVV, if you give a look to the section command with parameter, you will not see any of these.
It is very unfortunate that we cannot have a standard way to call all TC commands and that the behavior of parameter is not the same from a button, menu or from command bar, external applications. (%L %S....)

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-19, 08:58 UTC

nsp,
I see CM_WAIT there. :)
Anyway, we need a way to call these commands, just like we can call cd or EM-commands via WM_COPYDATA.
Of course there is a way via creating separate EM-command for every command but...

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36665
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-06-19, 14:23 UTC

OK, I will allow cm_xyz commands via the WM_COPYDATA function accepting em_xyz commands.
Author of Total Commander
http://www.ghisler.com

User avatar
nsp
Power Member
Power Member
Posts: 1195
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp » 2016-06-20, 10:47 UTC

ghisler(Author) wrote:OK, I will allow cm_xyz commands via the WM_COPYDATA function accepting em_xyz commands.
Thanks a lot ghisler(Author) :D :)

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-22, 15:57 UTC

I can't make CM_commands with parameters working via WM_COPYDATA, nothing happens.

E.g.:

Code: Select all

TCFS2 /ef "tem(`em_AnyCommand`)" - works
TCFS2 /ef "tem(`CM_SELECT 5`)" - doesn't work
(tem command sends regular EM-command to TC)

However CM_SELECT 5 works in TC command line.


And, what about allowing all commands with parameters to be started via WM_COPYDATA? I mean commands like LOADSEARCH or SYNCOPEN...

User avatar
nsp
Power Member
Power Member
Posts: 1195
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp » 2016-06-22, 23:52 UTC

MVV wrote:I can't make CM_commands with parameters working via WM_COPYDATA, nothing happens.

E.g.:

Code: Select all

TCFS2 /ef "tem(`em_AnyCommand`)" - works
TCFS2 /ef "tem(`CM_SELECT 5`)" - doesn't work
(tem command sends regular EM-command to TC)

However CM_SELECT 5 works in TC command line.


And, what about allowing all commands with parameters to be started via WM_COPYDATA? I mean commands like LOADSEARCH or SYNCOPEN...
With Powerpro copydata for em cmd works also with cm_command ! TC 32/64bit 9b3
cm_select 6 works !

But Command with parameters like CD, SELECTFILES, OPENBAR, .... LOADSEARCH seems to not be supported yet. (unless wrapped into EM_XXX %A)

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-23, 07:23 UTC

Wow, cm_select 6 works with TCFS2 too!

So we have the following:
1. From TC command line command names are case insensitive.
2. From WM_COPYDATA for EM-comands command names are case sensitive.

It is strange why TC doesn't use same parser in both cases.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 36665
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-06-23, 09:38 UTC

Ah, you are half-right_ both the cm_ and em_ prefix must be lowercase to make it work! I will change it. For now, please use all lowercase commands, that should work.
Author of Total Commander
http://www.ghisler.com

Post Reply