• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

ギコナビ


Commit MetaInfo

Revision13337ef9e1f1168799d2935fbff106a32f3e95db (tree)
Time2009-05-05 20:32:22
Authorh677 <h677>
Commiterh677

Log Message

close #16508
画像プレビューをダブルクリックで消せるように対応。
プレビューウィンドウを消すメッセージをレスポップアップと共通化した。

Change Summary

Incremental Difference

--- a/Giko.pas
+++ b/Giko.pas
@@ -24,8 +24,7 @@ uses
2424 const
2525 NGWORDNAME_PANEL = 3;
2626 THREADSIZE_PANEL = 2;
27- USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser
28-
27+ USER_POPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser
2928 type
3029
3130 TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser);
@@ -4918,12 +4917,16 @@ begin
49184917 senderBrowser := TWebBrowser( Message.WParam );
49194918 BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url );
49204919 end;
4921- USER_RESPOPUPCLEAR:
4920+ USER_POPUPCLEAR:
49224921 if (TObject(Message.WParam) is TResPopupBrowser) then begin
49234922 try
49244923 TResPopupBrowser( Message.WParam ).Clear;
49254924 except
49264925 end;
4926+ end else if (TObject(Message.WParam) is TPreviewBrowser) then begin
4927+ if FPreviewBrowser <> nil then begin
4928+ ShowWindow(FPreviewBrowser.Handle, SW_HIDE);
4929+ end;
49274930 end;
49284931 end;
49294932
--- a/Preview.pas
+++ b/Preview.pas
@@ -3,17 +3,23 @@ unit Preview;
33 interface
44 uses
55 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
6- ActiveX,
6+ ActiveX, OleCtrls, HTMLDocumentEvent,
77 {$IF Defined(DELPRO) }
8- SHDocVw
8+ SHDocVw,
9+ MSHTML
910 {$ELSE}
10- SHDocVw_TLB
11+ SHDocVw_TLB,
12+ MSHTML_TLB
1113 {$IFEND}
1214 ;
1315 type
1416 TPreviewBrowser = class(TWebBrowser)
1517 private
18+ FEvent: THTMLDocumentEventSink;//ƒuƒ‰ƒEƒUƒhƒLƒ…ƒƒ“ƒgƒCƒxƒ“ƒg
1619 function makeHTML(const URL, Host, Document : String): String;
20+ procedure BrowserDocumentComplete(Sender: TObject;
21+ const pDisp: IDispatch; var URL: OleVariant);
22+ function PreviewDbClick(Sender: TObject): WordBool;
1723 protected
1824 procedure CreateParams(var Params: TCreateParams); override;
1925 public
@@ -24,7 +30,7 @@ type
2430 end;
2531
2632 implementation
27-uses MojuUtils, GikoSystem, Setting;
33+uses MojuUtils, GikoSystem, Setting, Giko;
2834
2935 const
3036 //ƒvƒŒƒrƒ…[ƒtƒ@ƒCƒ‹–¼
@@ -37,10 +43,15 @@ const
3743 constructor TPreviewBrowser.Create(AOwner: TComponent);
3844 begin
3945 inherited Create(AOwner);
46+ FEvent := nil;
47+ OnDocumentComplete := BrowserDocumentComplete;
4048 end;
4149
4250 destructor TPreviewBrowser.Destroy;
4351 begin
52+ if (FEvent <> nil) then begin
53+ FreeAndNil(FEvent);
54+ end;
4455 inherited Destroy;
4556 end;
4657
@@ -201,4 +212,25 @@ begin
201212 + '</body></html>';
202213 end;
203214 end;
215+//! ƒhƒLƒ…ƒƒ“ƒgŠ®—¹ƒCƒxƒ“ƒg
216+procedure TPreviewBrowser.BrowserDocumentComplete(Sender: TObject;
217+ const pDisp: IDispatch; var URL: OleVariant);
218+begin
219+ if (URL <> 'about:blank') then begin
220+ FEvent := THTMLDocumentEventSink.Create(Self, Self.OleObject.Document,
221+ HTMLDocumentEvents2);
222+ FEvent.OnDoubleClick := PreviewDbClick;
223+ end else begin
224+ if (FEvent <> nil) then begin
225+ FreeAndNil(FEvent);
226+ end;
227+ end;
228+end;
229+function TPreviewBrowser.PreviewDbClick(Sender: TObject): WordBool;
230+begin
231+ // Ž©•ª‚ÅŽ©•ª‚͏Á‚¹‚È‚¢‚̂ŁAƒƒbƒZ[ƒWŒo—R‚ŏÁ‚µ‚Ä‚à‚炤
232+ PostMessage( GikoForm.Handle , USER_POPUPCLEAR, Integer( Self ), 0 );
233+ Result := True;
234+end;
235+
204236 end.
--- a/ResPopupBrowser.pas
+++ b/ResPopupBrowser.pas
@@ -462,7 +462,7 @@ begin
462462 // ƒMƒRƒiƒr‚̃tƒH[ƒJƒX‚ð’D‚Á‚Ä‚é‚̂ŃtƒH[ƒ€‚É–³—‚â‚è•Ô‚·
463463 Blur;
464464 // Ž©•ª‚ÅŽ©•ª‚͏Á‚¹‚È‚¢‚̂ŁAƒƒbƒZ[ƒWŒo—R‚ŏÁ‚µ‚Ä‚à‚炤
465- PostMessage( GikoForm.Handle , USER_RESPOPUPCLEAR, Integer( Self ), 0 );
465+ PostMessage( GikoForm.Handle , USER_POPUPCLEAR, Integer( Self ), 0 );
466466 Result := True;
467467 end;
468468 initialization