| 49 |
|
|
| 50 |
implementation |
implementation |
| 51 |
|
|
| 52 |
|
uses |
| 53 |
|
GikoSystem; |
| 54 |
|
|
| 55 |
constructor TMouseGesture.Create; |
constructor TMouseGesture.Create; |
| 56 |
begin |
begin |
| 57 |
inherited; |
inherited; |
| 119 |
//マウスジェスチャーの対象と違うときは、開放する |
//マウスジェスチャーの対象と違うときは、開放する |
| 120 |
if (hwnd <> 0) and (hwnd <> FHandle) then begin |
if (hwnd <> 0) and (hwnd <> FHandle) then begin |
| 121 |
ReleaseCapture; |
ReleaseCapture; |
| 122 |
|
SetCapture(FHandle); |
| 123 |
end; |
end; |
|
SetCapture(FHandle); |
|
| 124 |
dp := Point(x - FLastPoint.X, y - FLastPoint.Y); |
dp := Point(x - FLastPoint.X, y - FLastPoint.Y); |
| 125 |
sp := Point(Sign(dp.X), Sign(dp.Y)); |
sp := Point(Sign(dp.X), Sign(dp.Y)); |
| 126 |
if (dp.X * dp.X + dp.Y * dp.Y) > (FMargin * FMargin) then begin |
if (dp.X * dp.X + dp.Y * dp.Y) > (FMargin * FMargin) then begin |
| 133 |
FLastTime := GetTickCount; |
FLastTime := GetTickCount; |
| 134 |
FLastPoint := Point(x, y); |
FLastPoint := Point(x, y); |
| 135 |
end; |
end; |
| 136 |
Result := True; |
Result := True; |
| 137 |
end; |
end; |
| 138 |
end; |
end; |
| 139 |
WM_RBUTTONDOWN: begin |
WM_RBUTTONDOWN: begin |
| 140 |
if not FCancelMode then begin |
if (not FCancelMode) then begin |
| 141 |
|
if ( GikoSys.Setting.GestureIgnoreContext ) then begin |
| 142 |
|
//今マウスをキャプチャーしているのを得る |
| 143 |
|
hwnd := GetCapture; |
| 144 |
|
//マウスジェスチャーの対象と違うときは、開放する |
| 145 |
|
if (hwnd <> 0) and (hwnd <> FHandle) then begin |
| 146 |
|
Exit; |
| 147 |
|
end; |
| 148 |
|
end; |
| 149 |
FBeginGesture := True; |
FBeginGesture := True; |
| 150 |
FLastTime := 0; |
FLastTime := 0; |
| 151 |
FLastPoint := Point(x, y); |
FLastPoint := Point(x, y); |