MoveTab

Title MoveTab
File Name MoveTab.txt
Description Moves the current tab to the opposite panel
Author Vochomurka
Parameters -
Plugins Called win, childwin, tc
Icon
Version 4.0
Updated on 16.06.2014
local hwnd = win.handle("c=TTOTAL_CMD")
local TMTC, Target, Lock, SemiLock

if(tc.active(hwnd) == "left") do
;Sub_TMTC - name of script TMTC 
	TMTC = runfile.Subs\Sub_TMTC(hwnd, 1)
	Target = runfile.Subs\Sub_TMTC(hwnd, 2)
else
	Target = runfile.Subs\Sub_TMTC(hwnd, 1)
	TMTC = runfile.Subs\Sub_TMTC(hwnd, 2)
endif

if(not TMTC)
	quit

local Counter = win.sendmessage(Target, 4868, 0, 0)
win.postmessage(hwnd, 0x400+51, 3009, 0)
*keys {down 5}{enter}
wait.for(200, win.sendmessage(Target, 4868, 0, 0) != Counter)
win.postmessage(hwnd, 0x400+51, 3009, 0)
*keys {down 2}{enter}
wait.for(activewindow("c=TCheckEditBox"))
local Hand = win.getfocus()
local Parent = childwin.parent(Hand)
Hand = win.childhandlelist(Parent, "c=TMyCheckBox")

if(word(Hand, 0) != 2) do
	messagebox("ok error", "Wrong number of checkboxes", "MoveTab script")
	quit
endif 

local v = vec.createfromwords(Hand)

if(not v) do
	messagebox("ok error", "Vector not created", "VEC plugin error")
	quit
endif 

if(win.top(v[0]) > win.top(v[1]))
	v.swap(0, 1)

Lock = v[0]
SemiLock = v[1]

Hand = win.sendmessage(Lock, 240, 0, 0)
Parent = win.sendmessage(SemiLock, 240, 0, 0)

keys {esc}
if(Hand)
	win.sendmessage(hwnd, 0x400+51, 3010, 0)

if(Parent)
	win.sendmessage(hwnd, 0x400+51, 3012, 0)

win.sendmessage(hwnd, 0x400+51, 3007, 0)

Comments:

Attention! This script does not work in Total Commander 7.5 pb1 and pb2!

This script for Total Commander 7.0 and older.

Tab menu (cm_DirTabsShowMenu) contains the "Copy tab to other panel" command that looks a bit inappropriate. First, it's the only tab menu command that can be always executed with mouse (double left click to close tab depends on the settings). Second, it is not accompanied by the corresponding "Move tab to other panel" command that would be obvious. (perhaps more obvious than the copy command - why have equal tabs in both panels?).

It's a good idea to assign the Alt+F6 hotkey to this script.


Main Page Total Commander PowerPro