cm_100percent -- allow relative changes
Moderators: white, Hacker, petermad, Stefan2
cm_100percent -- allow relative changes
When working with different resolutions/dpi or viewModes/columns, It would be really nice to have a keyboard shortcut that quickly increases or decreases the width of the file panels. The auto-run commands in the view mode settings are not sufficient in many cases (no view mode in use, values not resolution/dpi-specific, etc.).
Therefore, i suggest to support relative values for the parameter of cm_100percent (or to implement a new command, like cm_percent).
Staying consistent with
"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)",
i could imagine
"cm_100percent +10+" would make the current panel 10% wider
"cm_100percent 10-" would make the current panel 10% smaller
"cm_100percent -10+" would make the left panel 10% wider
"cm_100percent -30" would set the left panel to 30% (as before)
etc.
Relative changes should stop at 0% and 100% (no wrap around).
The parameters might look strange with the +/- in the end, but (at least) no new command needs to be created.
This way, keyboard shortcuts can be added to quickly increase/decrease the panel widths in user-defined steps.
Therefore, i suggest to support relative values for the parameter of cm_100percent (or to implement a new command, like cm_percent).
Staying consistent with
"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)",
i could imagine
"cm_100percent +10+" would make the current panel 10% wider
"cm_100percent 10-" would make the current panel 10% smaller
"cm_100percent -10+" would make the left panel 10% wider
"cm_100percent -30" would set the left panel to 30% (as before)
etc.
Relative changes should stop at 0% and 100% (no wrap around).
The parameters might look strange with the +/- in the end, but (at least) no new command needs to be created.
This way, keyboard shortcuts can be added to quickly increase/decrease the panel widths in user-defined steps.
Re: cm_100percent -- allow relative changes
The current implementation isn't very consistent with other commands. And it doesn't seem possible to set the right panel to 100%.funkymonk wrote: ↑2022-06-21, 10:19 UTC Therefore, i suggest to support relative values for the parameter of cm_100percent (or to implement a new command, like cm_percent).
Staying consistent with
"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)",
...
How about a new command called cm_PanelSize (or cm_PanelWidth) with command modifiers Left/Right?
I would also like it when the percent sign (%) is allowed too.
cm_PanelSize 10% (set width of active panel to 10%)
cm_PanelSize +10% (make active panel 10% wider)
cm_PanelSize -10% (make active panel 10% smaller)
cm_LeftPanelSize 30% (set width of left panel to 10%)
etc.
Re: cm_100percent -- allow relative changes
2funkymonk
See sp_set* examples in TCFS2.Core.ini.
TCFS2 is convenient because you can make switch commands (with sets of columns and QuickView in particular).
See sp_set* examples in TCFS2.Core.ini.
TCFS2 is convenient because you can make switch commands (with sets of columns and QuickView in particular).
Last edited by Fla$her on 2022-06-21, 14:15 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: cm_100percent -- allow relative changes
2funkymonk
Support+
Support+
Just make the right panel active before you run the command - or use cm_100percent -0white wrote:And it doesn't seem possible to set the right panel to 100%
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.50 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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: cm_100percent -- allow relative changes
@ghisler Would you consider this suggestion? If so, there might be useful ideas. Otherwise, we can drop this thread.
Re: cm_100percent -- allow relative changes
Testet again - you are right
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.50 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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: cm_100percent -- allow relative changes
2funkymonk
Support++
Support++
License #1945
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
- ghisler(Author)
- Site Admin
- Posts: 48083
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: cm_100percent -- allow relative changes
cm_100percent 0 does not work, the active window isn't meant to be 0 pixels wide (although it's still possible to focus it with e.g. cm_focusleft).
Just focus the other panel first, then use cm_100percent.
Just focus the other panel first, then use cm_100percent.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: cm_100percent -- allow relative changes
YTou can use this em_command to set the opposite panel to 100%:
It can even be used once the panel is maximized to toggle between maximized left or right side (which cm_100Percent cannot).
Code: Select all
[em_100PercentTarget]
cmd=cm_50Percent,cm_FocusTrg,cm_100Percent
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.50 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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: cm_100percent -- allow relative changes
Back to the topic : How about relative changes to the panel width?
Re: cm_100percent -- allow relative changes
TCFS2 /ef if(msg(1074,1000)==1,varset(1,-10),varset(1,10)) msg(1075,65562,sepPos+varget(1)) |
TCFS2 /ef if(msg(1074,1000)==1,varset(1,10),varset(1,-10)) msg(1075,65562,sepPos+varget(1)) |
TCFS2 /ef msg(1075,65562,sepPos-10) |
TCFS2 /ef msg(1075,65562,30) |
Logically, in the first two cases, such a record should be enough:
TCFS2 /ef msg(1075,65562,sepPos+/-(msg(1074,1000)*10?10:-10)) |
, but TCFS2 for some reason does not cope..
Overquoting is evil! 👎
Re: cm_100percent -- allow relative changes
Support (+)
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.50 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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: cm_100percent -- allow relative changes
Fla$her,
I think you should try to write more readable things, using more macro names, otherwise it is hard to understand what should happen if one executes your commands.
I think you should try to write more readable things, using more macro names, otherwise it is hard to understand what should happen if one executes your commands.
Code: Select all
TCFS2.exe /ei "set_separator(sepPos + ( 10) * (L_isActive ? 1 : -1))" ; Increase active panel
TCFS2.exe /ei "set_separator(sepPos + (-10) * (L_isActive ? 1 : -1))" ; Decrease active panel
TCFS2.exe /ei "set_separator(sepPos + ( 10))" ; Increase left panel
TCFS2.exe /ei "set_separator(30)" ; Set left panel width