//Window Manipulation // // Incorporates Tiling, Resizing, Cascading, Splitting Windows. // ------------------------------------------------------------------------ // remarks: I use this with in User.aml though it may be used as an // external macro file by removing the "function U_wind." // The current window is resized to show the bottom title // bar, where the choices of how to proceed are given. // // Arrow keys tile vertical, horizontal // Shift arrow split the window [up, down, left, right] // C Cascade // R Resize // ------------------------------------------------------------------------- include bootpath 'define.aml' function tile (opts) if getwincount == 1 then shortbox "Two windows must be open for tiling." else passprev opts // call the preempted tile function end end variable keycode, badkey, hwnd hwnd = (getcurrwin) // save current window handle setframe '+4' // add south menu bar menubar '' 4 // south menu bar definition item "{}=Tile" item "{Shift }=Split" item "{C}=Cascade" item "{R}=Resize" item "{Esc}=Cancel" end keycode = 0 repeat keycode = getkey badkey = FALSE case keycode when , tile 'h' when , tile 'v' when , splitwin 'h' when , splitwin 'v' when , if (getwincount) >= 2 then cascade endif when , sizekey when // cancel operation break otherwise beep 220 60 badkey = TRUE end until not badkey setframe '-4' hwnd // remove the south menu bar in the saved window