Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/Gesture.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by yoffy, Mon Oct 11 14:38:58 2004 UTC revision 1.1.4.1 by h677, Sat Jul 9 05:28:35 2005 UTC
# Line 105  function TMouseGesture.CheckAction(Messa Line 105  function TMouseGesture.CheckAction(Messa
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.1.4.1

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26