OSDN Git Service

メインウィンドウとエディタの両方にジェスチャーが設定されていると AV を起こしてしまうバグを修正。
authoryoffy <yoffy>
Wed, 13 Oct 2004 23:53:22 +0000 (23:53 +0000)
committeryoffy <yoffy>
Wed, 13 Oct 2004 23:53:22 +0000 (23:53 +0000)
Editor.pas
Giko.pas

index 679c57b..ffda144 100644 (file)
@@ -16,7 +16,8 @@ uses
        GikoSystem, GikoUtil, ImgList, Clipbrd, BoardGroup,
        IdAntiFreezeBase,       IdAntiFreeze, IdBaseComponent, IdComponent,
        IdTCPConnection, IdTCPClient, IdHTTP, ActnList, StdActns, IdIntercept,
-       IdLogBase, IdLogDebug, IdException, DateUtils, MojuUtils, bmRegExp;
+       IdLogBase, IdLogDebug, IdException, DateUtils, MojuUtils, bmRegExp,
+       GestureModel;
 
 type
 //     TSetLayeredWindowAttributes = function(wnd: HWND; crKey: DWORD; bAlpha: BYTE; dwFlag: DWORD): Boolean; stdcall;
@@ -177,6 +178,7 @@ type
                FSambaTime: TDateTime;
                FHost: string;
                FNow: TDateTime;
+               FGestures       : TGestureModel;
                procedure Preview;
                function RepHtml(s: string): string;
                function Check: Boolean;
@@ -403,6 +405,9 @@ begin
        // \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 := TGestureModel.Create;
+               FGestures.LoadGesture(
+                       GikoSys.Setting.GetGestureFileName, ActionList );
                MouseGesture.OnGestureStart := OnGestureStart;
                MouseGesture.OnGestureMove := OnGestureMove;
                MouseGesture.OnGestureEnd := OnGestureEnd;
@@ -677,6 +682,8 @@ 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);
@@ -1880,11 +1887,11 @@ var
 begin
        s := MouseGesture.GetGestureStr;
        ActStr := '';
-       Action := GikoSys.Setting.Gestures.GetGestureAction(s);
+       Action := FGestures.GetGestureAction(s);
        if Action <> nil then
                ActStr := '\81i' + Action.Caption + '\81j';
        s := '\83W\83F\83X\83`\83\83\81[: ' + s + ActStr;
-       StatusBar.Panels[2].Text := s;
+       StatusBar.Panels[0].Text := s;
 end;
 
 procedure TEditorForm.OnGestureEnd(Sender: TObject);
@@ -1893,10 +1900,10 @@ var
        Action: TAction;
 begin
        s := MouseGesture.GetGestureStr;
-       Action := GikoSys.Setting.Gestures.GetGestureAction(s);
+       Action := FGestures.GetGestureAction(s);
        if Action <> nil then
                Action.Execute;
-       StatusBar.Panels[2].Text := '';
+       StatusBar.Panels[0].Text := '';
 end;
 
 procedure TEditorForm.ShowBoardHead(ABoard: TBoard; AMemo: TMemo);
index 38cdc33..03adc5a 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -1936,10 +1936,9 @@ var
 begin
 //     Application.OnDeactivate := nil;
 //     Self.OnDeactivate := nil;
-       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\95Û\91
+       // \83}\83E\83X\83W\83F\83X\83`\83\83\81[\8aJ\95ú
        try
                MouseGesture.UnHook;
-               GikoSys.Setting.Gestures.SaveGesture( GikoSys.Setting.GetGestureFileName );
        except
        end;
        try
@@ -6967,9 +6966,11 @@ var
 begin
        Dlg := TKeySettingForm.Create(Self);
        try
-               if Dlg.ShowModal = mrOk then
+               if Dlg.ShowModal = mrOk then begin
                        GikoSys.SaveKeySetting(ActionList);
-            GikoSys.SaveEditorKeySetting(Dlg.EditorForm.ActionList);
+                       GikoSys.Setting.Gestures.SaveGesture( GikoSys.Setting.GetGestureFileName );
+               end;
+               GikoSys.SaveEditorKeySetting(Dlg.EditorForm.ActionList);
        finally
                Dlg.Release;
                MouseGesture.UnHook;