OSDN Git Service

マウスジェスチャーの見直し
authorh677 <h677>
Thu, 14 Feb 2008 16:20:41 +0000 (16:20 +0000)
committerh677 <h677>
Thu, 14 Feb 2008 16:20:41 +0000 (16:20 +0000)
サンバタイマーの解放位置を修正

Editor.pas

index afd5a03..cb31f65 100644 (file)
@@ -205,7 +205,6 @@ type
                FDebugStrReceive: string;
                FDebugStrSend: string;
                FNow: TDateTime;
-               FGestures       : TMouseGesture;
                FInputAssistKey: String;        ///< \93ü\97Í\83A\83V\83X\83g\82Ì\83L\81[
                FResistWords: TStringList;      ///< \93ü\97Í\83A\83V\83X\83g\82Ì\8e«\8f\91\82©\82ç\82Ì\8c\9f\8dõ\8c\8b\89Ê
         FSambaTimer: TSambaTimer;   ///< Samba\91Î\8dô\82Ì\83^\83C\83}\81[
@@ -390,19 +389,6 @@ begin
 
        // \83L\81[\90Ý\92è\82Ì\93Ç\82Ý\8d\9e\82Ý
        GikoSys.LoadKeySetting(ActionList, GikoSys.GetEditorKeyFileName);
-       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\82Ì\83C\83\93\83X\83g\81[\83\8b
-       if GikoSys.Setting.GestureEnabled then begin
-               MouseGesture.UnHook;
-               FGestures := TMouseGesture.Create;
-               GikoSys.Setting.Gestures.ClearGesture;
-
-               GikoSys.Setting.Gestures.LoadGesture(
-                       GikoSys.Setting.GetGestureFileName, ActionList );
-               MouseGesture.OnGestureStart := OnGestureStart;
-               MouseGesture.OnGestureMove := OnGestureMove;
-               MouseGesture.OnGestureEnd := OnGestureEnd;
-               MouseGesture.SetHook( Handle );
-       end;
        SaveNameMailAction.Checked := True;
 end;
 procedure TEditorForm.SetBoard(Item: TBoard);
@@ -635,13 +621,21 @@ end;
 procedure TEditorForm.FormClose(Sender: TObject; var Action: TCloseAction);
 begin
        Action := caFree;
-    FSambaTimer.Free;
+    if GikoSys.Setting.GestureEnabled then begin
+        GikoSys.Setting.Gestures.ClearGesture;
+        MouseGesture.UnHook;
+               MouseGesture.OnGestureStart := nil;
+               MouseGesture.OnGestureMove := nil;
+               MouseGesture.OnGestureEnd := nil;
+    end;
 end;
 
 procedure TEditorForm.FormDestroy(Sender: TObject);
 var
        wp: TWindowPlacement;
 begin
+    FSambaTimer.Free;
+    
        //\8dÅ\91å\89»\81E\83E\83B\83\93\83h\83E\88Ê\92u\95Û\91
        wp.length := sizeof(wp);
        GetWindowPlacement(Handle, @wp);
@@ -654,8 +648,6 @@ begin
        //GikoSys.Setting.EditWindowStay := FormStyle = fsStayOnTop;      // \83X\83e\83C\8fó\91Ô\82Ì\95Û\91
        GikoSys.Setting.EditWindowTranslucent := TransAction.Checked;   // \94¼\93§\96¾\8fó\91Ô\82Ì\95Û\91
 
-       FGestures.Free;
-
 end;
 
 procedure TEditorForm.SetNameList(sName, sMail: string);