additional internal commands for sort orders

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
JustAnotherTCUser
Member
Member
Posts: 149
Joined: 2008-10-14, 17:12 UTC

additional internal commands for sort orders

Post by *JustAnotherTCUser »

hi,

there are commands like cm_SrcSortByCol1.
these toggle the sort order if column is already sorted.

for better handling sort orders by plugins, what about a set of new commands like cm_SrcSortByCol1Asc & cm_SrcSortByColDesc ?

integrating should be a simple task... ;-)

regards
User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

Just invoke the command another time and that will reverse the current sort order.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Or use TCMC.exe ...

Code: Select all

button8=%Commander_Path%\wcmIcons.dll,52
cmd8=%TCMC% CMcm_SrcSortByCol1 CMcm_SrcNegOrder
menu8=Sort Col1 Reversed
Where TCMC has been SET, by the .CMD I use to launch TC.

RunTC.cmd

Code: Select all

@ECHO OFF
SET PATH=%SYS32%;C:\WIN2K;%wuBIN%;%wuBin%\exCMD;%wuBIN%\exDOS;%SYS32%\Wbem
SET TC=%ProgramFiles%\TotalCMD
SET TCmd=%TC%\TotalCMD.exe
SET TCMC=%TC%\TOOLS\TCMC.exe 50
SET APPLOCAL=%USERPROFILE%\Local Settings\Application Data
START "" "%ProgramFiles%\TotalCMD\TotalCMD.exe"
JustAnotherTCUser
Member
Member
Posts: 149
Joined: 2008-10-14, 17:12 UTC

Post by *JustAnotherTCUser »

hi,

doesn't work as expected.
both commands toggle the sort order if this column is already sorted.

the only way i know to get a defined state is, sorting any other column and then sort the desired column.

but that's only a unsatisfying workaround...

regards
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

AH, Would need to Unsort first then.

Code: Select all

button8=%Commander_Path%\wcmIcons.dll,52 
cmd8=%TCMC% CMcm_Unsorted CMcm_SrcSortByCol1 CMcm_SrcNegOrder 
menu8=Sort Col1 Reversed
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Balderstrom wrote:AH, Would need to Unsort first then.
The problem is that this will add another sort change. It may have much time to change sort method triple.
User avatar
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

Having the same frustrating problem.

If using the cm_SrcSortByCol1 while it is already sorted, will toggle the sort direction :(

I strongly support the OP suggestion:
adding a new cm_SrcSortByCol1Asc & cm_SrcSortByCol1Desc, cm_SrcSortByCol2Asc ect... would be perfect and natural to use.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Have you tried to chain 2 commands, e.g.
cm_SrcUnsorted,cm_SrcSortByCol1
or 3:
cm_SrcUnsorted,cm_SrcSortByCol1,cm_SrcSortByCol1
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author),
It will be too slow in large folders...
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I strongly support the OP suggestion:
adding a new cm_SrcSortByCol1Asc & cm_SrcSortByCol1Desc, cm_SrcSortByCol2Asc ect... would be perfect and natural to use.
It should rather be implemented the same way as it if for the other sort functions - with a parameter:

history.txt
20.09.16 Added: The following internal commands now accept parameters 0 (toggle, default), 1 (true), and 2 (false), except in main menu (* stands for LEFT, RIGHT, and SRC): CM_VERTICALPANELS,CM_*THUMBS,CM_*BYNAME,CM_*BYEXT,CM_*BYSIZE,CM_*BYDATETIME,CM_*NEGORDER (32/64)
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
byblo
Senior Member
Senior Member
Posts: 270
Joined: 2005-02-20, 21:13 UTC
Contact:

Post by *byblo »

ghisler(Author) wrote:Have you tried to chain 2 commands, e.g.
cm_SrcUnsorted,cm_SrcSortByCol1
or 3:
cm_SrcUnsorted,cm_SrcSortByCol1,cm_SrcSortByCol1
Yes doing something similar as workaround: cm_SrcSortByCol2,cm_SrcSortByCol1
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 should only sort by custom column as the last command - it's considerably slower than sorting by internal values like name or size. So better use
cm_SrcUnsorted,cm_SrcSortByCol1
Author of Total Commander
https://www.ghisler.com
Post Reply