ギコナビ
Revision | db2b41b32b051445bbb74dd1e870f1d8ba239936 (tree) |
---|---|
Zeit | 2007-05-16 01:38:20 |
Autor | h677 <h677> |
Commiter | h677 |
スレポップアップ中でクリックすると、レスポップアップしなくなる不具合対応
@@ -684,6 +684,8 @@ type | ||
684 | 684 | procedure AddMenuSameBoardThread; |
685 | 685 | //! ANeBuÈ^uƯ¶ÂÌJ¢Ä¢éXbhNbNCxg |
686 | 686 | procedure SameBoardThreadSubItemOnClick(Sender: TObject); |
687 | + //! |bvAbvuEUì¬ | |
688 | + procedure CreateResPopupBrowser; | |
687 | 689 | protected |
688 | 690 | procedure CreateParams(var Params: TCreateParams); override; |
689 | 691 | procedure WndProc(var Message: TMessage); override; |
@@ -1684,9 +1686,9 @@ begin | ||
1684 | 1686 | |
1685 | 1687 | // TODO X|bvAbvÌjü |
1686 | 1688 | try |
1687 | - if FPreviewBrowser <> nil then begin | |
1688 | - TOleControl(FPreviewBrowser).Parent := nil; | |
1689 | - FPreviewBrowser.Free; | |
1689 | + if FResPopupBrowser <> nil then begin | |
1690 | + TOleControl(FResPopupBrowser).Parent := nil; | |
1691 | + FResPopupBrowser.Free; | |
1690 | 1692 | end; |
1691 | 1693 | |
1692 | 1694 | except |
@@ -1920,9 +1922,11 @@ begin | ||
1920 | 1922 | ShowWindow(FPreviewBrowser.Handle, SW_HIDE); |
1921 | 1923 | |
1922 | 1924 | if FResPopupBrowser <> nil then begin |
1923 | - if not(Sender is TResPopupBrowser) then | |
1924 | - FResPopupBrowser.Clear | |
1925 | - else begin | |
1925 | + if not(Sender is TResPopupBrowser) then begin | |
1926 | + if (FResPopupBrowser.Visible) then begin | |
1927 | + FResPopupBrowser.Clear; | |
1928 | + end; | |
1929 | + end else begin | |
1926 | 1930 | TResPopupBrowser(Sender).ChildClear; |
1927 | 1931 | end; |
1928 | 1932 | end; |
@@ -1958,10 +1962,7 @@ begin | ||
1958 | 1962 | p.y := p.y - TWebBrowser(Sender).ClientOrigin.y; |
1959 | 1963 | e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y); |
1960 | 1964 | if (Assigned(e)) then begin |
1961 | - if (FResPopupBrowser = nil) then begin | |
1962 | - FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); | |
1963 | - ShowWindow(FResPopupBrowser.Handle, SW_HIDE); | |
1964 | - end; | |
1965 | + CreateResPopupBrowser; | |
1965 | 1966 | tmp2 := ZenToHan(e.Get_outerText); |
1966 | 1967 | if (GikoSys.IsNumeric(tmp2)) then begin |
1967 | 1968 | //ÍXÔÁÛ¢Á·B |
@@ -2027,19 +2028,13 @@ begin | ||
2027 | 2028 | wkIntSt := 1; |
2028 | 2029 | wkIntTo := 1; |
2029 | 2030 | end; |
2030 | - if (FResPopupBrowser = nil) then begin | |
2031 | - FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); | |
2032 | - ShowWindow(FResPopupBrowser.Handle, SW_HIDE); | |
2033 | - end; | |
2031 | + CreateResPopupBrowser; | |
2034 | 2032 | FResPopupBrowser.CreateNewBrowser.PopupType := gptThread; |
2035 | 2033 | HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst ); |
2036 | 2034 | end; |
2037 | 2035 | end; |
2038 | 2036 | end; |
2039 | - if (FResPopupBrowser = nil) then begin | |
2040 | - FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); | |
2041 | - ShowWindow(FResPopupBrowser.Handle, SW_HIDE); | |
2042 | - end; | |
2037 | + CreateResPopupBrowser; | |
2043 | 2038 | if FResPopupBrowser.CreateNewBrowser.PopupType = gptRaw then begin |
2044 | 2039 | if FResPopupBrowser.CreateNewBrowser.Title <> '' then begin |
2045 | 2040 | FResPopupBrowser.CreateNewBrowser.TitlePopup; |
@@ -4652,7 +4647,9 @@ end; | ||
4652 | 4647 | |
4653 | 4648 | procedure TGikoForm.BrowserEnter(Sender: TObject); |
4654 | 4649 | begin |
4655 | - Browser.DoObjectVerb(OLEIVERB_UIACTIVATE); | |
4650 | + if (Sender is TWebBrowser) then begin | |
4651 | + TWebBrowser(Sender).DoObjectVerb(OLEIVERB_UIACTIVATE); | |
4652 | + end; | |
4656 | 4653 | end; |
4657 | 4654 | |
4658 | 4655 | procedure TGikoForm.WMCopyData(var Message: TWMCopyData); |
@@ -4847,10 +4844,7 @@ begin | ||
4847 | 4844 | ThreadItem := GetActiveContent; |
4848 | 4845 | if (ThreadItem <> nil) and (Num <= ThreadItem.Count) |
4849 | 4846 | and (Num > 0)then begin |
4850 | - if (FResPopupBrowser = nil) then begin | |
4851 | - FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); | |
4852 | - ShowWindow(FResPopupBrowser.Handle, SW_HIDE); | |
4853 | - end; | |
4847 | + CreateResPopupBrowser; | |
4854 | 4848 | FResPopupBrowser.CreateNewBrowser.PopupType := gptThread; |
4855 | 4849 | HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False); |
4856 | 4850 | FResPopupBrowser.Popup; |
@@ -7550,6 +7544,14 @@ begin | ||
7550 | 7544 | |
7551 | 7545 | end; |
7552 | 7546 | end; |
7547 | +//! |bvAbvuEUì¬ | |
7548 | +procedure TGikoForm.CreateResPopupBrowser; | |
7549 | +begin | |
7550 | + if (FResPopupBrowser = nil) then begin | |
7551 | + FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); | |
7552 | + //ShowWindow(FResPopupBrowser.Handle, SW_HIDE); | |
7553 | + end; | |
7554 | +end; | |
7553 | 7555 | |
7554 | 7556 | initialization |
7555 | 7557 | OleInitialize(nil); |
@@ -58,11 +58,13 @@ uses MojuUtils, GikoSystem, Setting, Giko, GikoDataModule; | ||
58 | 58 | constructor TResPopupBrowser.Create(AOwner: TComponent); |
59 | 59 | begin |
60 | 60 | inherited Create(AOwner); |
61 | - FChild := nil; | |
61 | + TOleControl(Self).Parent := nil; | |
62 | 62 | Visible := False; |
63 | + FChild := nil; | |
63 | 64 | Title := ''; |
64 | 65 | RawDocument := ''; |
65 | 66 | FEvent := nil; |
67 | + ShowWindow(Self.Handle, SW_HIDE); | |
66 | 68 | end; |
67 | 69 | |
68 | 70 | destructor TResPopupBrowser.Destroy; |
@@ -100,25 +102,19 @@ begin | ||
100 | 102 | end; |
101 | 103 | end else begin |
102 | 104 | FChild := TResPopupBrowser.Create(Self); |
103 | - TOleControl(FChild).Parent := TOleControl(Self).Parent; | |
104 | 105 | FChild.ParentBrowser := Self; |
105 | 106 | FChild.NavigateBlank; |
106 | - | |
107 | - FChild.OnEnter := GikoForm.BrowserEnter; | |
108 | 107 | FChild.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2; |
109 | 108 | FChild.OnStatusTextChange := GikoForm.BrowserStatusTextChange; |
110 | 109 | FChild.OnNewWindow2 := GikoForm.BrowserNewWindow2; |
111 | 110 | SetWindowPos(FChild.Handle, HWND_BOTTOM, |
112 | 111 | 0, 0, 0 , 0, |
113 | 112 | SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE or SWP_HIDEWINDOW); |
114 | - ShowWindow(FChild.Handle, SW_HIDE); | |
115 | 113 | Result := FChild; |
116 | 114 | end; |
117 | 115 | end else begin |
118 | - TOleControl(Self).Parent := nil; | |
119 | 116 | FParentBrowser := nil; |
120 | 117 | Self.NavigateBlank; |
121 | - Self.OnEnter := GikoForm.BrowserEnter; | |
122 | 118 | Self.OnBeforeNavigate2 := GikoForm.BrowserBeforeNavigate2; |
123 | 119 | Self.OnStatusTextChange := GikoForm.BrowserStatusTextChange; |
124 | 120 | Self.OnNewWindow2 := GikoForm.BrowserNewWindow2; |
@@ -158,8 +154,11 @@ var | ||
158 | 154 | doc: Variant; |
159 | 155 | ARect: TRect; |
160 | 156 | FDispHtmlDocument: DispHTMLDocument; |
157 | + mainActive: Boolean; | |
161 | 158 | begin |
162 | 159 | try |
160 | + mainActive := GikoForm.Active; | |
161 | + | |
163 | 162 | // ^XNo[©çÁ· |
164 | 163 | SetWindowLongA(Self.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW); |
165 | 164 | GetCursorpos(p); |
@@ -175,8 +174,10 @@ begin | ||
175 | 174 | + GetBodyStyle(OnlyTitle) + '</head><body>' |
176 | 175 | + GetTitle(OnlyTitle) |
177 | 176 | + ADocument + '<a name="bottom"></a></body></html>'); |
177 | + | |
178 | 178 | doc.Close; |
179 | 179 | |
180 | + | |
180 | 181 | ARect := CalcRect(Screen.WorkAreaHeight, Screen.WorkAreaWidth, |
181 | 182 | not OnlyTitle); |
182 | 183 |
@@ -185,13 +186,16 @@ begin | ||
185 | 186 | FEvent.OnClick := ResPopupBrowserClick; |
186 | 187 | |
187 | 188 | Self.Visible := True; |
188 | - SetWindowPos(Self.Handle, HWND_TOP, | |
189 | + SetWindowPos(Self.Handle, HWND_TOPMOST, | |
189 | 190 | ARect.Left, ARect.Top, |
190 | 191 | (ARect.Right - ARect.Left) , |
191 | 192 | (ARect.Bottom - ARect.Top), |
192 | 193 | SWP_NOACTIVATE or SWP_HIDEWINDOW); |
193 | 194 | |
194 | 195 | ShowWindow(Self.Handle, SW_SHOWNOACTIVATE); |
196 | + if mainActive <> GikoForm.Active then begin | |
197 | + GikoForm.SetFocus; | |
198 | + end; | |
195 | 199 | except |
196 | 200 | end; |
197 | 201 | end; |
@@ -233,19 +237,9 @@ begin | ||
233 | 237 | end; |
234 | 238 | |
235 | 239 | procedure TResPopupBrowser.Clear; |
236 | -var | |
237 | - body: IHTMLElement2; | |
238 | 240 | begin |
239 | 241 | ChildClear; |
240 | 242 | 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; | |
249 | 243 | Self.Title := ''; |
250 | 244 | Self.RawDocument := ''; |
251 | 245 | Self.FThread := nil; |
@@ -340,16 +334,11 @@ begin | ||
340 | 334 | end; |
341 | 335 | end; |
342 | 336 | function TResPopupBrowser.ResPopupBrowserClick(Sender: TObject): WordBool; |
343 | -var | |
344 | - doc: IHTMLDocument2; | |
345 | - body: IHTMLElement2; | |
346 | 337 | 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; | |
338 | + if (not GikoSys.Setting.UnActivePopup) then begin | |
339 | + // MRirÌtH[JXðDÁÄéÌÅtH[ɳâèÔ· | |
340 | + GikoForm.SetFocus; | |
341 | + end; | |
353 | 342 | Result := True; |
354 | 343 | end; |
355 | 344 | function TResPopupBrowser.GetThread: TThreadItem; |