mirror of
https://github.com/jgpaiva/GridMove.git
synced 2025-03-30 23:48:25 +01:00
Made ShortCutNum
This commit is contained in:
parent
338230129d
commit
f431b8a8ed
2
Calc.ahk
2
Calc.ahk
@ -1,7 +1,7 @@
|
||||
;got from http://www.autohotkey.com/forum/viewtopic.php?p=107547#107547
|
||||
;*********************************************************************Calculator
|
||||
|
||||
Eval(X)
|
||||
CalcEval(X)
|
||||
{
|
||||
Global Monitor1Left
|
||||
Global Monitor1Right
|
||||
|
24
Command.ahk
24
Command.ahk
@ -68,18 +68,18 @@ Drop_Command:
|
||||
return
|
||||
}
|
||||
|
||||
If (NGroups < FirstNumber * 10)
|
||||
{
|
||||
If (FirstNumber = "0")
|
||||
{
|
||||
GoSub, Command_Hide
|
||||
WinMinimize,A
|
||||
return
|
||||
}
|
||||
GoSub, Command_Hide
|
||||
MoveToGrid(FirstNumber)
|
||||
return
|
||||
}
|
||||
; If (NGroups < FirstNumber * 10)
|
||||
; {
|
||||
; If (FirstNumber = "0")
|
||||
; {
|
||||
; GoSub, Command_Hide
|
||||
; WinMinimize,A
|
||||
; return
|
||||
; }
|
||||
; GoSub, Command_Hide
|
||||
; MoveToGrid(FirstNumber)
|
||||
; return
|
||||
; }
|
||||
|
||||
Command2:
|
||||
output := FirstNumber . " -"
|
||||
|
109
GridMove.ahk
109
GridMove.ahk
@ -831,19 +831,20 @@ creategroups:
|
||||
setGuiColors()
|
||||
loop,%NGroups%
|
||||
{
|
||||
TriggerTop := %A_Index%TriggerTop - ScreenTop
|
||||
TriggerBottom := %A_Index%TriggerBottom - ScreenTop
|
||||
TriggerLeft := %A_Index%TriggerLeft - ScreenLeft
|
||||
TriggerRight := %A_Index%TriggerRight - ScreenLeft
|
||||
PosIndex := %A_Index%PosNum
|
||||
TriggerTop := %PosIndex%TriggerTop - ScreenTop
|
||||
TriggerBottom := %PosIndex%TriggerBottom - ScreenTop
|
||||
TriggerLeft := %PosIndex%TriggerLeft - ScreenLeft
|
||||
TriggerRight := %PosIndex%TriggerRight - ScreenLeft
|
||||
TriggerHeight := TriggerBottom - TriggerTop
|
||||
TriggerWidth := TriggerRight - TriggerLeft
|
||||
GridTop := %A_Index%GridTop
|
||||
GridLeft := %A_Index%GridLeft
|
||||
GridTop := %PosIndex%GridTop
|
||||
GridLeft := %PosIndex%GridLeft
|
||||
|
||||
TextTop := %A_Index%TriggerTop - ScreenTop
|
||||
TextTop += Round((%A_Index%TriggerBottom - %A_Index%TriggerTop) / 2 )- 11
|
||||
TextLeft := %A_Index%TriggerLeft - ScreenLeft
|
||||
TextLeft += Round((%A_Index%TriggerRight - %A_Index%TriggerLeft) / 2) - 5
|
||||
TextTop := %PosIndex%TriggerTop - ScreenTop
|
||||
TextTop += Round((%PosIndex%TriggerBottom - %PosIndex%TriggerTop) / 2 )- 11
|
||||
TextLeft := %PosIndex%TriggerLeft - ScreenLeft
|
||||
TextLeft += Round((%PosIndex%TriggerRight - %PosIndex%TriggerLeft) / 2) - 5
|
||||
RestoreLeft := TextLeft - 50
|
||||
tempTop := triggerTop - 1
|
||||
tempBottom := triggerBottom - 1
|
||||
@ -862,15 +863,15 @@ creategroups:
|
||||
If ShowNumbersFlag
|
||||
If GridTop is number
|
||||
If GridLeft is number
|
||||
If A_Index < 10
|
||||
If PosIndex < 10
|
||||
{
|
||||
Gui, add, text, BackGroundTrans c%shadowcolor% X%ShadowLeft% Y%ShadowTop% ,%A_Index%
|
||||
Gui, add, text, BackGroundTrans c%textcolor% X%TextLeft% Y%TextTop% ,%A_Index%
|
||||
Gui, add, text, BackGroundTrans c%shadowcolor% X%ShadowLeft% Y%ShadowTop% ,%PosIndex%
|
||||
Gui, add, text, BackGroundTrans c%textcolor% X%TextLeft% Y%TextTop% ,%PosIndex%
|
||||
}
|
||||
else
|
||||
{
|
||||
Gui, add, text,% "X" ShadowLeft - 6 " Y" ShadowTop "c"shadowcolor "BackGroundTrans" ,%A_Index%
|
||||
Gui, add, text,% "X" TextLeft - 6 " Y" TextTop "c"textcolor "BackGroundTrans" ,%A_Index%
|
||||
Gui, add, text,% "X" ShadowLeft - 6 " Y" ShadowTop "c"shadowcolor "BackGroundTrans" ,%PosIndex%
|
||||
Gui, add, text,% "X" TextLeft - 6 " Y" TextTop "c"textcolor "BackGroundTrans" ,%PosIndex%
|
||||
}
|
||||
|
||||
|
||||
@ -922,12 +923,12 @@ creategroups:
|
||||
|
||||
If Gridtop = Run
|
||||
{
|
||||
GridBottom := %A_Index%GridBottom
|
||||
GridLeft := %A_Index%GridLeft
|
||||
GridBottom := %PosIndex%GridBottom
|
||||
GridLeft := %PosIndex%GridLeft
|
||||
|
||||
If ShowNumbersFlag
|
||||
{
|
||||
If (%A_Index%GridBottom != "")
|
||||
If (%PosIndex%GridBottom != "")
|
||||
{
|
||||
Gui, add, text,c%shadowcolor% BackGroundTrans X%RestoreLeftShadow% Y%ShadowTop% ,%A_Index%-%GridBottom%
|
||||
Gui, add, text,c%textcolor% BackGroundTrans X%RestoreLeft% Y%TextTop% ,%A_Index%-%GridBottom%
|
||||
@ -939,7 +940,7 @@ creategroups:
|
||||
}
|
||||
}else
|
||||
{
|
||||
If (%A_Index%GridBottom != "")
|
||||
If (%PosIndex%GridBottom != "")
|
||||
{
|
||||
Gui, add, text,c%shadowcolor% BackGroundTrans X%RestoreLeftShadow% Y%ShadowTop% ,%GridBottom%
|
||||
Gui, add, text,c%textcolor% BackGroundTrans X%RestoreLeft% Y%TextTop% ,%GridBottom%
|
||||
@ -1210,7 +1211,7 @@ ApplyGrid:
|
||||
else
|
||||
GoSub, CreateGridFromFile
|
||||
return
|
||||
|
||||
; RegisterGridTile()
|
||||
CreateGridFromFile:
|
||||
Menu,templates_menu,DeleteAll
|
||||
createTemplatesMenu()
|
||||
@ -1226,19 +1227,26 @@ CreateGridFromFile:
|
||||
return
|
||||
}
|
||||
ErrorLevel := False
|
||||
NShortCuts := %NGroups%
|
||||
loop,%NGroups%
|
||||
{
|
||||
if a_index = "0"
|
||||
continue
|
||||
TriggerTop = %A_Index%TriggerTop
|
||||
TriggerBottom = %A_Index%TriggerBottom
|
||||
TriggerRight = %A_Index%TriggerRight
|
||||
TriggerLeft = %A_Index%TriggerLeft
|
||||
IniRead, PosIndex, %A_ScriptDir%\%GridName%,%A_Index%, ShortCutNum, %A_Index%
|
||||
if (ErrorLevel != 0 AND %PosNum% = %A_Index% )
|
||||
{
|
||||
ErrorLevel := False
|
||||
}
|
||||
%A_Index%PosNum = %PosIndex%
|
||||
TriggerTop = %PosIndex%TriggerTop
|
||||
TriggerBottom = %PosIndex%TriggerBottom
|
||||
TriggerRight = %PosIndex%TriggerRight
|
||||
TriggerLeft = %PosIndex%TriggerLeft
|
||||
|
||||
GridTop = %A_Index%GridTop
|
||||
GridBottom = %A_Index%GridBottom
|
||||
GridRight = %A_Index%GridRight
|
||||
GridLeft = %A_Index%GridLeft
|
||||
GridTop = %PosIndex%GridTop
|
||||
GridBottom = %PosIndex%GridBottom
|
||||
GridRight = %PosIndex%GridRight
|
||||
GridLeft = %PosIndex%GridLeft
|
||||
|
||||
IniRead,%TriggerTop% ,%A_ScriptDir%\%GridName%,%A_Index%,TriggerTop,Error
|
||||
IniRead,%TriggerBottom% ,%A_ScriptDir%\%GridName%,%A_Index%,TriggerBottom,Error
|
||||
@ -1249,6 +1257,7 @@ CreateGridFromFile:
|
||||
IniRead,%GridBottom% ,%A_ScriptDir%\%GridName%,%A_Index%,GridBottom,Error
|
||||
IniRead,%GridLeft% ,%A_ScriptDir%\%GridName%,%A_Index%,GridLeft,Error
|
||||
IniRead,%GridRight% ,%A_ScriptDir%\%GridName%,%A_Index%,GridRight,Error
|
||||
; IniRead,%PosNum% ,%A_ScriptDir%\%GridName%,%PosIndex%,PosNum,%PosIndex%
|
||||
|
||||
If (%TriggerTop%="Error" OR %TriggerBottom%="Error"
|
||||
OR %TriggerLeft%="Error" OR %TriggerRight%="Error" )
|
||||
@ -1401,36 +1410,38 @@ evaluateGrid()
|
||||
count := 0
|
||||
loop,%NGroups%
|
||||
{
|
||||
PosIndex := %A_Index%PosNum
|
||||
value := A_Index - count
|
||||
PosIndex := %value%PosNum
|
||||
|
||||
%value%TriggerTop := eval(%A_Index%TriggerTop)
|
||||
%value%TriggerBottom := eval(%A_Index%TriggerBottom)
|
||||
%value%TriggerLeft := eval(%A_Index%TriggerLeft)
|
||||
%value%TriggerRight := eval(%A_Index%TriggerRight)
|
||||
%PosIndex%TriggerTop := CalcEval(%PosIndex%TriggerTop)
|
||||
%PosIndex%TriggerBottom := CalcEval(%PosIndex%TriggerBottom)
|
||||
%PosIndex%TriggerLeft := CalcEval(%PosIndex%TriggerLeft)
|
||||
%PosIndex%TriggerRight := CalcEval(%PosIndex%TriggerRight)
|
||||
|
||||
If (%A_Index%GridTop = "Run")
|
||||
If (%PosIndex%GridTop = "Run")
|
||||
{
|
||||
%value%GridTop := %A_Index%GridTop
|
||||
%value%GridBottom := %A_Index%GridBottom
|
||||
%value%GridLeft := %A_Index%GridLeft
|
||||
%value%GridRight := %A_Index%GridRight
|
||||
%PosIndex%GridTop := %PosIndex%GridTop
|
||||
%PosIndex%GridBottom := %PosIndex%GridBottom
|
||||
%PosIndex%GridLeft := %PosIndex%GridLeft
|
||||
%PosIndex%GridRight := %PosIndex%GridRight
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
if(%value%GridTop <> "")
|
||||
%value%GridTop := eval(%A_Index%GridTop)
|
||||
if(%value%GridBottom <> "")
|
||||
%value%GridBottom := eval(%A_Index%GridBottom)
|
||||
if(%value%GridLeft <> "")
|
||||
%value%GridLeft := eval(%A_Index%GridLeft)
|
||||
if(%value%GridRight <> "")
|
||||
%value%GridRight := eval(%A_Index%GridRight)
|
||||
if(%PosIndex%GridTop <> "")
|
||||
%PosIndex%GridTop := CalcEval(%PosIndex%GridTop)
|
||||
if(%PosIndex%GridBottom <> "")
|
||||
%PosIndex%GridBottom := CalcEval(%PosIndex%GridBottom)
|
||||
if(%PosIndex%GridLeft <> "")
|
||||
%PosIndex%GridLeft := CalcEval(%PosIndex%GridLeft)
|
||||
if(%PosIndex%GridRight <> "")
|
||||
%PosIndex%GridRight := CalcEval(%PosIndex%GridRight)
|
||||
|
||||
if (%value%TriggerTop = "error" OR %value%TriggerBottom = "Error"
|
||||
OR %value%TriggerLeft = "error" OR %value%TriggerRight = "error"
|
||||
OR %value%GridTop = "error" OR %value%GridBottom = "Error"
|
||||
OR %value%GridLeft = "error" OR %value%GridRight = "error")
|
||||
if (%PosIndex%TriggerTop = "error" OR %PosIndex%TriggerBottom = "Error"
|
||||
OR %PosIndex%TriggerLeft = "error" OR %PosIndex%TriggerRight = "error"
|
||||
OR %PosIndex%GridTop = "error" OR %PosIndex%GridBottom = "Error"
|
||||
OR %PosIndex%GridLeft = "error" OR %PosIndex%GridRight = "error")
|
||||
{
|
||||
count += 1
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user