-- Define Mouse Gesture direction (\)
-- Combo - 3in1 Functions
-- (Single Window Mode) -- Gesture Start and End in the single window -- (current Window) --> (center window) <--> resize to 1/3 @ corner
-- (Tile Window Mode, side by side) -- Gesture cross two window and make it tile side by side -- If both windows are same title, then Switch to single window mode
-- Get Window Position local hFirstWindow = acGetOwnerWindowByPoint(gsx, gsy) local hSecondWindow = acGetOwnerWindowByPoint(gex, gey) local hFirstWindowLeft = acGetWindowLeft(hFirstWindow) local hFirstWindowRight = acGetWindowRight(hFirstWindow) local hFirstWindowTitle = acGetWindowTitle(hFirstWindow, 0, 0) local hSecondWindowTitle = acGetWindowTitle(hSecondWindow, 0, 0)
--Get Current Screen Position local hScreen = acGetMonitorFromPoint(gsx, gsy) local iScreenTop = acGetMonitorTop(hScreen, 1) local iScreenBottom = acGetMonitorBottom(hScreen, 1) local iScreenRight = acGetMonitorRight(hScreen, 1) local iScreenLeft = acGetMonitorLeft(hScreen, 1) local iScreenHeight = iScreenBottom - iScreenTop local iScreenWidth = iScreenRight - iScreenLeft
acActivateWindow(hFirstWindow, 0, 0, 0)
if hFirstWindowTitle == hSecondWindowTitle and gsx>=hFirstWindowLeft and gex<=hFirstWindowRight or hSecondWindowTitle == "" then
-- Toggle Current Windows Position Center or Semi-Minimize local nWinPos = iScreenLeft+iScreenWidth/8
acRestoreWindow(hFirstWindow, 0, 0) if hFirstWindowLeft <= iScreenWidth+nWinPos and hFirstWindowLeft ~= nWinPos then -- Center Window Width75% Height90% acMoveWindow(hFirstWindow, 0, 0, nWinPos, iScreenTop+iScreenHeight/20) acSetWindowSize(hFirstWindow, 0, 0, iScreenWidth-iScreenWidth/4, iScreenHeight-iScreenHeight/10) else -- Semi-Window 2/3 size acMoveWindow(hFirstWindow, 0, 0, iScreenLeft+iScreenWidth-iScreenWidth/3, iScreenTop+iScreenHeight/3) acSetWindowSize(hFirstWindow, 0, 0, iScreenWidth/3, iScreenHeight-iScreenHeight/3) end
else -- Tile Two Windows side by side acRestoreWindow(hFirstWindow, 0, 0) acRestoreWindow(hSecondWindow, 0, 0)
--Move to position acActivateWindow(hFirstWindow, 0, 0, 0) acMoveWindow(hFirstWindow, 0, 0, iScreenLeft, iScreenTop) acMoveWindow(hSecondWindow, 0, 0, iScreenLeft+iScreenWidth/2, iScreenTop)
--Size them accordingly local iReserveHeight=20 -- 20pix reserve, personal favor
acSetWindowSize(hFirstWindow, 0, 0, iScreenWidth/2, iScreenHeight-iReserveHeight) acSetWindowSize(hSecondWindow, 0, 0, iScreenWidth/2, iScreenHeight-iReserveHeight) end
|