Browse CVS Repository
Diff of /gikonavigoeson/gikonavi/Gesture.pas
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 105 |
var |
var |
| 106 |
dp: TPoint; |
dp: TPoint; |
| 107 |
sp: TPoint; |
sp: TPoint; |
| 108 |
|
hwnd: THandle; |
| 109 |
begin |
begin |
| 110 |
Result := False; |
Result := False; |
| 111 |
case Message of |
case Message of |
| 112 |
WM_MOUSEMOVE: begin |
WM_MOUSEMOVE: begin |
| 113 |
if FBeginGesture then begin |
if FBeginGesture then begin |
| 114 |
|
//今マウスをキャプチャーしているのを得る |
| 115 |
|
hwnd := GetCapture; |
| 116 |
|
//マウスジェスチャーの対象と違うときは、開放する |
| 117 |
|
if (hwnd <> 0) and (hwnd <> FHandle) then begin |
| 118 |
|
ReleaseCapture; |
| 119 |
|
end; |
| 120 |
SetCapture(FHandle); |
SetCapture(FHandle); |
| 121 |
dp := Point(x - FLastPoint.X, y - FLastPoint.Y); |
dp := Point(x - FLastPoint.X, y - FLastPoint.Y); |
| 122 |
sp := Point(Sign(dp.X), Sign(dp.Y)); |
sp := Point(Sign(dp.X), Sign(dp.Y)); |
| 123 |
if Sqrt(dp.X * dp.X + dp.Y * dp.Y) > FMargin then begin |
if (dp.X * dp.X + dp.Y * dp.Y) > (FMargin * FMargin) then begin |
| 124 |
dp := Point(Abs(dp.X), Abs(dp.Y)); |
dp := Point(Abs(dp.X), Abs(dp.Y)); |
| 125 |
if dp.X > dp.Y / 3 then |
if dp.X > dp.Y div 3 then |
| 126 |
sp.Y := 0; |
sp.Y := 0; |
| 127 |
if dp.Y > dp.X / 3 then |
if dp.Y > dp.X div 3 then |
| 128 |
sp.X := 0; |
sp.X := 0; |
| 129 |
AddAction(sp.X, sp.Y); |
AddAction(sp.X, sp.Y); |
| 130 |
FLastTime := GetTickCount; |
FLastTime := GetTickCount; |
| 131 |
FLastPoint := Point(x, y); |
FLastPoint := Point(x, y); |
| 132 |
end; |
end; |
| 133 |
|
//マウスを再設定 |
| 134 |
|
if (hwnd <> 0) and (hwnd <> FHandle) then |
| 135 |
|
SetCapture(hwnd); |
| 136 |
|
|
| 137 |
Result := True; |
Result := True; |
| 138 |
end; |
end; |
| 139 |
end; |
end; |
|
|
Legend:
| Removed from v.1.1 |
|
| changed lines |
| |
Added in v.1.2 |
|
|
| |