OSDN Git Service

レスポップアップウィンドウ上でのダブルクリックで、
authorh677 <h677>
Sun, 26 Aug 2007 13:00:41 +0000 (13:00 +0000)
committerh677 <h677>
Sun, 26 Aug 2007 13:00:41 +0000 (13:00 +0000)
レスポップアップウィンドウを閉じるようにした。

Giko.pas
HTMLDocumentEvent.pas
ResPopupBrowser.pas

index 7c4ee0b..9dc545a 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -24,7 +24,8 @@ uses
 const
        NGWORDNAME_PANEL = 3;
        THREADSIZE_PANEL = 2;
-       
+    USER_RESPOPUPCLEAR         = WM_USER + 2005;       ///< wParam : TWebBrowser
+       
 type
 
        TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
@@ -4794,6 +4795,13 @@ begin
                                senderBrowser := TWebBrowser( Message.WParam );
                                BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url );
                        end;
+        USER_RESPOPUPCLEAR:
+            if (TObject(Message.WParam) is TResPopupBrowser) then begin
+                try
+                               TResPopupBrowser( Message.WParam ).Clear;
+                except
+                end;
+                       end;
                end;
 
                inherited;
index 596a33a..20f65fb 100644 (file)
@@ -18,6 +18,7 @@ type
                FOnClick: TDocumentContextMenuEvent;
                FOnMouseMove: TDocumentContextMenuEvent;
                FOnMouseDown: TDocumentContextMenuEvent;
+               FOnDoubleClick: TDocumentContextMenuEvent;
        protected
                { IUnknown }
                function QueryInterface(const IID:TGUID; out Obj): HRESULT; stdcall;
@@ -37,6 +38,7 @@ type
                property OnClick: TDocumentContextMenuEvent read FOnClick write FOnClick;
                property OnMouseMove: TDocumentContextMenuEvent read FOnMouseMove write FOnMouseMove;
                property OnMouseDown: TDocumentContextMenuEvent read FOnMouseDown write FOnMouseDown;
+               property OnDoubleClick: TDocumentContextMenuEvent read FOnDoubleClick write FOnDoubleClick;
        end;
 
 implementation
@@ -100,6 +102,10 @@ begin
                if Assigned(FOnClick) then begin
                        PVariant(VarResult)^ := FOnClick(FOwner);
                end;
+       DISPID_DBLCLICK:
+               if Assigned(FOnDoubleClick) then begin
+                       PVariant(VarResult)^ := FOnDoubleClick(FOwner);
+               end;
        1023:
                if Assigned(FOnContextMenu) then begin
                        PVariant(VarResult)^ := FOnContextMenu(FOwner);
index 11fd7ad..4ae2fe7 100644 (file)
@@ -29,6 +29,7 @@ type
         function GetTitle(OnlyTitle: Boolean): string;
                function CalcRect(WorkArea: TRect; Scroll: Boolean): TRect;
         function ResPopupBrowserClick(Sender: TObject): WordBool;
+        function ResPopupBrowserDbClick(Sender: TObject): WordBool;
         function GetThread: TThreadItem;
        protected
                procedure CreateParams(var Params: TCreateParams); override;
@@ -185,7 +186,7 @@ begin
         FDispHtmlDocument := Idispatch(OleVariant(Self.ControlInterface).Document) as DispHTMLDocument;
         FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2);
         FEvent.OnClick := ResPopupBrowserClick;
-
+        FEvent.OnDoubleClick := ResPopupBrowserDbClick;
         Self.Visible := True;
         SetWindowPos(Self.Handle, HWND_TOPMOST,
             ARect.Left, ARect.Top,
@@ -443,7 +444,14 @@ begin
     FOleInPlaceActiveObject := Self.ControlInterface as IOleInPlaceActiveObject;
     FOleInPlaceActiveObject.OnFrameWindowActivate(False);
 end;
-
+function TResPopupBrowser.ResPopupBrowserDbClick(Sender: TObject): WordBool;
+begin
+    // \83M\83R\83i\83r\82Ì\83t\83H\81[\83J\83X\82ð\92D\82Á\82Ä\82é\82Ì\82Å\83t\83H\81[\83\80\82É\96³\97\9d\82â\82è\95Ô\82·
+    Blur;
+    // \8e©\95ª\82Å\8e©\95ª\82Í\8fÁ\82¹\82È\82¢\82Ì\82Å\81A\83\81\83b\83Z\81[\83W\8co\97R\82Å\8fÁ\82µ\82Ä\82à\82ç\82¤
+    PostMessage( GikoForm.Handle , USER_RESPOPUPCLEAR, Integer( Self ), 0 );
+    Result := True;
+end;
 initialization
     OleInitialize(nil);