topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday March 18, 2024, 9:29 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: MoveIt 1.5.1.0  (Read 64657 times)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.12.0
« Reply #25 on: May 26, 2012, 12:22 PM »
Although not as good as user defined grids, I'm looking into .ini file settings for percentage of largest window(where to draw the line) and perhaps another setting for the split point between the windows that share the other screen portion, in the case of a 3 grid.

I think it will be more useful if I can set a grid so that, as example, chrome can have the bottom or top of the screen will all the width and .xx of the screen height.  Maybe have a percentage range from 33 to 75 percent.  Some programs like EditPadLite7 won't allow the height below a certain size.  Typically you'll see the bottom of the window sticking down below where it should be. In that case it's probably going to be up to the user to adjust the percentages.

I'll experiment with it and see how it goes.  But a set fraction of .4 as I'm using now is too short or narrow for some apps.  Seems like a modification that shouldn't be too difficult.


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.15.0
« Reply #26 on: May 26, 2012, 03:53 PM »
SectionAte 1.0.15.0 Added Tray Menu commands to set BigDiv and SmallDiv percentages. These determine the percentage of work area where the dividing line is placed.  BigDiv is for the section that's not subdivided. SmallDiv is for the subdivided section.  SmallDiv is not used in the 2 section grids for obvious reasons. :)

There is only one BigDiv and SmallDiv setting for all the grids, but if you change it, it is updated immediately (meaning future moves use the new setting and the .ini file is written with the new settings.) Most likely you will settle on a grid you use for most things. Something more dynamic probably needs paid software or a utility that's been under development a lot longer.

I increased the vertical gap between windows from 3 pixels to 4. This should reduce the pinch on the drop shadow that can make it look like the windows overlap when they don't.

Also updated the About Box with cleaner descriptions.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,958
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.15.0
« Reply #27 on: May 26, 2012, 04:00 PM »
Hey Miles, any chance you could add your website to your signature, or, you could add it to the website info (underneath signature on the "Forum Profile Information" page) and it will show in an icon under your avatar. I'm a lazy beggar and it would save me going back to the first post every time for the link. Of course I should bookmark it :-[

Bookmarked. I'll sort of pretend I didnt post this :P :D
Tom

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.15.0
« Reply #28 on: May 26, 2012, 04:37 PM »
Hey Miles, any chance you could add your website to your signature, or, you could add it to the website info (underneath signature on the "Forum Profile Information" page) and it will show in an icon under your avatar. I'm a lazy beggar and it would save me going back to the first post every time for the link. Of course I should bookmark it :-[

Bookmarked. I'll sort of pretend I didnt post this :P :D

That's ok. It's a good idea. I didn't think of it because so many sites don't allow you to put url in sig.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.17.0
« Reply #29 on: May 26, 2012, 05:10 PM »
SectionAte 1.0.17.0 Widened the range for Div settings to 15 - 85 percent.  Made window gap 5 pixels both vertically and horizontally. Just looks cleaner on my monitor. Fixed calculation error in one of the grids.

Here's one "trick" I got onto. I'm using B Grid. I want chromium to have a big section at right bottom of the desktop. But I don't want it to go across the entire width.  So I set BigDiv small, 32, and SmallDiv large, 85.  This leaves a gap on the left of the browser. I'll just stick Notepad in the other 2 sections to show what I mean.  Here's a screen shot.

GridHeaven.jpg

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,958
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.17.0
« Reply #30 on: May 26, 2012, 06:27 PM »
I finally got to test it again Miles - well, version "15" - you keep overtaking my last download :-)

It'll take me a while to get to the Divs - it's a bit late here, I'll need to be fresher I think ;-)
Alt+Arrow is absolutely super (I didnt realise all arows work :up:)

  • (1) Is there a reason you dont have "L" (for left) listed as a shortcut (after pressing the hotkey) ?
  • (2) I'm not quite sure where the "g" comes into use - it doesnt seem to be necessary at all (?)
  • (3) in the tray menu, it would be great if I could see what grid is selected (currently I just see a tick/check-mark)

Liking it a lot so far :Thmbsup:

EDIT/
Miles Davis Ahead 3+3+3+3:
 (see attachment in previous post)
Tom
« Last Edit: May 26, 2012, 06:35 PM by tomos, Reason: added link to \"100th\" post »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.17.0
« Reply #31 on: May 26, 2012, 07:46 PM »
g selects the position in the grid by the top left point(origin) of the window. Drag window roughly where you want it and hit 'g'.

Click on another grid, then you can see the one that had the check. Otherwise then I have to make some Gui where the tray icon is good enough. If you look at the grids all the 3 section grids are the same as the first only rotated.  So if 'B" is selected and you can't see it, look at 'A' and rotate it clockwise 90 degrees mentally.  Likewise if you have 'F' selected, it's the same as 'E' only rotated clockwise 90 degrees.

The question about 'l' I don't understand. If you have an editor and you type 'l' the letter is going to go into the editor. That's why the hotkeys.

If you mean why do I have it so you hit a hotkey, then it waits for a letter, then it's to reduce the number of hotkeys. The more you have the greater the chance it's already in use.


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.17.0
« Reply #32 on: May 26, 2012, 08:24 PM »
Perhaps the reason for the confusion is, g 1 2 3 are grid related. All the other placement keys, t b r s c are independent of any grid. They are just convenient sizes and placements.

Maybe if I had a flat screen I'd be more into grid. But for CRT there really aren't all that many configurations where I'd say it's just so super to have stuff in a grid. I'm trying it out as much as anything. :)


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.17.0
« Reply #33 on: May 26, 2012, 08:28 PM »
On the check mark thing, I find it bothers me a bit too. I tried disabling the current one but the image, although still visible, is too dim. So what I think I'll do is make a bunch of red icons and the active one will have a red background.  These icons are only about 14 KB each anyway. If they are all embedded in the exe it won't be any big ram buster. :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.18.0
« Reply #34 on: May 26, 2012, 10:32 PM »
SectionAte 1.0.18.0 By request, removed check mark from Tray Menu. Now the active grid is denoted by reverse colored icon.

All the tray menu icons are embedded in the .exe. I just included them in the zip in case anyone wishes to compile their own mod. When the program is run they are extracted from the exe into the folder that contains SectionAte.exe.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #35 on: May 27, 2012, 02:37 AM »
SectionAte 1.0.19.0 Now displays current grid in Tray Icon Tooltip.

Attronarch

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 147
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #36 on: May 27, 2012, 03:49 AM »
Would you be interested in adding the possibility to change the grid layout (from A to F) with hot-keys? For example Ctrl+Shift+L A = layout A, etc.

Yeah, I know. That's the reason the programs that provide it charge like $29.95. It takes way too much work to accommodate a variable number of sections each with a variable percentage of screen space. To be honest I don't use grid myself much. I thought I'd take a shot at doing an easy version of it since I saw some mentioned on some forums.

I did not want to sound rude or demanding, I was merely stating my observations. What you did here is great.

But I can add the side by side grid. That's pretty easy. It's just every one added I have to modify the other 5 or 6 or 7 that come before it. But I can see side by side is useful. I should post it before the weekend is out. Thanks for the interest. :)

Thank you for adding it, works like a charm.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,958
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #37 on: May 27, 2012, 09:35 AM »
The question about 'l' I don't understand.
All the other placement keys, t b r s c are independent of any grid. They are just convenient sizes and placements.

the query about "L" (I use caps to show it's not an "i") is in the context of what you call the placement keys - it seems a logical one to include there, a key for Left side/full height

Is there a reason you dont have "L" (for left) listed as a shortcut (after pressing the hotkey) ?


[looking forward to trying new updates...]
Tom

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #38 on: May 27, 2012, 01:18 PM »
At the start there was only one grid. The left section of the screen was section 1. So things evolved. I don't want to stick in too many keys. Then it becomes impossible to remember.

Also if you use TicClick, once you have the desired size, you can position it without dragging.  Just use '7' position or if it's full height, positions '4' or '1' will put it flush to the left edge.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #39 on: May 27, 2012, 01:36 PM »
@tomos, as usual, you make good suggestions.  I'll work on adding the 'L'. It is Logical after all. :)

edit: It's not so much adding an item as then I have to go back and mess with About Box. Not easy to give directions in a few words and avoid it looking like a mess. :)

I'm doing x20 changes. I'll try to add the 'L' on this upload. I'll post when ready.

edit: turns out 'r' was broken. Search and replaced it into something else. :) I have 'l' and 'r' working now as vertical half of screen.  The next upload will have the 'l' key. I just have to redo the About Box. :)
« Last Edit: May 27, 2012, 02:09 PM by MilesAhead »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #40 on: May 27, 2012, 01:43 PM »
I think, for me, I'm starting to see this grid as a good way to size 2 apps and use the "unused" section as a spacer.

For instance with Grid A  GridA.jpg

I have the left section empty. But it keeps the programs on the right from consuming the entire width. Leaves a bit of space to click the desktop if I didn't have the gap for RocketDock. In this screen shot I changed the range for Div from 5 to 95 percent. When used as spacer I'm not going to try to jam something into the vertical gap on the left edge. :)

desk.jpg

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.20.0
« Reply #41 on: May 27, 2012, 02:27 PM »
SectionAte 1.0.20.0 By request, added 'l' key to move window to left side and size it 1/2 screen work area. Fixed 'r' key to do the same thing on the right side.  Expanded Div ranges to 5 - 95 percent. This is handy for using the "empty" section as a spacer to help size the other 2 apps as desired.

Now the Tray Icon changes to reflect the active grid. Updated About Box.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.20.0
« Reply #42 on: May 27, 2012, 03:20 PM »
@tomos do you think it would be useful to change 't' and 'b' so that they work like 'l' and 'r' and cover 1/2 the work area? Or is it better as is?

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,958
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.20.0
« Reply #43 on: May 27, 2012, 04:53 PM »
I'm on version 19 now - the icons are great :up:

@tomos do you think it would be useful to change 't' and 'b' so that they work like 'l' and 'r' and cover 1/2 the work area? Or is it better as is?

There's so much choice now :D I think it's hard to say what's best, I mean it's going to be down to individual preferences/monitor-size/workflow. I havent even gotten a workflow with it yet, but I'm happy the way it is.
Tom

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,958
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.20.0
« Reply #44 on: May 27, 2012, 05:03 PM »
Would you be interested in adding the possibility to change the grid layout (from A to F) with hot-keys? For example Ctrl+Shift+L A = layout A, etc.

This would be a logical extension of things. I'm not a big user of the grid (yet). I used to use JGPaiva's Gridmove - when I last changed machine I kind of got out of the habit of using it. Anyways, GridMove has that capability, and from what Miles said about this one, it's much easier to add grids to gridmove.
So, I'd say if it's easy to add, I'd love that capability [+1] - otherwise (just tested) I can run gridmove concurrently.
Tom

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.20.0
« Reply #45 on: May 27, 2012, 05:07 PM »
I noticed I left a thing for 's' square when I moved it from the other app.. holding down Shift made the window a bit bigger. I like top and bottom size as is. But maybe I'll add the shift so if someone wants 1/2 screen without using the up/down grid they can just hold down shift. It will be like an Easter Egg or something. :)

I'll play around with stuff and see what the next rev. should be. Thanks for your thoughts. :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.19.0
« Reply #46 on: May 27, 2012, 05:17 PM »
I did not want to sound rude or demanding, I was merely stating my observations. What you did here is great.


Not at all. I didn't mean to seem peeved. I just meant doing it this hotkey way is kind of a kludge. But you can get maybe 90% of what the sophisticated apps do with a few days of work. It's trying to monitor stuff and have everything automated that turns it from 6 days work to 6 months. :)

On the grid change hotkey, I suppos I could have an option for the user-defined hotkey.  Either user defined keyboard hotkey is for sizing, or for grid switching with A - F. That wouldn't be difficult. I prefer mouse based hotkey for resize anyway.  Those who wnat the keyboard hotkey, it would stay as is by default.  I could add another menu choice with check mark for "Keyboard Hotkey Switches Grid" or something like that.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0 and SectionAte 1.0.20.0
« Reply #47 on: May 27, 2012, 09:39 PM »
I thought I had this stable but it turns out of you complicate the desktop setup, such as having a work area with numbers quite different from the screen res on several sides, the calculations get really hairy.  I'm dumping 'g' as it just confuses the issue.

I'll never stop messing with this unless I just switch to Grid A is it, and set your settings to move the dividers around.  All these rotations are insane!

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0
« Reply #48 on: May 27, 2012, 11:13 PM »
SectionAte gets the Section 8!!  After experimenting with various work areas I find that for me it's more hassle than it's worth.  I'm using a cut down version with no grids just to size stuff to convenient shapes.

Anyway, if anyone who already has the source wants to mod it, feel free. I'm taking it down from my site so I don't get support emails. Too much of a headache.  Sorry. :)

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Shape Shift 1.0.9.0
« Reply #49 on: May 28, 2012, 12:51 AM »
I cheated! :)  I surgically removed the grids from SectionAte.  Then I changed t and b keys to set up my browser on bottom and something like Notepad on top so they fit nicely together.

It still has the Alt Arrow keys. That's all I need with TicClick. Not really a grid type of guy. I tried GridMove just to check it out. Obviously a lot of work went into it. I'm just not enamored of grids. More curious than anything. :)

Anyway here's a screen shot of my "MoveIt" hack at work.

desk.jpg

Here's the source

/*
 * * * Compile_AHK SETTINGS BEGIN * * *

[AHK2EXE]
Exe_File=%In_Dir%\MoveIt.exe
No_UPX=1
[VERSION]
Set_Version_Info=1
File_Version=1.0.0.0
Inc_File_Version=0
Legal_Copyright=2012 www.favessoft.com
Product_Version=1.0.0.0
[ICONS]
Icon_1=%In_Dir%\mycomputer.ico

* * * Compile_AHK SETTINGS END * * *
*/

; To compile yourself use AutoHotKey_L as AHK basic does not have
; Object() support. I used AHK_L 1.1.07.03 32 bit Unicode English
; You may get AHK_L here: http://l.autohotkey.net/
;
#SingleInstance force
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
progname := _FileBaseName(A_ScriptFullPath)
Menu Tray,NoStandard
Menu Tray,Add,Donate,DoDonate
Menu Tray,Add,Visit Hotkey Page,DoVisit
Menu Tray,Add,Set Keyboard Hotkey,DoKeyboard
Menu Tray,Add,Set Keyboard Hotkey as Text,DoKeyboardAsText
Menu Tray,Add
Menu Tray,Add,About,DoAbout
Menu Tray,Add,Delete Dead Window Info,PurgeUndo
Menu Tray,Add
Menu Tray,Add,Quit,DoQuit
Menu Tray,Default,About
Menu Tray,Click,1
Menu Tray,Tip,%progname%
if (A_IsCompiled)
  Menu Tray,Icon,%A_ScriptFullPath%,1

; window style for sizeable border
WS_SIZEBOX := 0x40000

; for Undo
wArray := Object()

; for _MarginWorkArea()
marg := 4
param := ""
len := 0
if 0 > 0
{
  param = %1%
  len := StrLen(param)
  if (len > StrLen("margin="))
    StringMid,marg,param,StrLen("margin=") + 1
}
l := -1
t := -1
r := -1
b := -1
w := 0
h := 0
key := "0"
AWindow := 0
AboutOpen := false
KHotkey := "^+s"
KbdSet := false
IniFile = %A_ScriptDir%\%A_ScriptName%
IniFile := RegExReplace(IniFile,"i)ahk$","ini")
IniFile := RegExReplace(IniFile,"i)exe$","ini")
IniRead,KHotkey,%IniFile%,Settings,KeyboardHotkey,%KHotkey%

if (KHotkey)
  Hotkey,%KHotkey%,DoHotKey,UseErrorLevel
If ErrorLevel
{
  MsgBox, 4112, %progname%, %KHotkey% is not a valid Hotkey
  ExitApp
}
 KbdSet := (KHotkey != "")
 _EmptyWorkingSet()

; Winkey click window then press a key
; or use hotkey from ini file
DoHotKey:
~#LButton::
  Input,key,L1
  if (key != "u")   
    goto,bypass
  else
    gosub,DoUndo
return

; Hold down middle mouse button and hit a key

; Undo
~MButton & u::
  gosub, DoUndo
return

~MButton & t::
~MButton & b::
~MButton & c::
~MButton & l::
~MButton & r::
~MButton & s::
  StringRight,key,A_ThisHotKey,1
bypass:
  AWindow := WinExist("A")
  WinGet,attr,Style,A
  if (! (attr & WS_SIZEBOX) )
    or (AWindow = WinExist("Program Manager"))
    or (AWindow = WinExist("Start menu"))
    return
  gosub,DoMove
  SetTimer,DumpMemory,-1000
return

DoMove:
  gosub,SaveUndoInfo
  chunk := (r - l) // 20
  TH := (b - t) * .33
  BH := (b - t) * .67
  if (key = "t")
  {
   
    WinMove,ahk_id %AWindow%,,l + chunk,t,(r - l) - chunk,TH
    ;WinMove,ahk_id %AWindow%,,l + Round((r - l) * .05),t,Round((r - l) * .8),(b - t) // 2 - 3
  }
  else if (key = "b")
  {
    chunk := (r - l) // 20
    WinMove,ahk_id %AWindow%,,l + chunk,TH + 10,(r - l) - chunk,BH - 10
    ;WinMove,ahk_id %AWindow%,,l + Round((r - l) * .05),(b - t) // 2 + 3,Round((r - l) * .8),(b - t) // 2 - 3
  }
  else if (key = "c")
    gosub, SectionCenter
  else if (key = "s")
    gosub, SectionSquare
  else if (key = "l")
    WinMove,ahk_id %AWindow%,,l,t,(r - l) // 2,b - t
  else if (key = "r")
    WinMove,ahk_id %AWindow%,,r - ((r - l) // 2) ,t,(r - l) // 2,b - t
return

SectionCenter:
  gosub,SaveUndoInfo
  w := (r - l) // 6 * 5
  h := (b - t) // 5 * 4
  l := l + (r - w) // 2
  t := t + (b - h) // 2
  WinMove,ahk_id %AWindow%,,l,t,w,h
return

SectionSquare:
  gosub,SaveUndoInfo
  w := (r - l) // 2
  if GetKeyState("Shift")
    w := w + (w // 5)
  h := w
  t := ((b - t) - h) // 2
  WinMove,ahk_id %AWindow%,,l,t,w,h
return

DoUndo:
  AWindow := WinExist("A")
  wPos := wArray[AWindow]
  if (wPos)
  {
    WinActivate,ahk_id %AWindow%
    WinMove,A,,wPos[1],wPos[2],wPos[3],wPos[4]
  }
return

SaveUndoInfo:
  WinGetPos,x,y,w,h, ahk_id %AWindow%
  _MarginWorkArea(l, t, r, b, marg)
  wPos := [x,y,w,h]
  wArray[AWindow] := wPos
return

!Left::
  AWindow := WinExist("A")
  If (AWindow = WinExist("Program Manager"))
    or (AWindow = WinExist("Start menu"))
    return
  gosub,SaveUndoInfo
  xinc := (r - l) // 10
  WinGetPos,X,Y,Width,Height,ahk_id %AWindow%
  if ((X - xinc) > l)
    WinMove,ahk_id %AWindow%,,X - xinc,Y
  else
    WinMove,ahk_id %AWindow%,,l,Y
  SetTimer,DumpMemory,-1000
return

!Right::
  AWindow := WinExist("A")
  If (AWindow = WinExist("Program Manager"))
    or (AWindow = WinExist("Start menu"))
    return
  gosub,SaveUndoInfo
  xinc := (r - l) // 10
  WinGetPos,X,Y,Width,Height,ahk_id %AWindow%
  if ((X + xinc + Width) <= r)
    WinMove,ahk_id %AWindow%,,X + xinc,Y
  else
    WinMove,ahk_id %AWindow%,,r - Width,Y
  SetTimer,DumpMemory,-1000
return

!Up::
  AWindow := WinExist("A")
  If (AWindow = WinExist("Program Manager"))
    or (AWindow = WinExist("Start menu"))
    return
  gosub,SaveUndoInfo
  yinc := (b - t) // 10
  WinGetPos,X,Y,Width,Height,ahk_id %AWindow%
  if ((Y - yinc) > t)
    WinMove,ahk_id %AWindow%,,X,Y - yinc
  else
    WinMove,ahk_id %AWindow%,,X,t
  SetTimer,DumpMemory,-1000
return

!Down::
  AWindow := WinExist("A")
  If (AWindow = WinExist("Program Manager"))
    or (AWindow = WinExist("Start menu"))
    return
  gosub,SaveUndoInfo
  yinc := (b - t) // 10
  WinGetPos,X,Y,Width,Height,ahk_id %AWindow%
  if ((Y + yinc + Height) <= b)
    WinMove,ahk_id %AWindow%,,X,Y + yinc
  else
    WinMove,ahk_id %AWindow%,,X,b - Height
  SetTimer,DumpMemory,-1000
return

PurgeUndo:
  For key, value in wArray
    IfWinNotExist,ahk_id %key%
      wArray.Remove(key)
  SetTimer,DumpMemory,-5000
return

DoAbout:
  if (AboutOpen)
    return
  AboutOpen := true
  HotkeyText := KHotkey ? KHotkey : "( none set )"
  filever := _ScriptVersion(A_ScriptFullPath)
  MyMsg =
  (
%progname%  %filever%  Copyright (c)  %A_Year% www.FavesSoft.com`n
To Size and Move the Active Window use one of ...`n
Mouse Hotkey 1 - Hold Middle Mouse Button on Sizeable
Window Frame and press a key`n`nMouse Hotkey 2 - Winkey Click then press a key`n
User Keyboard Hotkey  %HotkeyText%  then press a key`n
t = top  b = bottom  c = center  l = left  r = right
s = square  u = undo`n
Information for one Undo is saved for each Window moved`n
Press Alt Arrow to Move the Active Window in one dimension`n
Pass margin=n to adjust Desktop Margin
Valid range for n is 0 to 12  Default is 4
  )
  MsgBox, 4160, About %progname%, %MyMsg%
  SetTimer,DumpMemory,-1000
  AboutOpen := false
return

DoKeyboard:
  if (KdbSet)
    Hotkey,%KHotkey%,Off
  Gui, Add, Hotkey, x6 y7 w140 h20 vHotkey,%KHotkey%
  Gui, Add, Button, x156 y7 w110 h20 gGO , Set Hotkey
  Gui, Show, w273 h39, Set Hotkey
Return

GO:
  if (KbdSet)
    SaveKHotkey := KHotkey
  Gui, Submit
  if (! Hotkey)
  {
    if (KdbSet)
    {
      KHotkey := SaveHotkey
      Hotkey,%KHotkey%,On
    }
    return
  }
  KHotkey := Hotkey
  Gui,Destroy
  Hotkey,%KHotkey%,DoHotKey,UseErrorLevel
  If ErrorLevel
  {
    KHotkey := SaveHotkey
    Hotkey,%KHotkey%,DoHotKey,UseErrorLevel
    if ErrorLevel
    {
      MsgBox, 4112, , %KHotkey% is not a valid - Reset to %SavedHotkey%
      KHotkey := SavedHotkey
      Hotkey,%KHotkey%,On
      Gosub,DoIniWrite
    }
  }
  Else
  {
    Hotkey,%KHotkey%,On
    Gosub,DoIniWrite
  }
Return

GuiEscape:
GuiClose:
  Gui,Destroy
  SetTimer,DumpMemory,-2000
return

DoKeyboardAsText:
  SaveHotkey := KHotkey
  if (KbdSet)
    Hotkey,%KHotkey%,Off
  InputBox,KHotkey,%progname%
    ,`nEnter Keyboard Hotkey`n( ! = Alt ^ = Control + = Shift # = Winkey )`n`nExample: ^+s for Control Shift s
    ,,,,,,,,%KHotkey%
  if ErrorLevel
  {
    if (KbdSet)
    {
      KHotkey := SaveHotkey
      Hotkey,%KHotkey%,On
    }
  }
  else if (! KHotkey)
  {
    if (KdbSet)
      Hotkey,%SaveHotkey%,Off
  }
  else
  {
    if (KdbSet)
      Hotkey,%SaveHotkey%,Off
    Hotkey,%KHotkey%,DoHotKey, UseErrorLevel
    if ErrorLevel
    {
      if (KHotkey)
        MsgBox, 4112, , Hotkey change Failed
      KHotkey := ""
      KdbSet := false
      return
    }
    if (KbdSet)
      Hotkey,%KHotkey%,On
  }
  Gosub,DoIniWrite
return

DumpMemory:
  _EmptyWorkingSet()
return

DoDonate:
  Run,"http://www.favessoft.com/donate.html"
return

DoVisit:
  Run,"http://www.favessoft.com/hotkeys.html"
return

DoIniWrite:
  IniWrite,%KHotkey%,%IniFile%,Settings,KeyboardHotkey
 
return

DoQuit:
  Gosub,DoIniWrite
  ExitApp

;-----------  general purpose include functions  -----------
; include at bottom so DebugBox() Line count works
;
#Include MilesAhead.ahk