Fun with Windows

  1. #1

    Fun with Windows



    Want to Hide/Cascade/Tile all open windows?

    It took me some searching to find this so I thought I would share. This is mostly Animal's code from his modified desktop.js I just tweaked it a little.

    <script type="text/javascript">
        var HideAllWin = function() {
            Ext.WindowMgr.each(function(w) {
                if (w.isVisible()) w.minimize();
            });
        }
    
    
        var CascAllWin = function() {
            var xTick = Math.max(1, 20);
            var yTick = Math.max(1, 20);
            var x = xTick;
            var y = yTick;
            Ext.WindowMgr.each(function(w) {
                if (w.isVisible() &amp;&amp; !w.maximized) {
                    w.setPosition(x, y);
                    x += xTick;
                    y += yTick;
                }
            });
        }
    
    
        var TileAllWin = function() {
            var availWidth = Ext.lib.Dom.getViewWidth();
            var x = 1;
            var y = 1;
            var nextY = y;
            Ext.WindowMgr.each(function(w) {
                if (w.isVisible() &amp;&amp; !w.maximized) {
                    w.setHeight(300);             //remove if you don't want to resize windows
                    w.setWidth(300);             //remove if you don't want to resize windows
                    var wi = w.el.getWidth();
    
    
                    //Wrap to next row if this Window will go off the end
                    if ((x > 1) &amp;&amp; (x + wi > availWidth)) {
                        x = 1;
                        y = nextY;
                    }
    
    
                    w.setPosition(x, y);
                    x += wi + 1;
                    nextY = Math.max(nextY, y + w.el.getHeight() + 1);
                }
            });
        }
        
    </script>
    Hope it helps someone!

  2. #2

    RE: Fun with Windows

    thanks for sharing!
  3. #3

    RE: Fun with Windows

    Very Good.

    Thanks!

Similar Threads

  1. [CLOSED] IIS7 Windows 7 x Windows 2008
    By majunior in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Nov 08, 2011, 6:56 PM
  2. Windows 7 issue
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Oct 14, 2010, 3:18 PM
  3. [CLOSED] Desktop BUG: Modal windows can be minimized and you can interact with the other windows
    By juanpablo.belli@huddle.com.ar in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 31, 2009, 2:49 PM
  4. Replies: 1
    Last Post: Mar 17, 2009, 1:17 AM
  5. Replies: 1
    Last Post: Mar 29, 2008, 7:04 PM

Posting Permissions