NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

bDpiChanged := true
}
}
}
;...........................................................................
; Draw Arrows
if ((szArrows!=MG_PrevGesture) || bDpiChanged)
{
RegExMatch(szGesture, "(w+)_", $)
local fgc := (MG_ExNaviFG_%$1% != "") ? MG_ExNaviIdvFG : MG_ExNaviFG2
local bgc := MG_ExNaviIdvBG ? MG_ExNaviIdvBG : MG_ExNaviBG2
local hDC := DllCall("GetWindowDC", "Ptr",MG_ExNaviHwnd, "Ptr")
local hFont := MG_CreateFont("Wingdings", MG_ExNaviSize)
local hFntOld := DllCall("SelectObject", "Ptr",hDC, "Ptr",hFont, "Ptr")
DllCall("SetTextColor","Ptr",hDC, "UInt",fgc)
DllCall("SetBkColor","Ptr",hDC, "UInt",bgc)
if (MG_UseExNavi==1) {
MG_UpdateArrowHints1(hDC, szGesture, szArrows, winX, winY, bgc)
} else if (MG_UseExNavi==2) {
MG_UpdateArrowHints2(hDC, szGesture, szArrows, winX, winY, bgc)
}
DllCall("SelectObject", "Ptr",hDC, "Ptr",hFntOld)
DllCall("DeleteObject", "Ptr",hFont)
DllCall("ReleaseDC", "Ptr",MG_ExNaviHwnd, "Ptr",hDC)
}
;...........................................................................
; Only Move Window
else if (prevX!=winX || prevY!=winY)
{
Gui, MGW_ExNavi:Show, x%winX% y%winY% NA
}
prevX:=winX, prevY:=winY
MG_PrevGesture := szArrows
fCritical := 0
}

;-------------------------------------------------------------------------------
; Update Hint Arrows Type 1
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_UpdateArrowHints1(hDC, szGesture, szArrows, winX, winY, clrBG)
{
global
DllCall("SetTextCharacterExtra", "Ptr",hDC, "Int",MG_AdjustToDPI(MG_ExNaviSpacing))
local size
VarSetCapacity(size, 8, 0)
DllCall("GetTextExtentPoint32", "Ptr",hDC, "Str",szArrows, "Int",StrLen(szArrows), "Ptr",&size)
local winW := NumGet(size, 0, "UInt") + MG_AdjustToDPI(MG_ExNaviPadding)*2
local winH := NumGet(size, 4, "UInt") + MG_AdjustToDPI(MG_ExNaviPadding)*2
if (winW && winH)
{
Gui, MGW_ExNavi:Show, x%winX% y%winY% w%winW% h%winH% NA
MG_EraseArrows(hDC, clrBG)
DllCall("TextOut", "Ptr",hDC, "Int",MG_AdjustToDPI(MG_ExNaviPadding)
, "Int",MG_AdjustToDPI(MG_ExNaviPadding), "Str",szArrows, "Int",StrLen(szArrows))
}
}

;-------------------------------------------------------------------------------
; Update Hint Arrows Type 2
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_UpdateArrowHints2(hDC, szGesture, szArrows, winX, winY, clrBG)
{
global
local size
VarSetCapacity(size, 8, 0)
local OneArrow = SubStr(szArrows, 1, 1)
DllCall("GetTextExtentPoint32", "Ptr",hDC, "Str",OneArrow, "Int",1, "Ptr",&size)
local w := NumGet(size, 0, "UInt")
local h := NumGet(size, 4, "UInt")
local FullW := (w > h) ? w : h
FullW += MG_AdjustToDPI(MG_ExNaviSpacing)
local HalfW := FullW
HalfW /= 2

local maxX:=0, maxY:=0, minX:=0, minY:=0
Loop, Parse, szArrows
{
local preIdx := A_Index - 1
if (MG_ArrowPos%A_Index% == 1) {
ArrowX%A_Index% := ArrowX%preIdx% - FullW
ArrowY%A_Index% := ArrowY%preIdx% + FullW
}
else if (MG_ArrowPos%A_Index% == 2) {
ArrowX%A_Index% := ArrowX%preIdx%
ArrowY%A_Index% := ArrowY%preIdx% + FullW
}
else if (MG_ArrowPos%A_Index% == 3) {
ArrowX%A_Index% := ArrowX%preIdx% + FullW
ArrowY%A_Index% := ArrowY%preIdx% + FullW
}
else if (MG_ArrowPos%A_Index% == 4) {
ArrowX%A_Index% := ArrowX%preIdx% - FullW
ArrowY%A_Index% := ArrowY%preIdx%
}
else if (MG_ArrowPos%A_Index% == 6) {
ArrowX%A_Index% := ArrowX%preIdx% + FullW
ArrowY%A_Index% := ArrowY%preIdx%
}
else if (MG_ArrowPos%A_Index% == 7) {
ArrowX%A_Index% := ArrowX%preIdx% - FullW
ArrowY%A_Index% := ArrowY%preIdx% - FullW
}
else if (MG_ArrowPos%A_Index% == 8) {
ArrowX%A_Index% := ArrowX%preIdx%
ArrowY%A_Index% := ArrowY%preIdx% - FullW
}
else if (MG_ArrowPos%A_Index% == 9) {
ArrowX%A_Index% := ArrowX%preIdx% + FullW
ArrowY%A_Index% := ArrowY%preIdx% - FullW
}
else if (MG_ArrowPos%A_Index% == 10) {
ArrowX%A_Index% := ArrowX%preIdx% - HalfW
ArrowY%A_Index% := ArrowY%preIdx% - FullW
}
else if (MG_ArrowPos%A_Index% == 11) {
ArrowX%A_Index% := ArrowX%preIdx% - FullW
ArrowY%A_Index% := ArrowY%preIdx% - HalfW
}
else if (MG_ArrowPos%A_Index% == 12) {
ArrowX%A_Index% := ArrowX%preIdx% + FullW
ArrowY%A_Index% := ArrowY%preIdx% - HalfW
}
else if (MG_ArrowPos%A_Index% == 13) {
ArrowX%A_Index% := ArrowX%preIdx% + HalfW
ArrowY%A_Index% := ArrowY%preIdx% - FullW
}
else if (MG_ArrowPos%A_Index% == 14) {
ArrowX%A_Index% := ArrowX%preIdx% + HalfW
ArrowY%A_Index% := ArrowY%preIdx% + FullW
}
else if (MG_ArrowPos%A_Index% == 15) {
ArrowX%A_Index% := ArrowX%preIdx% + FullW
ArrowY%A_Index% := ArrowY%preIdx% + HalfW
}
else if (MG_ArrowPos%A_Index% == 16) {
ArrowX%A_Index% := ArrowX%preIdx% - FullW
ArrowY%A_Index% := ArrowY%preIdx% + HalfW
}
else if (MG_ArrowPos%A_Index% == 17) {
ArrowX%A_Index% := ArrowX%preIdx% - HalfW
ArrowY%A_Index% := ArrowY%preIdx% + FullW
}
else {
ArrowX%A_Index% := 0
ArrowY%A_Index% := 0
}
if (maxX < ArrowX%A_Index%) {
maxX := ArrowX%A_Index%
}
if (maxY < ArrowY%A_Index%) {
maxY := ArrowY%A_Index%
}
if (minX > ArrowX%A_Index%) {
minX := ArrowX%A_Index%
}
if (minY > ArrowY%A_Index%) {
minY := ArrowY%A_Index%
}
}
local winW := maxX - minX + FullW - MG_AdjustToDPI(MG_ExNaviSpacing)
local winH := maxY - minY + FullW - MG_AdjustToDPI(MG_ExNaviSpacing)
if (winW && winH)
{
Gui, MGW_ExNavi:Show, x%winX% y%winY% w%winW% h%winH% NA
MG_EraseArrows(hDC, clrBG)
Loop, Parse, szArrows
{
local posX := ArrowX1 + ArrowX%A_Index% - minX
local posY := ArrowY1 + ArrowY%A_Index% - minY
DllCall("TextOut", "Ptr",hDC, "Int",posX, "Int",posY, "Str",A_LoopField, "Int",1)
}
}
}

;-------------------------------------------------------------------------------
; Erase hint arrows with filling by background color
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_EraseArrows(hDC, clrBG)
{
local w, h, rc, hBrush
WinGetPos,,, w, h, ahk_id %MG_ExNaviHwnd%
VarSetCapacity(rc, 16, 0)
NumPut(w, rc, 8, "UInt")
NumPut(h, rc, 12, "UInt")
hBrush := DllCall("CreateSolidBrush", "UInt",clrBG, "Ptr")
DllCall("FillRect", "Ptr",hDC, "Ptr",&rc, "Ptr",hBrush)
DllCall("DeleteObject", "Ptr",hBrush)
}

;-------------------------------------------------------------------------------
; Make Arrows String
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_MakeArrowsStr(szGesture)
{
global
static DirD=0xEA, DirL=0xE7, DirR=0xE8, DirU=0xE9
static Dir1=0xED, Dir2=0xEA, Dir3=0xEE, Dir4=0xE7, Dir6=0xE8, Dir7=0xEB, Dir8=0xE9, Dir9=0xEC
static Next11:=1, Next12:=17, Next13:=2, Next14:=16, Next16:=2, Next17:=4, Next18:=4, Next19:=9
static Next21:=17, Next22:=2, Next23:=14, Next24:=1, Next26:=3, Next27:=4, Next28:=8, Next29:=6
static Next31:=2, Next32:=14, Next33:=3, Next34:=2, Next36:=15, Next37:=7, Next38:=6, Next39:=6
static Next41:=16, Next42:=1, Next43:=2, Next44:=4, Next46:=6, Next47:=11, Next48:=7, Next49:=8
static Next61:=2, Next62:=3, Next63:=15, Next64:=4, Next66:=6, Next67:=8, Next68:=9, Next69:=12
static Next71:=4, Next72:=4, Next73:=3, Next74:=11, Next76:=8, Next77:=7, Next78:=10, Next79:=8
static Next81:=4, Next82:=2, Next83:=6, Next84:=7, Next86:=9, Next87:=10, Next88:=8, Next89:=13
static Next91:=1, Next92:=6, Next93:=6, Next94:=8, Next96:=12, Next97:=8, Next98:=13, Next99:=9

Loop, % MG_BtnNames.MaxIndex() {
if (MG_BtnNames[A_Index]) {
szGesture := RegExReplace(szGesture, MG_BtnNames[A_Index] . "_")
}
}
szGesture := RegExReplace(szGesture, "_")
RegExMatch(szGesture, "[DLRU12346789]*", $)
if (!StrLen($))
{
return
}
local szArrows:="", num:=0, dirPrev:=0
Loop, Parse, $
{
szArrows .= Chr(Dir%A_LoopField%)
if (MG_UseExNavi==2)
{
local dirThis:=A_LoopField
if (dirThis = "L") {
dirThis:="4"
}
else if (dirThis = "R") {
dirThis:="6"
}
else if (dirThis = "U") {
dirThis:="8"
}
else if (dirThis = "D") {
dirThis:="2"
}
num++
MG_ArrowPos%num% := Next%dirPrev%%dirThis%
dirPrev := dirThis
}
}
return szArrows
}

;-------------------------------------------------------------------------------
; Update Advanced Gesture Hints
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_UpdateAdNavi()
{
global
static prevX:=0, prevY:=0
;...........................................................................
; Critical Section
static fCritical := 0
if (fCritical) {
return
}
fCritical := 1
;...........................................................................
; Check Gesture Conditions
local szGesture := MG_NaviPrst ? MG_NaviPrstStr : MG_Gesture
if (!szGesture) {
fCritical := 0
return
}
if (!MG_AdNaviOnClick && (szGesture = MG_1stTrigger)) {
Gui, MGW_ExNavi:Hide
fCritical := 0
return
}
;...........................................................................
; Decide Drawing Position
local winX, winY, newDPI, bDpiChanged:=false
if (MG_AdNaviPosition == 0) {
if (MG_AdNaviMargin < 0) {
winX:=MG_X, winY:=MG_Y
}
else {
CoordMode,Mouse,Screen
MouseGetPos, winX, winY
winX += MG_AdjustToDPI(MG_AdNaviMargin)
winY += MG_AdjustToDPI(MG_AdNaviMargin)
if (prevX!=winX || prevY!=winY) {
newDPI := MG_GetDpiFromPoint(winX, winY)
if (newDPI != MG_ScreenDPI) {
MG_ScreenDPI := newDPI
bDpiChanged := true
}
}
}
}
;...........................................................................
; Draw Gesture Pattern
if ((szGesture!=MG_PrevGesture) || bDpiChanged) {
local hDC := DllCall("GetWindowDC", "Ptr",MG_ExNaviHwnd, "Ptr")
MG_hFntBtn := MG_CreateFont(MG_AdNaviFont, MG_AdNaviSize, 700)
MG_hFntDir := MG_CreateFont("Wingdings", MG_AdNaviSize)
MG_hFntAct := MG_CreateFont(MG_AdNaviFont, MG_AdNaviSize)
DllCall("SetBkColor", "Ptr",hDC, "UInt",MG_AdNaviBG2)
if (MG_UseExNavi==3) {
MG_UpdateAdNavi1(hDC, winX, winY, szGesture)
}
else if (MG_UseExNavi==4) {
MG_UpdateAdNavi2(hDC, winX, winY, szGesture)
}
DllCall("DeleteObject", "Ptr",MG_hFntBtn)
DllCall("DeleteObject", "Ptr",MG_hFntDir)
DllCall("DeleteObject", "Ptr",MG_hFntAct)
DllCall("ReleaseDC", "Ptr",MG_ExNaviHwnd, "Ptr",hDC)
}
;...........................................................................
; Only Move Window
else if ((MG_AdNaviPosition==0) && (prevX!=winX || prevY!=winY)) {
local dwStyle
WinGet, dwStyle, Style, ahk_id %MG_ExNaviHwnd%
if (dwStyle & 0x10000000) {
Gui, MGW_ExNavi:Show, x%winX% y%winY% NA
}
}
prevX:=winX, prevY:=winY
MG_PrevGesture := szGesture
fCritical := 0
}

;-------------------------------------------------------------------------------
; Update Advanced Gesture Hints Type 1
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_UpdateAdNavi1(hDC, winX, winY, szGesture)
{
global
local gesW, gesH
MG_DrawGesture(hDC, 0, 0, szGesture, gesW, gesH, 1)
MG_ActionStr := ""
if (IsLabel("MG_GetAction_" . szGesture . "_")) {
GoSub, MG_GetAction_%szGesture%_
}
local actW:=0, actH:=0
if (MG_ActionStr)
{
MG_ActionStr := " : " . MG_ActionStr
MG_DrawAction(hDC, 0, 0, MG_ActionStr, 1, actW, actH)
}
local winW := gesW + actW + MG_AdjustToDPI(MG_AdNaviPaddingL) + MG_AdjustToDPI(MG_AdNaviPaddingR)
local winH := (gesH>actH ? gesH : actH) + MG_AdjustToDPI(MG_AdNaviPaddingT) + MG_AdjustToDPI(MG_AdNaviPaddingB)
if (! winW || !winH) {
return
}
MG_SetAdNaviPos(winX, winY, winW, winH)
Gui, MGW_ExNavi:Show, x%winX% y%winY% w%winW% h%winH% NA
MG_RoundWindow(hDC, winW, winH, MG_AdjustToDPI(MG_AdNaviRound), MG_AdNaviBG2, MG_AdNaviTransClr2)
DllCall("SetTextColor", "Ptr",hDC, "UInt",MG_AdNaviFG2)
MG_DrawGesture(hDC, MG_AdjustToDPI(MG_AdNaviPaddingL), MG_AdjustToDPI(MG_AdNaviPaddingT), szGesture, gesW, gesH)
if (actW) {
MG_DrawAction(hDC, MG_AdjustToDPI(MG_AdNaviPaddingL)+gesW, MG_AdjustToDPI(MG_AdNaviPaddingT), MG_ActionStr)
}
}

;-------------------------------------------------------------------------------
; Update Advanced Gesture Hints Type 2 (Gesture Navigation)
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_UpdateAdNavi2(hDC, winX, winY, szGesture)
{
global
local gesW:=0, gesH:=0, actW:=0, nGes:=0, szGes:="", len:=StrLen(szGesture)
;...........................................................................
; Compare current gesture to registered gestures
Loop, %Gesture_Count%
{
local idxGes:=A_Index
Loop, Parse, Gesture_%A_Index%_Patterns, `n
{
if (InStr(A_LoopField, szGesture)==1) {
;...............................................................
; Eliminate the cases matched to part of button names
local dir1:=A_LoopField, dir2:=szGesture
Loop, % MG_BtnNames.MaxIndex() {
if (MG_BtnNames[A_Index]) {
dir1 := RegExReplace(dir1, MG_BtnNames[A_Index] . "_")
dir2 := RegExReplace(dir2, MG_BtnNames[A_Index] . "_")
}
}
if (InStr(dir1, dir2)!=1) {
Continue
}
;...............................................................
; Get Bound Action String
MG_ActionStr := ""
if (IsLabel("MG_GetAction_" . A_LoopField)) {
GoSub, MG_GetAction_%A_LoopField%
}
if (!MG_ActionStr) {
Continue
}
;...............................................................
; Update size of area to draw
local tmpW, tmpH1, tmpH2
MG_DrawGesture(hDC, 0, 0, A_LoopField, tmpW, tmpH1, 1)
if (gesW < tmpW) {
gesW := tmpW
}
MG_ActionStr := " : " . MG_ActionStr
MG_DrawAction(hDC, 0, 0, MG_ActionStr, 1, tmpW, tmpH2)
if (actW < tmpW) {
actW := tmpW
}
nGes++
nRowH%nGes% := (tmpH1>=tmpH2) ? tmpH1 : tmpH2
gesH += nRowH%nGes%
szAct%nGes% := MG_ActionStr
szGes .= szGes ? "`," : ""
szGes .= A_LoopField
}
}
}
;...........................................................................
; Draw Gesture Patterns and Bound Actions
if (nGes)
{
local winW := gesW + actW + MG_AdjustToDPI(MG_AdNaviPaddingL) + MG_AdjustToDPI(MG_AdNaviPaddingR)
local winH := gesH + MG_AdjustToDPI(MG_AdNaviPaddingT) + MG_AdjustToDPI(MG_AdNaviPaddingB)
if (! winW || !winH) {
return
}
MG_SetAdNaviPos(winX, winY, winW, winH)
Gui, MGW_ExNavi:Show, x%winX% y%winY% w%winW% h%winH% NA
MG_RoundWindow(hDC, winW, winH, MG_AdjustToDPI(MG_AdNaviRound), MG_AdNaviBG2, MG_AdNaviTransClr2)
local ptY := MG_AdjustToDPI(MG_AdNaviPaddingT)
DllCall("SetTextColor", "Ptr",hDC, "UInt",MG_AdNaviFG2)
Loop, Parse, szGes, `,
{
MG_DrawGesture(hDC, MG_AdjustToDPI(MG_AdNaviPaddingL), ptY, A_LoopField, gesW+actW, nRowH%A_Index%, 0, len)
DllCall("SetTextColor", "Ptr",hDC, "UInt",MG_AdNaviFG2)
MG_DrawAction(hDC, MG_AdjustToDPI(MG_AdNaviPaddingL)+gesW, ptY, szAct%A_Index%)
ptY += nRowH%A_Index%
}
}
else
{
Gui, MGW_ExNavi:Hide
}
}

;-------------------------------------------------------------------------------
; Set Display Position of Advanced Gesture Hints
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_SetAdNaviPos(ByRef winX, ByRef winY, winW, winH)
{
global
if (MG_AdNaviPosition == 0) {
return
}
else if (MG_AdNaviPosition == 1) {
winX := MG_MonitorL + MG_AdjustToDPI(MG_AdNaviSpaceX)
winY := MG_MonitorT + MG_AdjustToDPI(MG_AdNaviSpaceY)
}
else if (MG_AdNaviPosition == 2) {
winX := MG_MonitorR - MG_AdjustToDPI(MG_AdNaviSpaceX) - winW
winY := MG_MonitorT + MG_AdjustToDPI(MG_AdNaviSpaceY)
}
else if (MG_AdNaviPosition == 3) {
winX := MG_MonitorL + MG_AdjustToDPI(MG_AdNaviSpaceX)
winY := MG_MonitorB - MG_AdjustToDPI(MG_AdNaviSpaceY) - winH
}
else if (MG_AdNaviPosition == 4) {
winX := MG_MonitorR - MG_AdjustToDPI(MG_AdNaviSpaceX) - winW
winY := MG_MonitorB - MG_AdjustToDPI(MG_AdNaviSpaceY) - winH
}
}

;-------------------------------------------------------------------------------
; Round Window Corners
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_RoundWindow(hDC, winW, winH, nRadius, clrBG, clrTrans)
{
if (nRadius <= 0)
{
return
}
winW++, winH++
hBrsB := DllCall("CreateSolidBrush", "UInt",clrBG, "Ptr")
hBrsT := DllCall("CreateSolidBrush", "UInt",clrTrans, "Ptr")
hRgn1 := DllCall("CreateRectRgn", "Int",0, "Int",0, "Int",winW, "Int",winH, "Ptr")
hRgn2 := DllCall("CreateRoundRectRgn", "Int",0, "Int",0, "Int",winW, "Int",winH, "Int",nRadius*2, "Int",nRadius*2, "Ptr")
DllCall("CombineRgn", "Ptr",hRgn1, "Ptr",hRgn1, "Ptr",hRgn2, "Int",4)
DllCall("FillRgn", "Ptr",hDC, "Ptr",hRgn1, "Ptr",hBrsT)
DllCall("FillRgn", "Ptr",hDC, "Ptr",hRgn2, "Ptr",hBrsB)
DllCall("DeleteObject", "Ptr",hBrsB)
DllCall("DeleteObject", "Ptr",hBrsT)
DllCall("DeleteObject", "Ptr",hRgn1)
DllCall("DeleteObject", "Ptr",hRgn2)
}

;-------------------------------------------------------------------------------
; Draw Action String
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_DrawAction(hDC, ptX, ptY, szAction, fMeasure=0, ByRef strW=0, ByRef strH=0)
{
global MG_hFntAct, MG_AdNaviNI2

hFntOld := DllCall("SelectObject", "Ptr",hDC, "Ptr",MG_hFntAct, "Ptr")
if (fMeasure)
{
VarSetCapacity(size, 8, 0)
DllCall("GetTextExtentPoint32", "Ptr",hDC, "Str",szAction, "Int",StrLen(szAction), "Ptr",&size)
strW := NumGet(size, 0, "UInt")
strH := NumGet(size, 4, "UInt")
}
else
{
DllCall("TextOut", "Ptr",hDC, "Int",ptX, "Int",ptY, "Str",szAction, "Int",StrLen(szAction))
}
DllCall("SelectObject", "Ptr",hDC, "Ptr",hFntOld)
}



;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;
; Gesture Trails
;
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;-------------------------------------------------------------------------------
; Initialize Gesture Trails
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_InitTrail()
{
local style, x, y, width, height, trans

if (!MG_ShowTrail) {
return
}
MG_TrailDrawn := 0
MG_TrailColor2 := MG_ConvertHex(MG_TrailColor)
MG_TrailTransClr := (MG_TrailColor!="FF00FF") ? "FF00FF" : "FE00FE"
MG_TrailTransClr2 := MG_ConvertHex(MG_TrailTransClr)
if (MG_DrawTrailWnd)
{
SysGet, x, 76
SysGet, y, 77
SysGet, width, 78
SysGet, height, 79
x++, y++, width--, height--
Gui, MGW_Trail:New
Gui, MGW_Trail:+HwndMG_TrailHwnd -Caption +ToolWindow +E0x08000020 +LastFound
Gui, MGW_Trail:Color, %MG_TrailTransClr%
trans := ""
if (0<MG_TrailTranspcy && MG_TrailTranspcy<255) {
trans := " " . MG_TrailTranspcy
}
WinSet, TransColor, %MG_TrailTransClr%%trans%
Gui, MGW_Trail:Show, x%x% y%y% w%width% h%height% NA
}
}

;-------------------------------------------------------------------------------
; Start Gesture Trails
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_StartTrail()
{
global
if (MG_ShowTrail) {
SetTimer, MG_DrawTrail, -1
SetTimer, MG_DrawTrail, %MG_TrailInterval%
}
}

;-------------------------------------------------------------------------------
; Stop Gesture Trails
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_StopTrail()
{
global
if (MG_ShowTrail) {
SetTimer, MG_DrawTrail, Off
if (MG_TrailDrawing) {
SetTimer, MG_StopTrail, -100
} else {
MG_ClearTrail()
}
}
}

;-------------------------------------------------------------------------------
; Draw Gesture Trails
; Implemented by Pyonkichi
;-------------------------------------------------------------------------------
MG_DrawTrail()
{
global
;...........................................................................
; Critical Section
if (!MG_ShowTrail || MG_TrailDrawing) {
return
}
MG_TrailDrawing := 1
;...........................................................................
; Check Cursor Movement
local curX, curY
CoordMode, Mouse, Screen
MouseGetPos, curX, curY
if (!MG_TrailDrawn) {
if ((MG_X-curX)**2+(MG_Y-curY)**2 < MG_TrailStartMove**2) {
MG_TrailDrawing := 0
return
} else {
MG_TrailDrawn := 1
Gui, MGW_Trail:+AlwaysOnTop
}
}
local x1:=MG_TX, y1:=MG_TY, x2:=curX, y2:=curY
if (MG_DrawTrailWnd)
{
Gui, MGW_Trail:+LastFound
WinGetPos, left, top
x1-=left, x2-=left, y1-=top, y2-=top
}
local hWnd := MG_DrawTrailWnd ? MG_TrailHwnd : 0
local hDC := DllCall("GetWindowDC", "Ptr",hWnd, "Ptr")
local hPen := DllCall("CreatePen", "Ptr",0, "Ptr",MG_AdjustToDPI(MG_TrailWidth), "Int",MG_TrailColor2)
local hPenOld := DllCall("SelectObject", "Ptr",hDC, "Ptr",hPen, "Ptr")
DllCall("MoveToEx", "Ptr",hDC, "Ptr",x1, "Ptr",y1, "Ptr",0)
DllCall("LineTo", "Ptr",hDC, "Ptr",x2, "Ptr",y2)
DllCall("SelectObject", "Ptr",hDC, "Ptr",hPenOld)
DllCall("DeleteObject", "Ptr",hPen)
DllCall("ReleaseDC", "Ptr",hWnd, "Ptr",hDC)
MG_TX:=curX, MG_TY:=curY
;...........................................................................
; Update bounding rectangle of Gesture Trail
if (MG_TL > curX) {
MG_TL := curX
}
if (MG_TR < curX) {
MG_TR := curX
}
if (MG_TT > curY) {
MG_TT := curY
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.