Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
/ GridMove Public archive

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
feat: restore maxium window before move
  • Loading branch information
mirtlecn committed Mar 1, 2024
1 parent 2d57006 commit e5b2d9d
Show file tree
Hide file tree
Showing 36 changed files with 514 additions and 8,691 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.exe
Demo*
Installer
build
241 changes: 118 additions & 123 deletions Aero_Lib.ahk

Large diffs are not rendered by default.

160 changes: 80 additions & 80 deletions Calc.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;*********************************************************************Calculator

Eval(X)
{
{
Global Monitor1Left
Global Monitor1Right
Global Monitor1Top
Expand Down Expand Up @@ -39,95 +39,95 @@ Eval(X)
Global MonitorReal3Bottom
Global MonitorReal3Width
Global MonitorReal3Height
; Global WindowLeft
; Global WindowRight
; Global WindowBottom
; Global WindowTop
; Global WindowWidth
; Global WindowHeight
StringReplace,x, x, %A_Space%,, All ; remove white space
StringReplace,x, x, %A_Tab%,, All
StringReplace,x, x, -, #, All ; # = subtraction
StringReplace,x, x, (#, (0#, All ; (-x -> (0-x
If (Asc(x) = Asc("#"))
x = 0%x% ; leading -x -> 0-x
StringReplace x, x, (+, (, All ; (+x -> (x
If (Asc(x) = Asc("+"))
StringTrimLeft x, x, 1 ; leading +x -> x
Loop
{ ; replace constants
StringGetPos,i, x, [ ; find [
IfLess i,0, Break
StringGetPos,j, x, ], L, i+1 ; closest ]
StringMid,y, x, i+2, j-i-1 ; variable in []
StringLeft,L, x, i
; Global WindowLeft
; Global WindowRight
; Global WindowBottom
; Global WindowTop
; Global WindowWidth
; Global WindowHeight
StringReplace,x, x, %A_Space%,, All ; remove white space
StringReplace,x, x, %A_Tab%,, All
StringReplace,x, x, -, #, All ; # = subtraction
StringReplace,x, x, (#, (0#, All ; (-x -> (0-x
If (Asc(x) = Asc("#"))
x = 0%x% ; leading -x -> 0-x
StringReplace x, x, (+, (, All ; (+x -> (x
If (Asc(x) = Asc("+"))
StringTrimLeft x, x, 1 ; leading +x -> x
Loop
{ ; replace constants
StringGetPos,i, x, [ ; find [
IfLess i,0, Break
StringGetPos,j, x, ], L, i+1 ; closest ]
StringMid,y, x, i+2, j-i-1 ; variable in []
StringLeft,L, x, i
StringTrimLeft,R, x, j+1
if (%Y% = "")
{
{
;msgbox,error: %y%
return "Error"
}
x := L . %y% . R ; replace [var] with value of var
}
x := L . %y% . R ; replace [var] with value of var
}
Loop
{ ;finding an innermost (..)
StringGetPos,i, x, (, R ;Rightmost '('
IfLess i,0, Break ;If there are no more '(', break
StringGetPos,j, x, ), L, i+1 ;Find the corresponding ')'
StringMid,y, x, i+2, j-i-1 ;Expression in '()'
StringLeft,L, x, i ;Left Part of the expresion
StringTrimLeft,R, x, j+1 ;Right Part of the expression
x := L . Eval@(y) . R ;replace (x) with value of x
{ ;finding an innermost (..)
StringGetPos,i, x, (, R ;Rightmost '('
IfLess i,0, Break ;If there are no more '(', break
StringGetPos,j, x, ), L, i+1 ;Find the corresponding ')'
StringMid,y, x, i+2, j-i-1 ;Expression in '()'
StringLeft,L, x, i ;Left Part of the expresion
StringTrimLeft,R, x, j+1 ;Right Part of the expression
x := L . Eval@(y) . R ;replace (x) with value of x
}
Return Eval@(X)
}

Eval@(x)
{
StringGetPos,i, x, +, R ; i = -1 if no + is found
StringGetPos,j, x, #, R
If (i > j)
Return Left(x,i)+Right(x,i)
If (j > i) ; i = j only if no + or - found
Return Left(x,j)-Right(x,j)
StringGetPos,i, x, *, R
StringGetPos,j, x, /, R
Return Eval@(X)
}

Eval@(x)
{
StringGetPos,i, x, +, R ; i = -1 if no + is found
StringGetPos,j, x, #, R
If (i > j)
Return Left(x,i)*Right(x,i)
Return Left(x,i)+Right(x,i)
If (j > i) ; i = j only if no + or - found
Return Left(x,j)-Right(x,j)
StringGetPos,i, x, *, R
StringGetPos,j, x, /, R
If (i > j)
Return Left(x,i)*Right(x,i)
If (j > i)
Return Left(x,j)/Right(x,j)
StringGetPos,i1, x, abs, R ; no more operators
StringGetPos,i2, x, ceil, R ; look for functions
StringGetPos,i3, x, floor, R ; insert further functions below
m := Max1(i1,i2,i3)
If (m = i1) ; apply the rightmost function
Return abs(Right(x,i1+2)) ; only one function is applied
Else If (m = i2) ; in one recursion
Return ceil(Right(x,i2+3))
Else If (m = i3)
Return floor(Right(x,i3+4)) ; offset j + StrLen(func) - 2
Return x
Return Left(x,j)/Right(x,j)
StringGetPos,i1, x, abs, R ; no more operators
StringGetPos,i2, x, ceil, R ; look for functions
StringGetPos,i3, x, floor, R ; insert further functions below
m := Max1(i1,i2,i3)
If (m = i1) ; apply the rightmost function
Return abs(Right(x,i1+2)) ; only one function is applied
Else If (m = i2) ; in one recursion
Return ceil(Right(x,i2+3))
Else If (m = i3)
Return floor(Right(x,i3+4)) ; offset j + StrLen(func) - 2
Return x
}

Left(x,i)
{
StringLeft,x, x, i
Return Eval@(x)
}
Right(x,i)
{
StringTrimLeft,x, x, i+1
Return Eval@(x)
Left(x,i)
{
StringLeft,x, x, i
Return Eval@(x)
}
Right(x,i)
{
StringTrimLeft,x, x, i+1
Return Eval@(x)
}
Max1(x0,x1="",x2="",x3="",x4="",x5="",x6="",x7="",x8="",x9="",x10="",x11="",x12="",x13="",x14="",x15="",x16="",x17="",x18="",x19="",x20="")
{
x := x0
Loop 20
{
IfEqual x%A_Index%,, Break
IfGreater x%A_Index%, %x%
x := x%A_Index%
}
IfLess x,0, Return -2 ; prevent match with -1
Return %x%
Max1(x0,x1="",x2="",x3="",x4="",x5="",x6="",x7="",x8="",x9="",x10="",x11="",x12="",x13="",x14="",x15="",x16="",x17="",x18="",x19="",x20="")
{
x := x0
Loop 20
{
IfEqual x%A_Index%,, Break
IfGreater x%A_Index%, %x%
x := x%A_Index%
}
IfLess x,0, Return -2 ; prevent match with -1
Return %x%
}
4 changes: 2 additions & 2 deletions Compile.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
& "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in GridMove.ahk /out Installer/GridMove.exe /icon GridMove.ico
& "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in GridMove.ahk /out build/GridMove.exe /icon GridMove.ico

Get-ChildItem .\Installer\ -Exclude "GridMove-Setup*","GridMove-Portable*" | Compress-Archive -DestinationPath .\Installer\GridMove-Portable.zip -CompressionLevel Fastest -Force
Get-ChildItem .\build\ -Exclude "GridMove-Setup*","GridMove-Portable*" | Compress-Archive -DestinationPath .\build\GridMove-Portable.zip -CompressionLevel Fastest -Force

& "C:\Program Files (x86)\Inno Setup 6\iscc.exe" Inno.iss

Loading

0 comments on commit e5b2d9d

Please sign in to comment.