> I looked at the script some more, and in my testing, it does not
seem
> to work if you try to re-activate the currently active window.
Also,
> it does not handle minned windows well.
>
> I'll post another version which addresses these issues at some point.
>
Here is a revised version of the script which does a better job with
minned windows. Store it in file tiler.txt. I had some trouble with
hookwindowevents, so I now use it by configuring a single hot key (a
mouse-related hotkey is convenient for me). The command is
global g_tiled
if (g_tiled)
[EMAIL PROTECTED]
else
.tiler
Here the if statement is in the More Commands edit box.
Press the hot key to tile the windows. Move the mouse over the window
you want to activate and press the hotkey again to untile and activate
the selected window.
Here is the script
;--------------------------
local all=win.handlelist("*",0)
local nwin=word(all,0)
global g_tiled=0
static vwin
if (vec.exists(vwin))
vwin=vec.destroy(vwin)
/*
Store window info as six integers: handle, (restored) left, top,
width, height, state
state =0 for normal, =1 for max, =2 for min, =3 for minned of max
window
vwin=vec.create(6*nwin)
*/
local iv=0
for (local i=0; i<nwin; i=i+1)
local hwnd=word(all,i+1)
if (not win.toolwindow(hwnd) && win.class(hwnd)!="#32770") do
vwin[iv]=hwnd
vwin[iv+5]=0 ;; state
if (win.maxxed(hwnd)) do
win.restore(hwnd)
wait.for(20)
vwin[iv+5]=1
elseif (win.minned(hwnd))
win.restore(hwnd)
wait.for (20)
if (win.maxxed(hwnd)) do
win.restore(hwnd)
wait.for (20)
vwin[iv+5]=3
else
vwin[iv+5]=2
endif
endif
vwin[iv+1]=win.left(hwnd)
vwin[iv+2]=win.top(hwnd)
vwin[iv+3]=win.width(hwnd)
vwin[iv+4]=win.height(hwnd)
iv=iv+6
endif
endfor
if (iv>0) do
exec tile t
wait.for(1000)
g_tiled=1
endif
quit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@reset
global g_tiled=0
static vwin
if (not vec.exists(vwin))
quit
local active=win.handle("under")
local iv=0
for (local iv=0; iv<vec.length(vwin); iv=iv+6)
local hwnd=vwin[iv]
win.move(hwnd, vwin[iv+1], vwin[iv+2])
win.size(hwnd, vwin[iv+3], vwin[iv+4])
if (vwin[iv+5]==1 ||(vwin[iv+5]==3 && hwnd==active)) do
win.maximize(hwnd)
elseif (vwin[iv+5]==2 && hwnd!=active)
win.minimize(hwnd)
elseif (vwin[iv+5]==3 && hwnd!=active)
win.maximize(hwnd)
win.minimize(hwnd)
endif
endfor
vwin=vec.destroy(vwin)
win.show(active)
quit
------------------------ Yahoo! Groups Sponsor --------------------~-->
AIDS in India: A "lurking bomb." Click and help stop AIDS now.
http://us.click.yahoo.com/9QUssC/lzNLAA/TtwFAA/JV_rlB/TM
--------------------------------------------------------------------~->
Attention: PowerPro's Web site has moved: http://www.ppro.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/power-pro/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/