| 3078 |
if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then |
if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = Item.ThreadItem then |
| 3079 |
TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true; |
TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true; |
| 3080 |
end; |
end; |
| 3081 |
if GetActiveContent = Item.ThreadItem then |
if GikoSys.Setting.BrowserTabVisible then begin |
| 3082 |
InsertBrowserTab(Item.ThreadItem) |
if GetActiveContent = Item.ThreadItem then |
| 3083 |
else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then |
InsertBrowserTab(Item.ThreadItem) |
| 3084 |
InsertBrowserTab(Item.ThreadItem, True) |
else if (ListView.Selected <> nil ) and ( TObject(ListView.Selected.Data) is TThreadItem ) and ( Item.ThreadItem = TThreadItem(ListView.Selected.Data)) then |
| 3085 |
else |
InsertBrowserTab(Item.ThreadItem, True) |
| 3086 |
InsertBrowserTab(Item.ThreadItem, False); |
else |
| 3087 |
|
InsertBrowserTab(Item.ThreadItem, False); |
| 3088 |
|
end else begin |
| 3089 |
|
if (GetActiveContent = Item.ThreadItem) or (FActiveContent = nil) or(FActiveContent.Browser = BrowserNullTab.Browser) then |
| 3090 |
|
InsertBrowserTab(Item.ThreadItem); |
| 3091 |
|
end; |
| 3092 |
|
|
| 3093 |
if Item.State = gdsComplete then begin |
if Item.State = gdsComplete then begin |
| 3094 |
PlaySound('New'); |
PlaySound('New'); |
| 3359 |
i: Integer; |
i: Integer; |
| 3360 |
url: OleVariant; |
url: OleVariant; |
| 3361 |
idx: Integer; |
idx: Integer; |
| 3362 |
|
ThreadItem: TThreadItem; |
| 3363 |
|
Thread: TBrowserRecord; |
| 3364 |
|
tmpFlag: boolean; |
| 3365 |
begin |
begin |
| 3366 |
idx := BrowserTab.TabIndex; |
tmpFlag := SelectTimer.Enabled; |
| 3367 |
|
SelectTimer.Enabled := false; |
| 3368 |
|
Thread := inThread; |
| 3369 |
|
idx := BrowserTab.TabIndex; |
| 3370 |
if (FActiveContent <> nil) and |
if (FActiveContent <> nil) and |
| 3371 |
(FActiveContent.Thread <> inThread.Thread) and |
(FActiveContent.Thread <> Thread.Thread) and |
| 3372 |
(Assigned(FActiveContent.Browser.Document)) then begin |
(Assigned(FActiveContent.Browser.Document)) then begin |
| 3373 |
try |
try |
| 3374 |
try |
try |
| 3384 |
finally |
finally |
| 3385 |
end; |
end; |
| 3386 |
end; |
end; |
| 3387 |
if not (Assigned(inThread)) or (inThread.Thread = nil) then begin |
if not (Assigned(Thread)) or (Thread.Thread = nil) then begin |
| 3388 |
inThread.Browser.Navigate(BLANK_HTML); |
Thread.Browser.Navigate(BLANK_HTML); |
| 3389 |
BrowserBoardNameLabel.Caption := ''; |
BrowserBoardNameLabel.Caption := ''; |
| 3390 |
ItemBoardImage.Picture := nil; |
ItemBoardImage.Picture := nil; |
| 3391 |
BrowserNameLabel.Caption := ''; |
BrowserNameLabel.Caption := ''; |
| 3395 |
ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW); |
ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW); |
| 3396 |
FActiveContent := nil; |
FActiveContent := nil; |
| 3397 |
Exit; |
Exit; |
| 3398 |
end else if inThread.Browser = nil then begin |
end else if Thread.Browser = nil then begin |
| 3399 |
if FActiveContent.Browser = TWebBrowser(FBrowsers[4]) then |
if FActiveContent.Browser = TWebBrowser(FBrowsers[4]) then |
| 3400 |
FBrowsers.Move(4, 0); |
FBrowsers.Move(4, 0); |
| 3401 |
for i := BrowserTab.Tabs.Count - 1 downto 0 do begin |
for i := BrowserTab.Tabs.Count - 1 downto 0 do begin |
| 3408 |
break; |
break; |
| 3409 |
end; |
end; |
| 3410 |
end; |
end; |
| 3411 |
inThread.Browser := TWebBrowser(FBrowsers[4]); |
Thread.Browser := TWebBrowser(FBrowsers[4]); |
| 3412 |
FBrowsers.Move(4, 0); |
FBrowsers.Move(4, 0); |
| 3413 |
end; |
end; |
| 3414 |
|
ThreadItem := Thread.Thread; |
| 3415 |
BBSID := inThread.FThread.ParentBoard.BBSID; |
BBSID := ThreadItem.ParentBoard.BBSID; |
| 3416 |
FileName := inThread.FThread.FileName; |
FileName := ThreadItem.FileName; |
| 3417 |
|
|
| 3418 |
if GetCapture = ListView.Handle then |
if GetCapture = ListView.Handle then |
| 3419 |
ReleaseCapture; |
ReleaseCapture; |
| 3422 |
|
|
| 3423 |
|
|
| 3424 |
try |
try |
| 3425 |
if inThread.FThread.UnRead then begin |
if ThreadItem.UnRead then begin |
| 3426 |
inThread.FThread.ParentBoard.UnRead := inThread.FThread.ParentBoard.UnRead - 1; |
ThreadItem.ParentBoard.UnRead := ThreadItem.ParentBoard.UnRead - 1; |
| 3427 |
if inThread.FThread.ParentBoard.UnRead < 0 then inThread.FThread.ParentBoard.UnRead := 0; |
if ThreadItem.ParentBoard.UnRead < 0 then ThreadItem.ParentBoard.UnRead := 0; |
| 3428 |
TreeView.Refresh; |
TreeView.Refresh; |
| 3429 |
end; |
end; |
| 3430 |
LockWindowUpdate(Self.Handle); |
LockWindowUpdate(Self.Handle); |
| 3431 |
ShowWindow(inThread.FBrowser.Handle, SW_SHOW); |
if(FActiveContent <> nil) and (FActiveContent <> Thread) then begin |
| 3432 |
|
if (FActiveContent.Browser <> BrowserNullTab.Browser) then |
| 3433 |
|
ShowWindow(FActiveContent.Browser.Handle, SW_HIDE); |
| 3434 |
|
end; |
| 3435 |
|
ShowWindow(Thread.FBrowser.Handle, SW_SHOW); |
| 3436 |
LockWindowUpdate(0); |
LockWindowUpdate(0); |
| 3437 |
if (not Assigned(inThread.Browser.Document)) then begin |
if (not Assigned(Thread.Browser.Document)) then begin |
| 3438 |
inThread.Browser.Navigate('about:blank'); |
Thread.Browser.Navigate('about:blank'); |
| 3439 |
end; |
end; |
| 3440 |
while (inThread.Browser.ReadyState <> READYSTATE_COMPLETE) and |
FActiveContent := Thread; |
| 3441 |
(inThread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin |
while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and |
| 3442 |
|
(Thread.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin |
| 3443 |
Application.ProcessMessages; |
Application.ProcessMessages; |
| 3444 |
if idx <> BrowserTab.TabIndex then begin |
if idx <> BrowserTab.TabIndex then begin |
|
FActiveContent := inThread; |
|
|
//BrowserTab.OnChange(nil); |
|
| 3445 |
Exit; |
Exit; |
| 3446 |
end; |
end; |
|
|
|
| 3447 |
end; |
end; |
| 3448 |
if not (Assigned(inThread)) or not (Assigned(inThread.Thread)) then begin |
if not ThreadItem.IsLogFile then begin |
|
FActiveContent := nil; |
|
|
Exit; |
|
|
end; |
|
|
if not inThread.FThread.IsLogFile then begin |
|
| 3449 |
Caption := CAPTION_NAME ; |
Caption := CAPTION_NAME ; |
| 3450 |
try |
try |
| 3451 |
s := '<HTML><BODY><CENTER>このスレッドは取得していません</CENTER></BODY></HTML>'; |
s := '<HTML><BODY><CENTER>このスレッドは取得していません</CENTER></BODY></HTML>'; |
| 3452 |
doc := Idispatch( olevariant(inThread.Browser.ControlInterface).Document) as IHTMLDocument2; |
doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2; |
| 3453 |
doc.open; |
doc.open; |
| 3454 |
doc.charset := 'Shift_JIS'; |
doc.charset := 'Shift_JIS'; |
| 3455 |
doc.Write(s); |
doc.Write(s); |
| 3457 |
finally |
finally |
| 3458 |
end; |
end; |
| 3459 |
end else begin |
end else begin |
| 3460 |
Caption := CAPTION_NAME + ' - [' + inThread.Thread.Title + ']'; |
Caption := CAPTION_NAME + ' - [' + ThreadItem.Title + ']'; |
| 3461 |
//Thread.Repaintは、スキン等の設定を変更したとき、Threadをダウンロードしたとき |
//Thread.Repaintは、スキン等の設定を変更したとき、Threadをダウンロードしたとき |
| 3462 |
//新規にThreadを開いたときに真になっている。 |
//新規にThreadを開いたときに真になっている。 |
| 3463 |
if(inThread.Repaint) or (inThread.OnlyHundred <> GikoSys.OnlyAHundredRes)then begin |
if(Thread.Repaint) or (Thread.OnlyHundred <> GikoSys.OnlyAHundredRes)then begin |
| 3464 |
//Thread.LastSize := ThreadItem.Size; |
//Thread.LastSize := ThreadItem.Size; |
| 3465 |
inThread.Repaint := false; |
Thread.Repaint := false; |
| 3466 |
try |
try |
| 3467 |
doc := Idispatch( olevariant(inThread.Browser.ControlInterface).Document) as IHTMLDocument2; |
Thread.Browser.OnStatusTextChange := nil; |
| 3468 |
GikoSys.CreateHTML2(doc, inThread.FThread, sTitle); |
doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2; |
| 3469 |
|
GikoSys.CreateHTML2(doc, ThreadItem, sTitle); |
| 3470 |
|
// if (Assigned(Thread.Browser)) and (Thread.Browser <> nil) then |
| 3471 |
|
Thread.Browser.OnStatusTextChange := BrowserStatusTextChange; |
| 3472 |
//なぜかここで明示的にDocumentCompleteを呼ばないとうまくいかない |
//なぜかここで明示的にDocumentCompleteを呼ばないとうまくいかない |
| 3473 |
inThread.FBrowser.OnDocumentComplete(inThread.FBrowser, inThread.FBrowser.Parent, url); |
Thread.FBrowser.OnDocumentComplete(Thread.FBrowser, Thread.FBrowser.Parent, url); |
| 3474 |
inThread.OnlyHundred := GikoSys.OnlyAHundredRes; |
Thread.OnlyHundred := GikoSys.OnlyAHundredRes; |
| 3475 |
Application.ProcessMessages; |
Application.ProcessMessages; |
| 3476 |
//ここでApplication.ProcessMessagesを呼ぶことによってWebBrowserを更新させる。 |
//ここでApplication.ProcessMessagesを呼ぶことによってWebBrowserを更新させる。 |
| 3477 |
//相しないと一画面分しか描画できてないのでそれ以上のスクロール量を指定しても無効になる |
//相しないと一画面分しか描画できてないのでそれ以上のスクロール量を指定しても無効になる |
| 3478 |
// byもじゅ(2004/01/20) |
// byもじゅ(2004/01/20) |
| 3479 |
try |
try |
| 3480 |
if (Assigned(inThread)) and (Assigned(inThread.Thread))then begin |
if (Assigned(Thread)) and (Assigned(ThreadItem))then begin |
| 3481 |
if inThread.FThread.UnRead then |
if(Thread <> nil) and (ThreadItem <>nil) then begin |
| 3482 |
BrowserMovement('new', inThread) |
if ThreadItem.UnRead then |
| 3483 |
else if inThread.FThread.ScrollTop <> 0 then begin |
BrowserMovement('new', Thread) |
| 3484 |
try |
else if ThreadItem.ScrollTop <> 0 then begin |
| 3485 |
doc.Body.ScrollTop := inThread.FThread.ScrollTop; |
try |
| 3486 |
except |
doc.Body.ScrollTop := ThreadItem.ScrollTop; |
| 3487 |
on E: Exception do |
except |
| 3488 |
MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0); |
on E: Exception do |
| 3489 |
|
MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0); |
| 3490 |
|
end; |
| 3491 |
end; |
end; |
| 3492 |
end; |
end; |
| 3493 |
end else begin |
end else begin |
| 3504 |
// Application.ProcessMessages; |
// Application.ProcessMessages; |
| 3505 |
end; |
end; |
| 3506 |
end; |
end; |
| 3507 |
inThread.FThread.UnRead := False; |
ThreadItem.UnRead := False; |
| 3508 |
ListView.Refresh; |
ListView.Refresh; |
| 3509 |
end; |
end; |
| 3510 |
if(FActiveContent <> nil) and (FActiveContent <> inThread) then begin |
if (Assigned(Thread)) and (Assigned(Thread.Thread)) and (Thread <> nil) and (ThreadItem <>nil) then begin |
| 3511 |
if (FActiveContent.Browser <> BrowserNullTab.Browser) then |
//FActiveContent := Thread; |
|
ShowWindow(FActiveContent.Browser.Handle, SW_HIDE); |
|
|
end; |
|
|
if (Assigned(inThread)) and (Assigned(inThread.Thread)) then begin |
|
|
FActiveContent := inThread; |
|
| 3512 |
|
|
| 3513 |
BrowserBoardNameLabel.Caption := inThread.FThread.ParentBoard.Title; |
BrowserBoardNameLabel.Caption := ThreadItem.ParentBoard.Title; |
| 3514 |
ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap); |
ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap); |
| 3515 |
BrowserNameLabel.Caption := inThread.FThread.Title; |
BrowserNameLabel.Caption := ThreadItem.Title; |
| 3516 |
ItemImage.Picture := nil; |
ItemImage.Picture := nil; |
| 3517 |
if inThread.FThread.IsLogFile then |
if ThreadItem.IsLogFile then |
| 3518 |
if inThread.FThread.NewArrival then |
if ThreadItem.NewArrival then |
| 3519 |
ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap) |
ItemImageList.GetBitmap(2, ItemImage.Picture.Bitmap) |
| 3520 |
else |
else |
| 3521 |
ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap) |
ItemImageList.GetBitmap(0, ItemImage.Picture.Bitmap) |
| 3528 |
FActiveContent := nil; |
FActiveContent := nil; |
| 3529 |
end; |
end; |
| 3530 |
finally |
finally |
| 3531 |
|
SelectTimer.Enabled := tmpFlag; |
| 3532 |
Screen.Cursor := crDefault; |
Screen.Cursor := crDefault; |
| 3533 |
end; |
end; |
| 3534 |
end; |
end; |
| 3536 |
function TGikoForm.GetActiveContent: TThreadItem; |
function TGikoForm.GetActiveContent: TThreadItem; |
| 3537 |
begin |
begin |
| 3538 |
try |
try |
| 3539 |
if( Assigned(FActiveContent) ) and (Assigned(FActiveContent.Thread))then |
if( Assigned(FActiveContent) ) and (Assigned(FActiveContent.Thread)) |
| 3540 |
|
and (FActiveContent <> nil) and (FActiveContent.Thread <> nil) then |
| 3541 |
Result := FActiveContent.Thread |
Result := FActiveContent.Thread |
| 3542 |
else begin |
else begin |
| 3543 |
FActiveContent := nil; |
FActiveContent := nil; |
| 6141 |
// BrowserTopPanel.Height := 26; |
// BrowserTopPanel.Height := 26; |
| 6142 |
end; |
end; |
| 6143 |
BrowserTab.Show; |
BrowserTab.Show; |
| 6144 |
|
SelectTimer.Enabled := false; |
| 6145 |
end else begin |
end else begin |
| 6146 |
CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar); |
CoolBand := GetCoolBand(BrowserCoolBar, BrowserTabToolBar); |
| 6147 |
if CoolBand <> nil then |
if CoolBand <> nil then |
| 6149 |
BrowserBottomPanel.Visible := False; |
BrowserBottomPanel.Visible := False; |
| 6150 |
// BrowserTab.Visible := False; |
// BrowserTab.Visible := False; |
| 6151 |
// BrowserTopPanel.Height := 26; |
// BrowserTopPanel.Height := 26; |
| 6152 |
|
SelectTimer.Enabled := true; |
| 6153 |
NotSelectTabCloseAction.Execute; |
AllTabCloseAction.Execute; |
| 6154 |
end; |
end; |
| 6155 |
end; |
end; |
| 6156 |
|
|
| 10301 |
if not GikoSys.Setting.BrowserTabVisible then |
if not GikoSys.Setting.BrowserTabVisible then |
| 10302 |
if Item <> nil then |
if Item <> nil then |
| 10303 |
if (TObject( Item.Data ) is TThreadItem) then begin |
if (TObject( Item.Data ) is TThreadItem) then begin |
| 10304 |
if not SelectTimer.Enabled then begin |
SelectTimer.Tag := 0; |
|
SelectTimer.Tag := 0; |
|
|
SelectTimer.Enabled := True; |
|
|
end else begin |
|
|
SelectTimer.Tag := 0; |
|
|
SelectTimer.Enabled := false; |
|
|
SelectTimer.Enabled := True; |
|
|
end; |
|
| 10305 |
end; |
end; |
| 10306 |
|
|
| 10307 |
end; |
end; |
| 10311 |
if SelectTimer.Tag = 0 then |
if SelectTimer.Tag = 0 then |
| 10312 |
SelectTimer.Tag := 1 |
SelectTimer.Tag := 1 |
| 10313 |
else begin |
else begin |
| 10314 |
SelectTimer.Tag := 0; |
SelectTimer.Tag := 0; |
| 10315 |
SelectTimer.Enabled := False; |
if not (ListView.Selected = nil) then |
| 10316 |
ListClick; |
if( FActiveContent = nil) or (GetActiveContent <> TThreadItem(ListView.Selected.Data) ) then |
| 10317 |
|
ListClick; |
| 10318 |
end; |
end; |
| 10319 |
end; |
end; |
| 10320 |
|
|