ギコナビ
Revisión | 648ad6f41bb59a8b230922ca5f06052ee4bf6cd2 (tree) |
---|---|
Tiempo | 2007-05-15 07:02:43 |
Autor | h677 <h677> |
Commiter | h677 |
数字の右クリックでレスポップアップしないの不具合の修正
レスポップアップでタスクバーに追加されないように修正
レスポップアップが消えた後にアクティブなスレッドにフォーカスを移すように修正
@@ -1683,9 +1683,16 @@ begin | ||
1683 | 1683 | FEvent.Free; |
1684 | 1684 | |
1685 | 1685 | // TODO X|bvAbvÌjü |
1686 | + try | |
1687 | + if FPreviewBrowser <> nil then begin | |
1688 | + TOleControl(FPreviewBrowser).Parent := nil; | |
1689 | + FPreviewBrowser.Free; | |
1690 | + end; | |
1686 | 1691 | |
1692 | + except | |
1693 | + end; | |
1687 | 1694 | //Previewjü |
1688 | - if TPreviewBrowser <> nil then begin | |
1695 | + if FPreviewBrowser <> nil then begin | |
1689 | 1696 | FPreviewBrowser.Free; |
1690 | 1697 | FPreviewBrowser := nil; |
1691 | 1698 | end; |
@@ -4836,16 +4843,17 @@ begin | ||
4836 | 4843 | s := CustomStringReplace(Range.text, '@', ' ');//Spóð¼póÉ |
4837 | 4844 | s := ZenToHan(Trim(s)); |
4838 | 4845 | if GikoSys.IsNumeric(s) then begin |
4839 | - | |
4846 | + Num := StrToInt64(s); | |
4840 | 4847 | ThreadItem := GetActiveContent; |
4841 | - if ThreadItem <> nil then begin | |
4842 | - Num := StrToInt64(s); | |
4848 | + if (ThreadItem <> nil) and (Num <= ThreadItem.Count) | |
4849 | + and (Num > 0)then begin | |
4843 | 4850 | if (FResPopupBrowser = nil) then begin |
4844 | 4851 | FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); |
4845 | 4852 | ShowWindow(FResPopupBrowser.Handle, SW_HIDE); |
4846 | 4853 | end; |
4847 | - FResPopupBrowser.PopupType := gptThread; | |
4854 | + FResPopupBrowser.CreateNewBrowser.PopupType := gptThread; | |
4848 | 4855 | HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False); |
4856 | + FResPopupBrowser.Popup; | |
4849 | 4857 | Result := False; |
4850 | 4858 | end else |
4851 | 4859 | Result := True; |
@@ -12,7 +12,7 @@ uses | ||
12 | 12 | MSHTML_TLB, |
13 | 13 | {$IFEND} |
14 | 14 | ComCtrls, BrowserRecord, Graphics, Messages, Setting, Dialogs, |
15 | - ActiveX, MoveHistoryItem, HistoryList; | |
15 | + ActiveX, GikoSystem, MoveHistoryItem, HistoryList; | |
16 | 16 | |
17 | 17 | const |
18 | 18 | CAPTION_NAME: string = 'MRir'; |
@@ -49,6 +49,7 @@ const | ||
49 | 49 | |
50 | 50 | |
51 | 51 | type |
52 | + | |
52 | 53 | TGikoDM = class(TDataModule) |
53 | 54 | GikoFormActionList: TActionList; |
54 | 55 | OnlyAHundredResAction: TAction; |
@@ -487,7 +488,7 @@ implementation | ||
487 | 488 | |
488 | 489 | uses |
489 | 490 | Windows, Math, Clipbrd, |
490 | - Giko, GikoSystem, GikoUtil, BoardGroup, | |
491 | + Giko, GikoUtil, BoardGroup, | |
491 | 492 | FavoriteArrange, Favorite, MojuUtils, |
492 | 493 | Editor, ListSelect, Search, Option, Round, |
493 | 494 | KeySetting, Gesture, Kotehan, ToolBarSetting, |
@@ -62,16 +62,32 @@ begin | ||
62 | 62 | Visible := False; |
63 | 63 | Title := ''; |
64 | 64 | RawDocument := ''; |
65 | + FEvent := nil; | |
65 | 66 | end; |
66 | 67 | |
67 | 68 | destructor TResPopupBrowser.Destroy; |
68 | 69 | begin |
70 | + Self.OnEnter := nil; | |
71 | + Self.OnBeforeNavigate2 := nil; | |
72 | + Self.OnStatusTextChange := nil; | |
73 | + Self.OnNewWindow2 := nil; | |
74 | + if (FChild <> nil) then begin | |
75 | + FChild.Free; | |
76 | + FChild := nil; | |
77 | + end; | |
78 | + if (FEvent <> nil) then begin | |
79 | + FEvent.Free; | |
80 | + FEvent := nil; | |
81 | + end; | |
82 | + FThread := nil; | |
69 | 83 | inherited Destroy; |
70 | 84 | end; |
71 | 85 | |
72 | 86 | procedure TResPopupBrowser.CreateParams(var Params: TCreateParams); |
73 | 87 | begin |
74 | - inherited CreateParams(Params); | |
88 | + inherited; | |
89 | + Params.Style := Params.Style or WS_EX_TOOLWINDOW; | |
90 | + | |
75 | 91 | end; |
76 | 92 | function TResPopupBrowser.CreateNewBrowser: TResPopupBrowser; |
77 | 93 | begin |
@@ -84,13 +100,17 @@ begin | ||
84 | 100 | end; |
85 | 101 | end else begin |
86 | 102 | FChild := TResPopupBrowser.Create(Self); |
87 | - TOleControl(FChild).Parent := nil; | |
103 | + TOleControl(FChild).Parent := TOleControl(Self).Parent; | |
88 | 104 | FChild.ParentBrowser := Self; |
89 | 105 | FChild.NavigateBlank; |
106 | + | |
90 | 107 | FChild.OnEnter := GikoForm.BrowserEnter; |
91 | 108 | FChild.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2; |
92 | 109 | FChild.OnStatusTextChange := GikoForm.BrowserStatusTextChange; |
93 | 110 | FChild.OnNewWindow2 := GikoForm.BrowserNewWindow2; |
111 | + SetWindowPos(FChild.Handle, HWND_BOTTOM, | |
112 | + 0, 0, 0 , 0, | |
113 | + SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE or SWP_HIDEWINDOW); | |
94 | 114 | ShowWindow(FChild.Handle, SW_HIDE); |
95 | 115 | Result := FChild; |
96 | 116 | end; |
@@ -102,6 +122,9 @@ begin | ||
102 | 122 | Self.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2; |
103 | 123 | Self.OnStatusTextChange := GikoForm.BrowserStatusTextChange; |
104 | 124 | Self.OnNewWindow2 := GikoForm.BrowserNewWindow2; |
125 | + SetWindowPos(Self.Handle, HWND_BOTTOM, | |
126 | + 0, 0, 0 , 0, | |
127 | + SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE or SWP_HIDEWINDOW); | |
105 | 128 | Result := Self; |
106 | 129 | end; |
107 | 130 | end; |
@@ -131,46 +154,46 @@ begin | ||
131 | 154 | end; |
132 | 155 | procedure TResPopupBrowser.Write(ADocument: String; OnlyTitle: Boolean = False); |
133 | 156 | var |
157 | + p: TPoint; | |
134 | 158 | doc: Variant; |
135 | 159 | ARect: TRect; |
136 | 160 | FDispHtmlDocument: DispHTMLDocument; |
137 | 161 | begin |
138 | - Self.OnStatusTextChange := nil; | |
139 | 162 | try |
140 | - try | |
141 | - // ¢Á½ñk¬ | |
142 | - SetWindowPos(Self.Handle, HWND_TOP, | |
143 | - 0, 0, 50 , 50, | |
144 | - SWP_NOMOVE or SWP_NOACTIVATE or SWP_HIDEWINDOW); | |
163 | + // ^XNo[©çÁ· | |
164 | + SetWindowLongA(Self.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW); | |
165 | + GetCursorpos(p); | |
166 | + // ¢Á½ñk¬ | |
167 | + SetWindowPos(Self.Handle, HWND_BOTTOM, | |
168 | + p.X, p.Y, 50 , 50, | |
169 | + SWP_NOACTIVATE or SWP_HIDEWINDOW); | |
170 | + doc := Idispatch( olevariant(Self.ControlInterface).Document) as IHTMLDocument2; | |
171 | + doc.open; | |
172 | + doc.charset := 'Shift_JIS'; | |
173 | + doc.Write('<html><head>'#13#10 + | |
174 | + '<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'#13#10 | |
175 | + + GetBodyStyle(OnlyTitle) + '</head><body>' | |
176 | + + GetTitle(OnlyTitle) | |
177 | + + ADocument + '<a name="bottom"></a></body></html>'); | |
178 | + doc.Close; | |
145 | 179 | |
146 | - doc := Idispatch( olevariant(Self.ControlInterface).Document) as IHTMLDocument2; | |
147 | - doc.open; | |
148 | - doc.charset := 'Shift_JIS'; | |
149 | - doc.Write('<html><head>'#13#10 + | |
150 | - '<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">'#13#10 | |
151 | - + GetBodyStyle(OnlyTitle) + '</head><body>' | |
152 | - + GetTitle(OnlyTitle) | |
153 | - + ADocument + '<a name="bottom"></a></body></html>'); | |
154 | - doc.Close; | |
180 | + ARect := CalcRect(Screen.WorkAreaHeight, Screen.WorkAreaWidth, | |
181 | + not OnlyTitle); | |
155 | 182 | |
156 | - ARect := CalcRect(Screen.WorkAreaHeight, Screen.WorkAreaWidth, | |
157 | - not OnlyTitle); | |
158 | - SetWindowPos(Self.Handle, HWND_TOP, | |
159 | - ARect.Left, ARect.Top, | |
160 | - (ARect.Right - ARect.Left) , | |
161 | - (ARect.Bottom - ARect.Top), | |
162 | - SWP_NOACTIVATE or SWP_HIDEWINDOW); | |
163 | - FDispHtmlDocument := Idispatch(OleVariant(Self.ControlInterface).Document) as DispHTMLDocument; | |
164 | - FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2); | |
165 | - FEvent.OnClick := ResPopupBrowserClick; | |
166 | - ShowWindow(Self.Handle, SW_SHOWNOACTIVATE); | |
167 | - Self.Visible := True; | |
168 | - except | |
169 | - end; | |
170 | - finally | |
171 | - Self.OnStatusTextChange := GikoForm.BrowserStatusTextChange; | |
172 | - end; | |
183 | + FDispHtmlDocument := Idispatch(OleVariant(Self.ControlInterface).Document) as DispHTMLDocument; | |
184 | + FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2); | |
185 | + FEvent.OnClick := ResPopupBrowserClick; | |
186 | + | |
187 | + Self.Visible := True; | |
188 | + SetWindowPos(Self.Handle, HWND_TOP, | |
189 | + ARect.Left, ARect.Top, | |
190 | + (ARect.Right - ARect.Left) , | |
191 | + (ARect.Bottom - ARect.Top), | |
192 | + SWP_NOACTIVATE or SWP_HIDEWINDOW); | |
173 | 193 | |
194 | + ShowWindow(Self.Handle, SW_SHOWNOACTIVATE); | |
195 | + except | |
196 | + end; | |
174 | 197 | end; |
175 | 198 | function TResPopupBrowser.GetTitle(OnlyTitle: Boolean): string; |
176 | 199 | begin |
@@ -210,13 +233,24 @@ begin | ||
210 | 233 | end; |
211 | 234 | |
212 | 235 | procedure TResPopupBrowser.Clear; |
236 | +var | |
237 | + body: IHTMLElement2; | |
213 | 238 | begin |
214 | 239 | ChildClear; |
215 | 240 | if (Self.Visible) then begin |
241 | + try | |
242 | + if (Self.ParentBrowser = nil) then begin | |
243 | + body := (Idispatch( olevariant(GikoForm.ActiveContent.Browser | |
244 | + .ControlInterface).Document) as IHTMLDocument2).body as IHTMLElement2; | |
245 | + body.focus; | |
246 | + end; | |
247 | + except | |
248 | + end; | |
216 | 249 | Self.Title := ''; |
217 | 250 | Self.RawDocument := ''; |
218 | 251 | Self.FThread := nil; |
219 | 252 | FEvent.Free; |
253 | + FEvent := nil; | |
220 | 254 | NavigateBlank; |
221 | 255 | ShowWindow(Self.Handle, SW_HIDE); |
222 | 256 | Self.Visible := False; |
@@ -306,7 +340,16 @@ begin | ||
306 | 340 | end; |
307 | 341 | end; |
308 | 342 | function TResPopupBrowser.ResPopupBrowserClick(Sender: TObject): WordBool; |
343 | +var | |
344 | + doc: IHTMLDocument2; | |
345 | + body: IHTMLElement2; | |
309 | 346 | begin |
347 | +// doc := Idispatch( olevariant( | |
348 | +// GikoForm.ActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2; | |
349 | + doc := Idispatch( olevariant( | |
350 | + Self.ControlInterface).Document) as IHTMLDocument2; | |
351 | + body := (doc.body as IHTMLElement2); | |
352 | + body.focus; | |
310 | 353 | Result := True; |
311 | 354 | end; |
312 | 355 | function TResPopupBrowser.GetThread: TThreadItem; |