OSDN Git Service

close #16779
authorh677 <h677>
Sun, 17 May 2009 04:28:00 +0000 (04:28 +0000)
committerh677 <h677>
Sun, 17 May 2009 04:28:00 +0000 (04:28 +0000)
リンク履歴の戻る/進むで、キー設定でshift/ctrlを設定するとうまく動作しない不具合の修正。
MoveToURLを利用しているが、もともとの使い方として、shift/ctrlが押されているときはブラウザで開く機能があり、
アクションのショートカットキーとかぶるため動作しないので、アクションから呼び出すときは、shift/ctrlを
無視するように修正した。

Giko.pas
GikoDataModule.pas

index 2b5ac3e..04bb3fd 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -717,7 +717,7 @@ type
                BrowserNullTab: TBrowserRecord;
                FControlThread: TThreadControl;
         FIconData : TNotifyIconData;
-               procedure MoveToURL(const inURL: string);
+               procedure MoveToURL(const inURL: string; KeyMask: Boolean = False);
                function InsertBrowserTab(ThreadItem: TThreadItem; ActiveTab: Boolean = True) : TBrowserRecord;
                procedure ReloadBBS;
                function GetHttpState: Boolean;
@@ -4701,7 +4701,7 @@ begin
        end;
 end;
 
-procedure TGikoForm.MoveToURL(const inURL: string);
+procedure TGikoForm.MoveToURL(const inURL: string; KeyMask: Boolean = False);
 var
        protocol, host, path, document, port, bookmark : string;
        URL, protocol2, host2, path2, document2, port2, bookmark2 : string;
@@ -4718,17 +4718,18 @@ begin
 
        GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark );
        GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey );
-
-
-       shiftDown       := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
-       ctrlDown        := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
-       if shiftDown then begin
-               GikoSys.OpenBrowser(inURL, gbtUserApp);
-               Exit;
-       end else if ctrlDown then begin
-               GikoSys.OpenBrowser(inURL, gbtIE);
-               Exit;
-       end;
+    // \83A\83N\83V\83\87\83\93\82©\82ç\8cÄ\82Î\82ê\82é\82Æshift/ctrl\82Í\82¨\82µ\82Á\82Ï\82Ì\8fê\8d\87\82ª\82Ù\82Æ\82ñ\82Ç\82È\82Ì\82Å\83}\83X\83N\82·\82é
+    if not KeyMask then begin
+        shiftDown      := GetAsyncKeyState(VK_SHIFT) = Smallint($8001);
+        ctrlDown       := GetAsyncKeyState(VK_CONTROL) = Smallint($8001);
+        if shiftDown then begin
+            GikoSys.OpenBrowser(inURL, gbtUserApp);
+            Exit;
+        end else if ctrlDown then begin
+            GikoSys.OpenBrowser(inURL, gbtIE);
+            Exit;
+        end;
+    end;
 
        //===== \83v\83\89\83O\83C\83\93
        try
index 952d1df..30456e9 100644 (file)
@@ -476,7 +476,7 @@ type
        procedure ClearSelectComboBox;
     procedure ClearMailAllEditor();
     procedure ClearNameTextAllEditor();
-    procedure MoveURLWithHistory(URL : String);
+    procedure MoveURLWithHistory(URL : String; KeyMask: Boolean = False);
     procedure BackToHistory(item: TMoveHistoryItem);
     function GetActiveThreadLinks : IHTMLElementCollection;
     procedure GetLinkURLs(links : IHTMLElementCollection;
@@ -4143,17 +4143,17 @@ begin
             end;
         end else begin
             //URL\82É\88Ú\93®
-            MoveURLWithHistory(item.ThreadItem.URL);
+            MoveURLWithHistory(item.ThreadItem.URL, True);
         end;
     end;
 end;
 //! \97\9a\97ð\8f\88\97\9d\82Â\82«URL\88Ú\93®
-procedure TGikoDM.MoveURLWithHistory(URL : String);
+procedure TGikoDM.MoveURLWithHistory(URL : String; KeyMask: Boolean = False);
 var
     idx : Integer;
 begin
     //URL\82É\88Ú\93®
-    GikoForm.MoveToURL(URL);
+    GikoForm.MoveToURL(URL, KeyMask);
     //\88È\89º\81A\97\9a\97ð\82Ì\8f\88\97\9d
     idx := GikoForm.AddressComboBox.Items.IndexOf(URL);
     if idx = -1 then begin