OSDN Git Service

マウスジェスチャーの見直し
authorh677 <h677>
Thu, 14 Feb 2008 16:20:15 +0000 (16:20 +0000)
committerh677 <h677>
Thu, 14 Feb 2008 16:20:15 +0000 (16:20 +0000)
スレッドダウンロードの各イベントの最初に、フォーム破棄の最中は
なにもせずに脱出する記述追加

Giko.pas

index 20f8445..165dd09 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -1290,22 +1290,14 @@ begin
        dummy1.Caption  := ItemReservPMenu.Caption;
        dummy1.Hint     := ItemReservPMenu.Hint;
 
        dummy1.Caption  := ItemReservPMenu.Caption;
        dummy1.Hint     := ItemReservPMenu.Hint;
 
+    // \83}\83E\83X\83W\83F\83X\83`\83\83\81[
+    MouseGesture := TMouseGesture.Create;
+
 {$IFDEF SPAM_FILTER_ENABLED}
        // \83X\83p\83\80\83t\83B\83\8b\83^\8aw\8fK\97\9a\97ð
        GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
 {$ENDIF}
 
 {$IFDEF SPAM_FILTER_ENABLED}
        // \83X\83p\83\80\83t\83B\83\8b\83^\8aw\8fK\97\9a\97ð
        GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName );
 {$ENDIF}
 
-       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[
-       MouseGesture := TMouseGesture.Create;
-       GikoSys.Setting.Gestures.LoadGesture(
-               GikoSys.Setting.GetGestureFileName, GikoDM.GikoFormActionList );
-       MouseGesture.Margin := GikoSys.Setting.Gestures.Margin;
-       MouseGesture.OnGestureStart := OnGestureStart;
-       MouseGesture.OnGestureMove := OnGestureMove;
-       MouseGesture.OnGestureEnd := OnGestureEnd;
-       if GikoSys.Setting.GestureEnabled then
-               MouseGesture.SetHook( Handle );
-
        //2ch\8c¾\8cê\93Ç\82Ý\8fo\82µ
        GikoSys.SetGikoMessage;
 
        //2ch\8c¾\8cê\93Ç\82Ý\8fo\82µ
        GikoSys.SetGikoMessage;
 
@@ -1550,8 +1542,12 @@ begin
     GikoDM.CloseAllEditorAction.Execute;
 
        Application.UnhookMainWindow(Hook);
     GikoDM.CloseAllEditorAction.Execute;
 
        Application.UnhookMainWindow(Hook);
-    //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fI\97¹\82Ì\91O\82É\83_\83E\83\93\83\8d\81[\83h\83X\83\8c\83b\83h\82É\90³\8fí\8fI\97¹\82ð\91£\82· 
-    FControlThread.Terminate;
+    //\83A\83v\83\8a\83P\81[\83V\83\87\83\93\8fI\97¹\82Ì\91O\82É\83_\83E\83\93\83\8d\81[\83h\83X\83\8c\83b\83h\82É\90³\8fí\8fI\97¹\82ð\91£\82·
+    try
+        FControlThread.Terminate;
+        FControlThread.WaitFor;
+    except
+    end;
        Application.Terminate;
 end;
 
        Application.Terminate;
 end;
 
@@ -1570,8 +1566,7 @@ begin
         end;
         MouseGesture.Clear;
                MouseGesture.UnHook;
         end;
         MouseGesture.Clear;
                MouseGesture.UnHook;
-    //    MouseGesture.Free;    // Free \82·\82é\82Æ\82¢\82¯\82È\82¢\81H
-    //    MouseGesture := nil;
+        MouseGesture.Free;
        except
        end;
        try
        except
        end;
        try
@@ -1707,13 +1702,8 @@ begin
         end;
 
        try
         end;
 
        try
-               try
-                       FControlThread.Terminate;
-                       FControlThread.WaitFor;
-               except
-               end;
-       finally
-               FControlThread.Free;
+        FControlThread.Free;
+       except
        end;
     // \83v\83\89\83O\83C\83\93\82É\82æ\82Á\82Ä\92Ç\89Á\82³\82ê\82½\83\81\83j\83\85\81[\82ð\8aJ\95ú\82·\82é
     for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
        end;
     // \83v\83\89\83O\83C\83\93\82É\82æ\82Á\82Ä\92Ç\89Á\82³\82ê\82½\83\81\83j\83\85\81[\82ð\8aJ\95ú\82·\82é
     for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin
@@ -2453,6 +2443,8 @@ begin
 end;
 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
 begin
 end;
 procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
 begin
+    if csDestroying in Self.ComponentState then
+        Exit;
        AddMessageList(Msg, nil, Icon);
 end;
 // *************************************************************************
        AddMessageList(Msg, nil, Icon);
 end;
 // *************************************************************************
@@ -2467,6 +2459,8 @@ var
        Res : TResRec;
 begin
        try
        Res : TResRec;
 begin
        try
+        if csDestroying in Self.ComponentState then
+               Exit;
                if Item.DownType = gdtBoard then
                        ATitle := Item.Board.Title
                else
                if Item.DownType = gdtBoard then
                        ATitle := Item.Board.Title
                else
@@ -2608,6 +2602,9 @@ procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWork
 begin
 //     SetProgressValue(Number, 0, AWorkCountMax);
 //     ProgressBar.Visible := True;
 begin
 //     SetProgressValue(Number, 0, AWorkCountMax);
 //     ProgressBar.Visible := True;
+    if csDestroying in Self.ComponentState then
+        Exit;
+
        ProgressBar.Position := 0;
        ProgressBar.Max := AWorkCountMax;
        FDownloadTitle := AWorkTitle;
        ProgressBar.Position := 0;
        ProgressBar.Max := AWorkCountMax;
        FDownloadTitle := AWorkTitle;
@@ -2617,6 +2614,8 @@ end;
 
 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
 begin
 
 procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer);
 begin
+    if csDestroying in Self.ComponentState then
+        Exit;
        ProgressBar.Position := 0;
        if FDownloadMax <> 0 then
                StatusBar.Panels[1].Text := FDownloadTitle + ' - \83_\83E\83\93\83\8d\81[\83h\82ª\8a®\97¹\82µ\82Ü\82µ\82½';
        ProgressBar.Position := 0;
        if FDownloadMax <> 0 then
                StatusBar.Panels[1].Text := FDownloadTitle + ' - \83_\83E\83\93\83\8d\81[\83h\82ª\8a®\97¹\82µ\82Ü\82µ\82½';
@@ -2624,6 +2623,8 @@ end;
 
 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
 begin
 
 procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer);
 begin
+    if csDestroying in Self.ComponentState then
+        Exit;
        ProgressBar.Position := AWorkCount;
 //     SetProgressValue(Number, AWorkCount);
        StatusBar.Panels[1].Text := FDownloadTitle + ' - \83_\83E\83\93\83\8d\81[\83h\92\86 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
        ProgressBar.Position := AWorkCount;
 //     SetProgressValue(Number, AWorkCount);
        StatusBar.Panels[1].Text := FDownloadTitle + ' - \83_\83E\83\93\83\8d\81[\83h\92\86 (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')';
@@ -7844,4 +7845,5 @@ initialization
 finalization
                                OleUninitialize;
 
 finalization
                                OleUninitialize;
 
+
 end.
 end.