ギコナビ
Revision | e7e2b5dfd4b937977fe4a8e9b043312436cd2ebe (tree) |
---|---|
Time | 2007-05-14 02:38:44 |
Author | h677 <h677> |
Commiter | h677 |
レスポップアップ中のメニューのアクションを、そのスレッドで動作するように拡張
@@ -159,7 +159,7 @@ object GikoForm: TGikoForm | ||
159 | 159 | object ToolBar1: TToolBar |
160 | 160 | Left = 2 |
161 | 161 | Top = 4 |
162 | - Width = 15 | |
162 | + Width = 16 | |
163 | 163 | Height = 18 |
164 | 164 | Align = alNone |
165 | 165 | AutoSize = True |
@@ -971,7 +971,7 @@ object GikoForm: TGikoForm | ||
971 | 971 | OnResize = AddressToolBarResize |
972 | 972 | object AddressComboBox: TComboBox |
973 | 973 | Left = 0 |
974 | - Top = 0 | |
974 | + Top = 1 | |
975 | 975 | Width = 177 |
976 | 976 | Height = 20 |
977 | 977 | DropDownCount = 20 |
@@ -2209,6 +2209,9 @@ begin | ||
2209 | 2209 | |
2210 | 2210 | Cancel := True; |
2211 | 2211 | GetCursorpos(p); |
2212 | + KokoPopupMenu.PopupComponent := nil; | |
2213 | + if (Sender is TComponent) then | |
2214 | + KokoPopupMenu.PopupComponent := TComponent(Sender); | |
2212 | 2215 | KokoPopupMenu.Tag := StrToInt(sNo); |
2213 | 2216 | KokoPopupMenu.Popup(p.x, p.y); |
2214 | 2217 | end else if Pos('mailto', LowerCase(URL)) <> 0 then begin |
@@ -2846,9 +2849,13 @@ end; | ||
2846 | 2849 | function TGikoForm.GetActiveContent: TThreadItem; |
2847 | 2850 | begin |
2848 | 2851 | try |
2849 | - if FActiveContent <> nil then | |
2850 | - Result := FActiveContent.Thread | |
2851 | - else | |
2852 | + if FActiveContent <> nil then begin | |
2853 | + Result := FActiveContent.Thread; | |
2854 | + if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then | |
2855 | + if (FResPopupBrowser.CurrentBrowser.Thread <> nil) then begin | |
2856 | + Result := FResPopupBrowser.CurrentBrowser.Thread; | |
2857 | + end; | |
2858 | + end else | |
2852 | 2859 | Result := nil; |
2853 | 2860 | except |
2854 | 2861 | Result := nil; |
@@ -7110,7 +7117,6 @@ begin | ||
7110 | 7117 | if Assigned(firstElement) then |
7111 | 7118 | if firstElement.style.visibility <> 'hidden' then |
7112 | 7119 | firstElement.style.visibility := 'hidden'; |
7113 | - | |
7114 | 7120 | end; |
7115 | 7121 | |
7116 | 7122 | procedure TGikoForm.RepaintAllTabsBrowser(); |
@@ -1282,13 +1282,15 @@ begin | ||
1282 | 1282 | |
1283 | 1283 | Hint.Title := ''; |
1284 | 1284 | Hint.RawDocument := ''; |
1285 | - | |
1285 | + Hint.Thread := nil; | |
1286 | + | |
1286 | 1287 | //^Cg\¦ |
1287 | 1288 | if Title then |
1288 | 1289 | if ThreadItem <> nil then |
1289 | 1290 | Hint.Title := ThreadItem.Title; |
1290 | 1291 | |
1291 | 1292 | if ThreadItem <> nil then begin |
1293 | + Hint.Thread := ThreadItem; | |
1292 | 1294 | ResLink.FBbs := ThreadItem.ParentBoard.BBSID; |
1293 | 1295 | ResLink.FKey := ChangeFileExt(ThreadItem.FileName, ''); |
1294 | 1296 | //if ThreadItem.IsBoardPlugInAvailable then begin |
@@ -2,7 +2,7 @@ unit ResPopupBrowser; | ||
2 | 2 | interface |
3 | 3 | uses |
4 | 4 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, |
5 | - ActiveX, OleCtrls, {HintWindow,} | |
5 | + ActiveX, OleCtrls, {HintWindow,} HTMLDocumentEvent, BoardGroup, | |
6 | 6 | {$IF Defined(DELPRO) } |
7 | 7 | SHDocVw, |
8 | 8 | MSHTML |
@@ -22,10 +22,14 @@ type | ||
22 | 22 | FTitle :String; |
23 | 23 | FRawDocument: String; |
24 | 24 | FPopupType: TGikoPopupType; |
25 | + FEvent: THTMLDocumentEventSink;//uEUhL gCxg | |
26 | + FThread: TThreadItem; | |
25 | 27 | function GetBodyStyle(OnlyTitle: Boolean = False): string; |
26 | 28 | function GetWindowHeight : Integer; |
27 | 29 | function GetTitle(OnlyTitle: Boolean): string; |
28 | 30 | function CalcRect(MaxHeight: Integer; MaxWidth: Integer; Scroll: Boolean): TRect; |
31 | + function ResPopupBrowserClick(Sender: TObject): WordBool; | |
32 | + function GetThread: TThreadItem; | |
29 | 33 | protected |
30 | 34 | procedure CreateParams(var Params: TCreateParams); override; |
31 | 35 | public |
@@ -35,6 +39,7 @@ type | ||
35 | 39 | property ParentBrowser:TResPopupBrowser read FParentBrowser write FParentBrowser; |
36 | 40 | property Title: String read FTitle write FTitle; |
37 | 41 | property RawDocument: String read FRawDocument write FRawDocument; |
42 | + property Thread: TThreadItem read GetThread write FThread; | |
38 | 43 | function CreateNewBrowser: TResPopupBrowser; |
39 | 44 | function CurrentBrowser: TResPopupBrowser; |
40 | 45 | procedure Write(ADocument: String; OnlyTitle: Boolean = False); |
@@ -47,7 +52,7 @@ type | ||
47 | 52 | end; |
48 | 53 | |
49 | 54 | implementation |
50 | -uses MojuUtils, GikoSystem, Setting, Giko; | |
55 | +uses MojuUtils, GikoSystem, Setting, Giko, GikoDataModule; | |
51 | 56 | |
52 | 57 | |
53 | 58 | constructor TResPopupBrowser.Create(AOwner: TComponent); |
@@ -103,7 +108,7 @@ end; | ||
103 | 108 | function TResPopupBrowser.CurrentBrowser: TResPopupBrowser; |
104 | 109 | begin |
105 | 110 | Result := Self.CreateNewBrowser; |
106 | - if (Result.Parent <> nil) then | |
111 | + if (Result.ParentBrowser <> nil) then | |
107 | 112 | Result := Result.ParentBrowser; |
108 | 113 | end; |
109 | 114 | procedure TResPopupBrowser.NavigateBlank; |
@@ -128,6 +133,7 @@ procedure TResPopupBrowser.Write(ADocument: String; OnlyTitle: Boolean = False); | ||
128 | 133 | var |
129 | 134 | doc: Variant; |
130 | 135 | ARect: TRect; |
136 | + FDispHtmlDocument: DispHTMLDocument; | |
131 | 137 | begin |
132 | 138 | Self.OnStatusTextChange := nil; |
133 | 139 | try |
@@ -154,7 +160,9 @@ begin | ||
154 | 160 | (ARect.Right - ARect.Left) , |
155 | 161 | (ARect.Bottom - ARect.Top), |
156 | 162 | SWP_NOACTIVATE or SWP_HIDEWINDOW); |
157 | - | |
163 | + FDispHtmlDocument := Idispatch(OleVariant(Self.ControlInterface).Document) as DispHTMLDocument; | |
164 | + FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2); | |
165 | + FEvent.OnClick := ResPopupBrowserClick; | |
158 | 166 | ShowWindow(Self.Handle, SW_SHOWNOACTIVATE); |
159 | 167 | Self.Visible := True; |
160 | 168 | except |
@@ -207,6 +215,8 @@ begin | ||
207 | 215 | if (Self.Visible) then begin |
208 | 216 | Self.Title := ''; |
209 | 217 | Self.RawDocument := ''; |
218 | + Self.FThread := nil; | |
219 | + FEvent.Free; | |
210 | 220 | NavigateBlank; |
211 | 221 | ShowWindow(Self.Handle, SW_HIDE); |
212 | 222 | Self.Visible := False; |
@@ -295,4 +305,23 @@ begin | ||
295 | 305 | except |
296 | 306 | end; |
297 | 307 | end; |
308 | +function TResPopupBrowser.ResPopupBrowserClick(Sender: TObject): WordBool; | |
309 | +begin | |
310 | + Result := True; | |
311 | +end; | |
312 | +function TResPopupBrowser.GetThread: TThreadItem; | |
313 | +begin | |
314 | + Result := nil; | |
315 | + if (FThread <> nil) then begin | |
316 | + try | |
317 | + // ³øÈ|C^¸ | |
318 | + if (FThread.ParentBoard <> nil) then begin | |
319 | + Result := FThread | |
320 | + end; | |
321 | + except | |
322 | + //³øÈ|C^¾Á½ | |
323 | + Result := nil; | |
324 | + end; | |
325 | + end; | |
326 | +end; | |
298 | 327 | end. |