cm_100percent: moving the split between the two panels

English support forum

Moderators: Stefan2, white, sheep, Hacker

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

cm_100percent: moving the split between the two panels

Post by *JimmyTheBroker » 2018-01-20, 09:24 UTC

Hi guys,

I there are other threads talking about this in the past like 2003.

with some ideas of +10% and -10% (moving the split between the two panels),

All i can find are "cm_100percent" and "cm_0percent".

There is a thing called "AutoHotKey" that claims it can create hotkeys for the positions.. but im not interested in downloading a whole program just for one tiny thing.

does know a way i can do this, so i can put it as a button or a hotkey within total commander.

thanks,
Jimmy
I finally get notifications from emails again!!!
So happy!

User avatar
petermad
Power Member
Power Member
Posts: 8466
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-01-20, 09:58 UTC

history.txt:
26.09.16 Added: cm_100percent now accepts a parameter: If >0, it sets the panel width (in percent) of the active panel. If <0, it sets the panel width (in percent) of the left window. Example: cm_100percent 70 (32/64)
So this button will set the divider to 30 / 70 %:

Code: Select all

TOTALCMD#BAR#DATA
cm_100Percent -30

wcmicons.dll,37
Set Panel divider to 30 / 70 percent


-1
And this button will let you enter a number for the percent

Code: Select all

TOTALCMD#BAR#DATA
cm_100Percent ?

wcmicons.dll,37
Set Panel divider to entered percent


-1
License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b6 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

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

Post by *MVV » 2018-01-20, 13:31 UTC

One can also use TCFS2 (with TCFS2Tools module) for setting splitter position, also increment/decrement it for a givel value.

Increase current panel width by 10%:

Code: Select all

TCFS2.exe /ei sp_inc
Decrease current panel width by 10%:

Code: Select all

TCFS2.exe /ei sp_dec
Set current panel width to 60%:

Code: Select all

TCFS2.exe /ei set_separator(60)

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker » 2018-01-20, 19:06 UTC

petermad wrote:history.txt:
26.09.16 Added: cm_100percent now accepts a parameter: If >0, it sets the panel width (in percent) of the active panel. If <0, it sets the panel width (in percent) of the left window. Example: cm_100percent 70 (32/64)
So this button will set the divider to 30 / 70 %:

Code: Select all

TOTALCMD#BAR#DATA
cm_100Percent -30

wcmicons.dll,37
Set Panel divider to 30 / 70 percent


-1
And this button will let you enter a number for the percent

Code: Select all

TOTALCMD#BAR#DATA
cm_100Percent ?

wcmicons.dll,37
Set Panel divider to entered percent


-1
How do i make a button on the button bar with more than just one command line?
I finally get notifications from emails again!!!
So happy!

User avatar
tuska
Power Member
Power Member
Posts: 1545
Joined: 2007-05-21, 12:17 UTC

Post by *tuska » 2018-01-20, 19:10 UTC

JimmyTheBroker wrote:How do i make a button on the button bar with more than just one command line?
You can use the code to create a button as follows:
1. Mark the green code (simply press and hold the left-hand mouse button and drag over the code, then release the left mouse button)
2. Press the CTRL-key and hold it down, then press the letter "C" (CTRL + C = Copy to clipboard)
3. Make a right click on your buttonbar on an empty space [e.g. after the last button or between the buttons]
4. Click on menu item "Paste"
5. [Optional: Point to the new button (slightly longer): Tooltip is shown (-> description for the button)]

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker » 2018-01-20, 19:21 UTC

MVV wrote:One can also use TCFS2 (with TCFS2Tools module) for setting splitter position, also increment/decrement it for a givel value.

Increase current panel width by 10%:

Code: Select all

TCFS2.exe /ei sp_inc
Decrease current panel width by 10%:

Code: Select all

TCFS2.exe /ei sp_dec
Set current panel width to 60%:

Code: Select all

TCFS2.exe /ei set_separator(60)
I might do this as a last resort, but i dont want to download a whole plugin just for one little thing.
I finally get notifications from emails again!!!
So happy!

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker » 2018-01-20, 19:26 UTC

tuska wrote:
JimmyTheBroker wrote:How do i make a button on the button bar with more than just one command line?
You can use the code to create a button as follows:
1. Mark the green code (simply press and hold the left-hand mouse button and drag over the code, then release the left mouse button)
2. Press the CTRL-key and hold it down, then press the letter "C" (CTRL + C = Copy to clipboard)
3. Make a right click on your buttonbar on an empty space [e.g. after the last button or between the buttons]
4. Click on menu item "Paste"
5. [Optional: Point to the new button (slightly longer): Tooltip is shown (-> description for the button)]
The only way I know how to make a button is:
Config > Button Bar... > [Stick in the single line of code into "Command"]

If I am reading you correctly.. I should be able to copy and paste the code into the TC command line and it'll create the button for me? If this is the case, how do i open up the TC command line?
Thanks!
I finally get notifications from emails again!!!
So happy!

User avatar
elgonzo
Senior Member
Senior Member
Posts: 377
Joined: 2013-09-04, 14:07 UTC

Post by *elgonzo » 2018-01-20, 19:35 UTC

JimmyTheBroker wrote:If I am reading you correctly.. I should be able to copy and paste the code into the TC command line and it'll create the button for me? If this is the case, how do i open up the TC command line?
No, you are not reading correctly :twisted:
Read the instructions provided by tuska again, carefully... ;)
Windows 7 Pro x64 SP1

User avatar
petermad
Power Member
Power Member
Posts: 8466
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-01-20, 23:32 UTC

2JimmyTheBroker
Do excactly as tuska describes - read line no. 3 carefully!
License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b6 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker » 2018-01-20, 23:38 UTC

Whoops.

Ok I have used petermad code to make two buttons using Tuska's advice.. but both buttons make 100 / 0
the "Set Panel divider to entered percent" doesnt even ask the percent wanted.

i have checked, I do have a wcmicons.dll file in my TC directory.

havent tried downloading TCFS2
I finally get notifications from emails again!!!
So happy!

User avatar
petermad
Power Member
Power Member
Posts: 8466
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-01-21, 00:50 UTC

2JimmyTheBroker

OK since you cannot figure out how to copy and paste the code to the buttonBAR I will try with 2 screenshots of the button settings:

http://madsenworld.dk/tcmd/divider1.png
http://madsenworld.dk/tcmd/divider2.png

Notice the -30 in the command field for the first button, and the ? in the command field for the second button.
License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b6 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
tuska
Power Member
Power Member
Posts: 1545
Joined: 2007-05-21, 12:17 UTC

Copy and paste the code from web to the buttonbar

Post by *tuska » 2018-01-21, 14:56 UTC

I have also adapted the detailed instructions slightly - to copy and paste the code to the buttonbar:

1. Mark the code in green COMPLETELY (including empty lines), which is in the frame - just point to the upper left corner
1. of the frame and simply press and hold the left-hand mouse button and drag over the code, then release the left mouse button)
2. CTRL + C = Copy to clipboard (press the CTRL-key and hold it down, then press the letter "C")
3. Make a right click on your buttonbar on an empty space [e.g. after the last button or between the buttons]
4. Click on menu item "Paste" (see also point 5.)
5. [If you do not see the icon immediately (or just the icon outlines and a possible tooltip, if you point the cursor on the place,
5. on which the button was inserted before), then again a right click into the buttonbar is necessary, then "Change", "OK" ->
5. at the latest then the icon will be visible]
6. [Option: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button)]

2JimmyTheBroker
7. [Option: Right-click on a button in your buttonbar, then choose "Copy", then paste (Ctrl+V) to an empty notepad file
7. to see how that comes about with the code for a button]
8. [Option: By cutting and copying, a single button in the buttonbar can also be moved to another place in the buttonbar]

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker » 2018-01-26, 15:39 UTC

... Guys,

See: Sat Jan 20, 2018 5:38 pm
I've been doing exactly as you said and have been copying it to the buttonbar.. I figured out the problem I had been using: "version 8.51a 64 bit"
I've updated to the newest version, and the ? and -30 buttons are working..

How would I show only the right panel? "cm_100Percent -1" is my best solution so far.

Is there a way to make one of these commands a hotkey? or one of the buttons on the buttonbar a hotkey?

Thanks,
Jimmy
I finally get notifications from emails again!!!
So happy!

User avatar
petermad
Power Member
Power Member
Posts: 8466
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-01-26, 22:34 UTC

In order to give a command with a parameter a hotkey you first have to make an em_command for ir:

Open (or make) the usercmd.ini in the TC's program folder (or data folder) in Notepad.

Add something like this to the file:
[em_my110percent]
cmd=cm_100Percent -1

Now you can use "Configuration" -> "Options..." -> "Misc." -> "Redifine hotkeys (Keyboard remapping)"
1. Mark for example Ctrl + Alt + A
2. Click on the button with the nagnifying glass
3. Click on usercmd.ini in the bottom left side of the "Choose command" dialog
4. Click on the em_my110percent command in the right side
5. Click OK.

Now the command cm_100Percent -1 wil be executed when you press Ctrl+Alt+A.

cm_100Percent -1 doesn't really make the Right window 100% wide - only 99%

But since the cm_100Percent command can only set the width of the Active panel or the Left panel (but not specificially the Right panel, you have to make a workaround, where you first set the focus to the right panel and combine it with the cm_100Percent command - like this:
[em_110percentRight]
cmd=cm_FocusRight,cm_100Percent
Last edited by petermad on 2018-01-27, 18:33 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 9.22a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b6 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
JimmyTheBroker
Member
Member
Posts: 177
Joined: 2017-06-07, 05:22 UTC

Post by *JimmyTheBroker » 2018-01-27, 12:03 UTC

petermad,

Config..>thumbnails>Database location "%$LOCAL_APPDATA%\GHISLER"(C:\Users\Jimmy\AppData\Roaming\GHISLER)

I feel like I should change this to:
C:\Program Files (x86)\totalcmd
(the directory where I have installed total commander)

Is this a bad idea? How much of a bad idea is this?



I have been having a huge about of trouble because I have been creating usercmd.ini files and putting them into the "C:\Program Files (x86)\totalcmd" directory and not the C:\Users\Jimmy\AppData\Roaming\GHISLER


I created a button on the buttonbar with command "cm_CommandBrowser" pressing it and
scrolling to the usercmd.ini section and creating a new command in there results in:
[em_usercmd1]
button=
cmd=cm_SrcShort

which results in an error. What is the correct way to open up the "Choose Command" dialog box, so that it would create the following instead?:
[em_usercmd1]
cmd=cm_SrcShort


my current usercmd.ini looks like:
[em_100percentRight]
cmd=cm_FocusRight,cm_100Percent
[em_70percentRight]
cmd=cm_FocusRight,cm_100Percent 70
[em_70percentLeft]
cmd=cm_FocusLeft,cm_100Percent 70
[em_100percentLeft]
cmd=cm_FocusLeft,cm_100Percent

with buttonbar buttons (left to right):
em_100percentRight
em_70percentRight
cm_50Percent
em_70percentLeft
em_100percenLeft
cm_100Percent ?
cm_CommandBrowser

This is an ok solution... but ideally want just two hotkeys that move the partition leftwards and rightwards (ideally without changing the panel currently selected too.)

thanks,
Jimmy. 8)

--------------------------

I understand that Config > Misc > Hotkey is to make hotkeys, I can make hotkeys with my above commands.
I'm a little OCD and don't want to make hotkeys that are going to overwrite existing default hotkeys. Whats the best way to find all the default hotkeys?
I've been looking around in the F1 help menu to try and find a list of them.

thanks for all the help so far Peter!
I finally get notifications from emails again!!!
So happy!

Post Reply