How to change the cm_50Percent view to 20/80 view.

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

tc.dll is not required for this script, but it is required for the others. I am glad to help you. Be lucky in working with PowerPro.
Single user license #329241
PowerPro scripts for Total Commander
Andre Linoge
Junior Member
Junior Member
Posts: 83
Joined: 2004-03-14, 22:22 UTC

Post by *Andre Linoge »

Vochomurka wrote:tc.dll is not required for this script, but it is required for the others. I am glad to help you. Be lucky in working with PowerPro.
I will. :D
I used its pre-decessor, Stilletto, for al very long time in the öld days"; pitty it was discontiniued at the time.
Before i had to purchise a new PC, i used PowerPro; cant remember why i didnt installed it on this PC, uptill now, that is.
Can remember it took quit some searching before Powerpro was "ready for use". :D
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Who knows ?

Post by *nsp »

Clo wrote: • But sometimes, the dreams come true… Who knows ? ;)

Please check mail…
Claude, do you suggest it is already part of the Beta Test running on 7.51 versions ?
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2nsp
No, it is not implemented in TC 7.51beta
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
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: How to change the cm_50Percent view to 20/80 view.

Post by *DrShark »

Spoiler
Vochomurka wrote: 2010-03-02, 07:13 UTC PowerPro script: [...]
nsp wrote: 2010-03-02, 13:13 UTC You should also declare hh as local and warn about the usage of flag n°1 used.

Code: Select all

local Where = 1
local i
local Hand = win.handle("c=TTOTAL_CMD")
local hh
flag set 1

for(i = 1; 1; i = i + 1)
	hh = childwin.handle(Hand, i)
	if(hh != "" && win.width(hh) == 3) do
		flag clear 1
		break
	endif
endfor

if(pproflag(1))
	quit

local HCenter = (win.left(hh) + win.right(hh))/2
local VCenter = (win.top(hh) + win.bottom(hh))/2
local expr = "ab " ++ HCenter ++ " " ++ VCenter
win.mouse(expr)
wait.for(10)
mouse rightdown
wait.for(10)
mouse rightup

for(i = 1; i <= Where; i = i + 1)
	*keys {down}
endfor

*keys {enter}
A quick PowerPro draft partially compatible with Vista (and probably newer Windows), with lines not compatible commented:

Code: Select all

local Where = 7
local i
local Hand = win.handle("c=TTOTAL_CMD")
local hh
flag set 1

for(i = 1; 1; i = i + 1)
	hh = childwin.handle(Hand, i)
	if(hh != "" && win.width(hh) == 3) do
		flag clear 1
		break
	endif
endfor

if(pproflag(1))
	quit

local HCenter = (win.left(hh) + win.right(hh))/2
local VCenter = (win.top(hh) + win.bottom(hh))/2
local expr = "ab " ++ HCenter ++ " " ++ VCenter

;win.mouse(expr)
win.sendmouse("ab",HCenter,VCenter)
wait.for(10)
;mouse rightdown
win.sendmouse ("ab",HCenter,VCenter,"rd")
wait.for(10)
;mouse rightup
win.sendmouse ("ab",HCenter,VCenter,"ru")

for(i = 1; i <= Where; i = i + 1)
	*keys {down}
endfor

*keys {enter}
Since I don't know PowerPro at all, and its documentation on mouse functions is not clear enough for me,
I didn't add here Windows version check to make old and new mouse methods work.
And even new method I made to work on Vista (tried only on 32-bit one), it seems, only partially (for...endfor routine after win.sendmouse, it seems, not executed), but at least script runs and allows to set panel separator relative position. So, after execution of a button which runs the script,
mouse cursor moves to a center of vertical separator,
then Total Commander's context menu appears with following items:
20/80
30/70
40/60
50/50
60/40
70/30
80/20
If to click some menu item there, panels separator moves according to declared proportion.
Last edited by DrShark on 2021-09-28, 09:32 UTC, edited 4 times in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to change the cm_50Percent view to 20/80 view.

Post by *petermad »

Since Total Commander 9.0 beta 16 the command cm_100Percent accepts parameters.
so using cm_100Percent -20 will set the divider to 20/80 view and cm_100Percent -80 will set 80/20 view.
history.txt wrote: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)
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
Post Reply