Hi spg, Cü, others,

That looks great and I'm adding it to my personal configuration, but 
not for this particular application.

Actually I figured out how to "untile" my windows using win.getrect 
before tiling and win.setrect to untile. It doesn't need to be fancy 
enough to reset the state and I'm not acting on minimized windows 
since tile doesn't like them.

But I would like to limit my Exec tile so it acts on the same 
specific handles as my untile operation. I'm having alot of trouble 
with this. Shouldn't a numeric handle work in a caption list here? 
The help topic says Exec tile will take a caption list, but the doc 
file text sounds more limited. When I use the same caption specs in 
my tile command as used to get the handles, the tile works. But if I 
use the global variables holding the handles, it fails. The only 
thing that worries me about using the textual caption specs is, for 
the handles I get only the first window matching the caption specs 
and if there are multiple instances of the app running, I only want 
the first one tiled. But maybe it is back to the owner/visibleowner 
issue since at least one of the tiled apps is a Delphi app.

Regards,
Sheri

--- In [email protected], sgp <[EMAIL PROTECTED]> wrote:
>
> Sheri wrote:
> 
> > New question: what would be the best approach to reversing an 
*Exec 
> > Tile? E.g. if one button Tiles specific windows can another 
restore 
> > them to their previous positions?
> 
> If there is a 'reverse tile' builtin function in powerpro, I've 
never found one.
> However, a while ago Bruce posted a "tiling task switcher" script 
which tiles and restores windows.
> 
> ;Subject: Re: Task switching
> ;Date: Tue, 20 Dec 2005 14:06:56 -0000
> ;From: "brucexs" <[EMAIL PROTECTED]>
> ;Newsgroups: gmane.comp.windows.power-pro
> ;Reply-To: [email protected]
> ;
> ;> 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
> 
> @toggle
> global g_tiled
> if (g_tiled) do
> [EMAIL PROTECTED]
> else
> [EMAIL PROTECTED]
> endif
> quit
> @main
> ;--------------------------
> 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
>






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/
 


Reply via email to