X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Giko.pas;h=d601fa0dbcb56362dafd65baffec2fa9d19fe429;hb=refs%2Fheads%2Fmaster;hp=92bb4b2699a28b1b6ad247b561980d78a2818a49;hpb=1d2b1e5c0da2720cca034cfee141d036dac302ab;p=gikonavigoeson%2Fgikonavi.git diff --git a/Giko.pas b/Giko.pas index 92bb4b2..d601fa0 100644 --- a/Giko.pas +++ b/Giko.pas @@ -19,13 +19,12 @@ uses {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager, ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection, IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem, - ShellAPI,Preview, HistoryList, ResPopupBrowser; + ShellAPI,Preview, HistoryList, ResPopupBrowser, ExtPreviewDatamodule; const NGWORDNAME_PANEL = 3; THREADSIZE_PANEL = 2; - USER_RESPOPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser - + USER_POPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser type TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser); @@ -85,6 +84,7 @@ type ToolMenu: TMenuItem; Find1: TMenuItem; RoundMenu: TMenuItem; + Search1: TMenuItem; MMSep04: TMenuItem; OptionMenu: TMenuItem; HelpMenu: TMenuItem; @@ -193,10 +193,6 @@ type ListToolBar: TToolBar; BrowserCoolBar: TGikoCoolBar; BrowserToolBar: TToolBar; - ToolButton3: TToolButton; - ToolButton9: TToolButton; - ToolButton11: TToolButton; - ToolButton5: TToolButton; ListNameToolBar: TToolBar; ListNameLabel: TLabel; FolderImage: TImage; @@ -311,7 +307,6 @@ type F4: TMenuItem; N48: TMenuItem; T14: TMenuItem; - ToolButton16: TToolButton; N50: TMenuItem; A11: TMenuItem; S5: TMenuItem; @@ -347,7 +342,6 @@ type FavoriteTreeLogDeletePopupMenu: TMenuItem; N59: TMenuItem; FavoriteTreeNameURLCopyPopupMenu: TMenuItem; - ToolButton20: TToolButton; N60: TMenuItem; ExportFavoriteFileAction1: TMenuItem; N6: TMenuItem; @@ -400,7 +394,6 @@ type N73: TMenuItem; SelectComboBoxPanel: TPanel; SelectComboBoxSplitter: TImage; - ToolButton1: TToolButton; N74: TMenuItem; WikiFAQ: TMenuItem; GikoApplicationEvents: TApplicationEvents; @@ -424,8 +417,22 @@ type IDNG1: TMenuItem; IDNG2: TMenuItem; ResPopupClearTimer: TTimer; + TaskTrayPopupMenu: TPopupMenu; + Exit1: TMenuItem; + N83: TMenuItem; + UpdateGikonaviAction1: TMenuItem; + N84: TMenuItem; + N85: TMenuItem; + URL2: TMenuItem; + URLPATHINFO1: TMenuItem; + URLQUERYSTRING1: TMenuItem; + N86: TMenuItem; + K4: TMenuItem; + WikiFAQ1: TMenuItem; + ThrNGEdit: TMenuItem; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); + procedure SaveSettingAll(); procedure BrowserStatusTextChange(Sender: TObject; const Text: WideString); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); @@ -610,6 +617,10 @@ type FPreviewBrowserRect: TRect; ///< ƒvƒŒƒrƒ…[‚Ì•\Ž¦ˆÊ’u‚ð‹L‰¯‚·‚é FActionListGroupIndexes: array of Integer; /// '') then begin - PostMessage( Handle, USER_DOCUMENTCOMPLETE, Integer( FActiveContent.Browser ), 0 ); if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin - Application.ProcessMessages; + // ƒƒbƒZ[ƒW‚ðŽó‚¯Žæ‚ç‚È‚¢‚悤‚ɃXƒŠ[ƒv‚ɕύX + Sleep(1); end; end; item := BBSsFindThreadFromURL( GikoSys.Setting.LastCloseTabURL ); + GikoSys.Setting.LastCloseTabURL := ''; if (item <> nil) and (item.IsLogFile) then begin OpenThreadItem(item, item.URL); end; - GikoSys.Setting.LastCloseTabURL := ''; + //ShowWindow(Self.Handle, SW_SHOW); end; end; - //ActionList‚ÌGroupIndex‚ðŒ³‚É–ß‚· - SetGroupIndex(GikoDM.GikoFormActionList); +//===== ƒ}ƒ‹ƒ`ƒ‚ƒjƒ^ŠÂ‹«‚ÅFormCreate‚ł̓tƒH[ƒ€ˆÊ’u‚ª³‚µ‚­”½‰f‚³‚ê‚È‚¢ê‡ +//===== ‚ª‚ ‚邽‚ßFormShow‰‰ñ‚ōÀ•WÝ’è‚ðs‚¤ + Top := GikoSys.Setting.WindowTop; + Left := GikoSys.Setting.WindowLeft; + Height := GikoSys.Setting.WindowHeight; + Width := GikoSys.Setting.WindowWidth; + + //ƒEƒBƒ“ƒhƒE‚ª‰æ–ÊŠO‚È‚ç‰æ–Ê“à‚Ɉړ®‚·‚é + Right := Left + Width; + Bottom := Top + Height; + MonOk := False; + MonCnt := 0; + while (MonCnt < Screen.MonitorCount) do begin + MonR := Screen.Monitors[MonCnt].Left + Screen.Monitors[MonCnt].Width; + MonB := Screen.Monitors[MonCnt].Top + Screen.Monitors[MonCnt].Height; + + if ((Left >= Screen.Monitors[MonCnt].Left) and (Left < MonR) and + (Top >= Screen.Monitors[MonCnt].Top) and (Top < MonB) and + (Right > Screen.Monitors[MonCnt].Left) and (Right <= MonR) and + (Bottom > Screen.Monitors[MonCnt].Top) and (Bottom <= MonB)) then begin + MonOk := True; + Break; + end; + + MonCnt := MonCnt + 1; + end; + + if (MonOk = False) then begin + Left := 0; + Top := 0; + end; - FStartUp := false; + if GikoSys.Setting.WindowMax then + WindowState := wsMaximized; +//========================================================================== end; end; @@ -1526,6 +1613,8 @@ begin Exit; end; + g_AppTerminated := True; + GikoSys.Setting.LastCloseTabURL := ''; if GikoSys.Setting.TabAutoLoadSave then begin GikoDM.TabsSaveAction.Execute; @@ -1538,40 +1627,47 @@ begin if (SearchDialog <> nil) then begin if (SearchDialog.Visible) then begin SearchDialog.Close; - try - SearchDialog.Release; - except - end; - SearchDialog := nil; end; + try + SearchDialog.Release; + except + end; + SearchDialog := nil; end; //ƒXƒNƒŠ[ƒ“ã‚Ì‘S‚ẴtƒH[ƒ€‚©‚çAEditorForm‚ð•Â‚¶‚é GikoDM.CloseAllEditorAction.Execute; Application.UnhookMainWindow(Hook); + //ƒAƒvƒŠƒP[ƒVƒ‡ƒ“I—¹‚Ì‘O‚Ƀ_ƒEƒ“ƒ[ƒhƒXƒŒƒbƒh‚ɐ³íI—¹‚𑣂· + FControlThread.DownloadAbort; + FControlThread.Terminate; + + //OnDestory‚¾‚ƍċN“®‚ð‚©‚¯‚½‚Æ‚«‚È‚Ç‚É•Û‘¶‚³‚ê‚È‚¢‚Ì‚ÅOnCloseQuery‚Őݒè•Û‘¶ + SaveSettingAll(); + Application.Terminate; end; -procedure TGikoForm.FormDestroy(Sender: TObject); +procedure TGikoForm.SaveSettingAll(); var - i : Integer; wp : TWindowPlacement; - tmpBool : Boolean; + WindowPlacement: TWindowPlacement; begin - // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJ•ú try - MouseGesture.Clear; - MouseGesture.UnHook; - // MouseGesture.Free; // Free ‚·‚é‚Æ‚¢‚¯‚È‚¢H - // MouseGesture := nil; + GikoDM.SaveThreadSearchSetting; except end; + try ActiveListColumnSave; except end; + try + WindowPlacement.length := SizeOf(TWindowPlacement); + GetWindowPlacement(Self.Handle, @WindowPlacement); + //Å‘剻EƒEƒBƒ“ƒhƒEˆÊ’u•Û‘¶ wp.length := sizeof(wp); GetWindowPlacement(Handle, @wp); @@ -1579,8 +1675,8 @@ begin GikoSys.Setting.WindowLeft := wp.rcNormalPosition.Left; GikoSys.Setting.WindowHeight := wp.rcNormalPosition.Bottom - wp.rcNormalPosition.Top; GikoSys.Setting.WindowWidth := wp.rcNormalPosition.Right - wp.rcNormalPosition.Left; - GikoSys.Setting.WindowMax := WindowState = wsMaximized; - + GikoSys.Setting.WindowMax := (WindowState = wsMaximized) or + (WindowPlacement.flags = WPF_RESTORETOMAXIMIZED); GikoSys.Setting.ListStyle := ListView.ViewStyle; GikoSys.Setting.CabinetVisible := GikoDM.CabinetVisibleAction.Checked; GikoSys.Setting.CabinetWidth := CabinetPanel.Width; @@ -1600,21 +1696,13 @@ begin GikoSys.Setting.ResRange := FResRangeMenuSelect; except end; - if WindowState <> wsNormal then - WindowState := wsNormal; - SaveCoolBarSettings; - try - GikoSys.Setting.WriteWindowSettingFile; - GikoSys.Setting.WriteNameMailSettingFile; - except - end; - // ƒŠƒAƒ‹ƒ^ƒCƒ€‚É•Û‘¶‚³‚ê‚é‚̂ŁA‚Ü‚½AƒEƒBƒ“ƒhƒEƒTƒCƒY‚ª CoolBar ‚æ‚è - // ¬‚³‚­‚È‚Á‚Ä‚¢‚é‚Æ‚«‚É•Û‘¶‚·‚é‚Æ’l‚ªã‘‚«‚³‚ê‚Ä‚µ‚Ü‚¤‚Ì‚Å‚±‚±‚Å‚Í•Û‘¶‚µ‚È‚¢ - - // ªFormDestroy’†‚Ɉړ®‚µ‚½‚̂ŁA‚±‚±‚Å•Û‘¶‚µ‚È‚¢‚Æ‚¢‚¯‚È‚¢‚ÆŽv‚¤Bi‚à‚¶‚ã@2004/04/09j - // CoolBar •Û‘¶ - //if (GikoForm.WindowState <> wsMinimized) and (GikoForm.WindowState <> wsMaximized) then - + //¡‚Ìwinodw‚̃Xƒ^ƒCƒ‹‚ÅCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ + SaveCoolBarSettings; + GikoSys.Setting.WriteWindowSettingFile; + // –¼‘O‚ƃ[ƒ‹‚Ì•Û‘¶‚Ȃ̂ŃGƒfƒBƒ^‚ª•Â‚¶‚½Œã‚È‚ç‚¢‚Â‚Å‚à‚¢‚¢ + GikoSys.Setting.WriteNameMailSettingFile; + // –`Œ¯‚̏‘‚Ì•Û‘¶ + GikoSys.Setting.WriteBoukenSettingFile; //“ü—̓AƒVƒXƒg‹@\‚̐ݒè‚Ì•Û‘¶ InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName); @@ -1625,10 +1713,71 @@ begin if not (FavoriteDM.AbEnd) then begin FavoriteDM.WriteFavorite; end; + except + end; + + //ƒAƒhƒŒƒX—š—ð•Û‘¶ + try + //AddressHistoryDM‚ÍŽ©“®¶¬ƒtƒH[ƒ€‚Ȃ̂ŁA‰ð•ú‚ÍŽ©“®“I‚É‚³‚ê‚éB + AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount); + except + end; + + //ƒqƒXƒgƒŠƒŠƒXƒg•Û‘¶ + try + FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml'); + except + end; + + //„‰ñƒŠƒXƒg•Û‘¶ + try + RoundList.SaveRoundFile; + except + end; + + // ƒ^ƒXƒNƒgƒŒƒC‚̃AƒCƒRƒ“íœ + if (FIconData.uID <> 0) then begin + Shell_NotifyIcon(NIM_DELETE, @FIconData); + end; + +end; + +procedure TGikoForm.FormDestroy(Sender: TObject); +var + i : Integer; + tmpBool : Boolean; +begin + //ˆêŽž“I‚ɒʏíƒXƒ^ƒCƒ‹‚É–ß‚µ‚ÄCoolBar‚̈ʒuAƒEƒBƒ“ƒhƒE‚̈ʒu‚ð•Û‘¶ + //¦’ˆÓFOnDestroy‚ÅŽg‚¤‚±‚Æ‚µ‚©l—¶‚³‚ê‚Ä‚¢‚È‚¢ + // ‘¼‚Å‚â‚é‚ƍĕ`‰æ‚ª”­¶‚·‚é + if WindowState <> wsNormal then begin + WindowState := wsNormal; + try + SaveCoolBarSettings; + GikoSys.Setting.WriteWindowSettingFile; + except + end; + end; + + // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJ•ú + try + if GikoSys.Setting.GestureEnabled then begin + MouseGesture.OnGestureStart := nil; + MouseGesture.OnGestureMove := nil; + MouseGesture.OnGestureEnd := nil; + end; + MouseGesture.Clear; + MouseGesture.UnHook; + MouseGesture.Free; + except + end; + + //‚¨‹C‚É“ü‚è”jŠü + try FavoriteDM.Clear; except end; - //LockWindowUpdate(Self.Handle); + try //ƒ^ƒuƒNƒ[ƒY tmpBool := GikoSys.Setting.ShowDialogForAllTabClose; @@ -1637,8 +1786,14 @@ begin GikoSys.Setting.ShowDialogForAllTabClose := tmpBool; except end; + try for i := FBrowsers.Count - 1 downto 0 do begin + GikoSys.ShowRefCount('browser' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface); + GikoSys.ShowRefCount('document' + IntToStr(i), TWebBrowser(FBrowsers[i]).ControlInterface.Document); + end; + + for i := FBrowsers.Count - 1 downto 0 do begin TWebBrowser(FBrowsers[i]).Free; end; FBrowsers.Clear; @@ -1646,6 +1801,7 @@ begin finally FBrowsers.Free; end; + try if BrowserNullTab <> nil then begin BrowserNullTab.Browser := nil; {*BrowserNullTab‚ÌBrowser‚͐݌vŽž‚É“\‚è•t‚¯‚Ä‚é“z @@ -1664,18 +1820,6 @@ begin except end; - //ƒAƒhƒŒƒX—š—ð•Û‘¶ - try - //AddressHistoryDM‚ÍŽ©“®¶¬ƒtƒH[ƒ€‚Ȃ̂ŁA‰ð•ú‚ÍŽ©“®“I‚É‚³‚ê‚éB - AddressHistoryDM.WriteHistory(AddressComboBox.Items, GikoSys.Setting.MaxRecordCount); - except - end; - - //ƒqƒXƒgƒŠƒŠƒXƒg•Û‘¶ - try - FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml'); - except - end; try try FHistoryList.Clear; @@ -1685,11 +1829,7 @@ begin FHistoryList.Free; end; - //„‰ñƒŠƒXƒg•Û‘¶&”jŠü - try - RoundList.SaveRoundFile; - except - end; + try try RoundList.Clear; @@ -1700,13 +1840,14 @@ begin end; try - try - FControlThread.Terminate; - FControlThread.WaitFor; - except - end; - finally - FControlThread.Free; + try + //FControlThread.DownloadAbort; + FControlThread.Terminate; + FControlThread.WaitFor; + except + end; + finally + FControlThread.Free; end; // ƒvƒ‰ƒOƒCƒ“‚É‚æ‚Á‚ĒljÁ‚³‚ꂽƒƒjƒ…[‚ðŠJ•ú‚·‚é for i := GikoForm.PlugInMenu.Count - 1 downto 0 do begin @@ -1729,9 +1870,12 @@ begin BBSs[ i ].Free; BBSs[ i ] := nil; end; + DestorySpecialBBS(BoardGroup.SpecialBBS); except end; + ThreadNgList.Free; + try if FEvent <> nil then FEvent.Free; @@ -1751,7 +1895,14 @@ begin end; except end; - //LockWindowUpdate(0); + + // Update‚ª‚¢‚ê‚ÎŽÀs‚·‚é + if FileExists(FUpdateExePath) then begin + // ƒAƒbƒvƒf[ƒgŽÀs + GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs); + end; + // ƒ[ƒŠ„—áŠO‚ðŒ³‚É–ß‚· + Set8087CW(FCwSave); end; // ŠeŠ‚É‚ ‚éƒLƒƒƒrƒlƒbƒgE BBS ƒƒjƒ…[‚ðƒZƒbƒg^XV @@ -1917,31 +2068,41 @@ var e: IHTMLElement; Ext: string; PathRec: TPathRec; - Text2: string; + Text2: string; cResPopup: TResPopupBrowser; + senderBrowser :TWebBrowser; + doc: IHTMLDocument2; begin - // ƒMƒRƒiƒr‚̓ŒƒXƒAƒ“ƒJ[‚ª about:blank.. ‚ÅŽn‚܂邱‚Æ‚ðŠú‘Ò‚µ‚Ä‚¢‚邪 - // IE 7 ‚Å‚Í about:blank.. ‚Å‚Í‚È‚­ about:.. ‚É‚È‚é‚̂ŁA’uŠ·‚·‚é(“Š‚°‚â‚è) - if Pos('about:..', Text) = 1 then - Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) ) - else - Text2 := Text; + // ƒMƒRƒiƒr‚̓ŒƒXƒAƒ“ƒJ[‚ª about:blank.. ‚ÅŽn‚܂邱‚Æ‚ðŠú‘Ò‚µ‚Ä‚¢‚邪 + // IE 7 ‚Å‚Í about:blank.. ‚Å‚Í‚È‚­ about:.. ‚É‚È‚é‚̂ŁA’uŠ·‚·‚é(“Š‚°‚â‚è) + if Pos('about:..', Text) = 1 then + Text2 := 'about:blank..' + Copy( Text, Length('about:..')+1, Length(Text) ) + else + Text2 := Text; + if not( TObject(Sender) is TWebBrowser )then Exit; + + senderBrowser := TWebBrowser(Sender); + doc := senderBrowser.ControlInterface.Document as IHTMLDocument2; + try try - if (TWebBrowser(Sender) <> nil) and (not TWebBrowser(Sender).Busy) and (Assigned(TWebBrowser(Sender).Document)) then begin - if LowerCase(OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset) <> 'shift_jis' then begin - OleVariant(IHTMLDocument2(TWebBrowser(Sender).Document)).charset := 'shift_jis'; + if ((not senderBrowser.Busy) and Assigned(doc)) then begin + if LowerCase(doc.charset) <> 'shift_jis' then begin + doc.charset := 'shift_jis'; end; end; except end; finally end; + if PreviewTimer.Enabled then PreviewTimer.Enabled := False; + Application.CancelHint; + try if GetActiveContent <> nil then ActiveFileName := ChangeFileExt(ExtractFileName(GetActiveContent.FileName), '') @@ -1951,6 +2112,7 @@ begin FActiveContent := nil; Exit; end; + // ‘O‰ñ‚Æ“¯‚¶ê‡I—¹ if (StatusBar.Panels[1].Text = Text2) then begin if Text2 = '' then begin @@ -1972,7 +2134,7 @@ begin if FResPopupBrowser <> nil then begin if not(Sender is TResPopupBrowser) then begin - if (FResPopupBrowser.Visible) then begin + if ((doc <> nil) and (FResPopupBrowser.Visible)) then begin if ResPopupClearTimer.Interval > 0 then begin ResPopupClearTimer.Enabled := True; ResPopupClearTimer.Tag := 0; @@ -2000,11 +2162,16 @@ begin //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10 //file:///C:/Borland/Projects/gikoNavi/test/read.cgi/qa/990576336/10-15 - + // ‘¼‚̃AƒvƒŠ‚ŏˆ—‚·‚éURL‚©Šm”F + if (ExtPreviewDM.PreviewURL(Text2)) then begin + Exit; + end; s := ''; Ext := AnsiLowerCase(ExtractFileExt(Text2)); - if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and - ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) then begin +// if (Pos('http://', Text2) = 1) and (GikoSys.Setting.PreviewVisible) and + if ((Pos('http://', Text2) = 1) or (Pos('https://', Text2) = 1)) and (GikoSys.Setting.PreviewVisible) and + ((Ext = '.jpg') or (Ext = '.jpeg') or (Ext = '.gif') or (Ext = '.png')) or + (Pos('http://www.nicovideo.jp/watch/', Text2) = 1) then begin if FPreviewBrowser = nil then begin FPreviewBrowser := TPreviewBrowser.Create(Self); ShowWindow(FPreviewBrowser.Handle, SW_HIDE); @@ -2019,9 +2186,9 @@ begin s := StringReplace(Text2, 'mailto:', '', [rfIgnoreCase]); //ƒMƒRƒiƒrƒXƒŒ ƒp[ƒg3‚Ì466Ž‚ÉŠ´ŽÓ GetCursorPos(p); - p.x := p.x - TWebBrowser(Sender).ClientOrigin.x; - p.y := p.y - TWebBrowser(Sender).ClientOrigin.y; - e := IHTMLDocument2(TWebBrowser(Sender).Document).elementFromPoint(p.x, p.y); + p.x := p.x - senderBrowser.ClientOrigin.x; + p.y := p.y - senderBrowser.ClientOrigin.y; + e := doc.elementFromPoint(p.x, p.y); if (Assigned(e)) then begin CreateResPopupBrowser; @@ -2034,7 +2201,7 @@ begin end; cResPopup := FResPopupBrowser.CreateNewBrowser; - tmp2 := ZenToHan(e.Get_outerText); + tmp2 := Trim(ZenToHan(e.Get_outerText)); if (GikoSys.IsNumeric(tmp2)) then begin //‚“‚̓ŒƒX”ԍ†‚Á‚Û‚¢‚Á‚·B wkIntSt := StrToInt64(tmp2); @@ -2291,9 +2458,10 @@ begin {$IFDEF DEBUG} Writeln(URL); {$ENDIF} + FKokoPopupThreadItem := nil; if Pos(kMenuName, URL) <> 0 then begin sNo := Copy( URL, Pos( kMenuName, URL ) + Length( kMenuName ), Length( URL ) ); - + if not GikoSys.IsNumeric(sNo) then Exit; Cancel := True; @@ -2301,10 +2469,27 @@ begin KokoPopupMenu.PopupComponent := nil; if (Sender is TComponent) then KokoPopupMenu.PopupComponent := TComponent(Sender); + // Œë”š‘΍ô ƒNƒŠƒbƒN‚µ‚½ƒuƒ‰ƒEƒU‚ƈقȂé‚Æ‚«‚ɏÁ‚·ˆ—‚ð’ljÁ + if not (Sender is TResPopupBrowser) then begin + if (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then begin + FResPopupBrowser.Clear; + end; + end else begin + if (Sender <> FResPopupBrowser.CurrentBrowser) then begin + TResPopupBrowser(Sender).ChildClear; + end; + end; + FKokoPopupThreadItem := GetActiveContent(true); KokoPopupMenu.Tag := StrToInt(sNo); KokoPopupMenu.Popup(p.x, p.y); end else if Pos('mailto', LowerCase(URL)) <> 0 then begin Cancel := not GikoSys.Setting.OpenMailer; + + //@‚Æ.‚ðŠÜ‚Ü‚È‚¢URL‚̓[ƒ‹ƒAƒhƒŒƒX‚Æ‚Ý‚È‚³‚È‚¢ + //Žå‚ÉageAsage‘΍ô + if (Pos('@', URL) = 0) or (Pos('.', URL) = 0) then begin + Cancel := True; + end; end; end; @@ -2446,6 +2631,8 @@ begin end; procedure TGikoForm.DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon); begin + if csDestroying in Self.ComponentState then + Exit; AddMessageList(Msg, nil, Icon); end; // ************************************************************************* @@ -2460,6 +2647,8 @@ var Res : TResRec; begin try + if csDestroying in Self.ComponentState then + Exit; if Item.DownType = gdtBoard then ATitle := Item.Board.Title else @@ -2537,26 +2726,15 @@ begin //„‰ñ‚ ‚è‚̏ꍇ•‚P‚O‚O‚O’´‚͏„‰ñíœ if (Item.ThreadItem.Round) and (Item.ThreadItem.Count > 1000) then begin - Item.ThreadItem.Round := False; - //Item.ThreadItem.RoundName := ''; - AddMessageList('š1000”­Œ¾‚ð’´‚¦‚½‚̂ŏ„‰ñ‚ðíœ‚µ‚Ü‚µ‚½ - [' + Item.ThreadItem.Title + ']', nil, gmiOK); + // 2chˆÈŠO‚́A1000‚ªÅ‚‚©•s–¾‚Ȃ̂ŁA2chŒÀ’è‚É‚·‚é + if (Item.ThreadItem.ParentBoard.Is2ch) then begin + Item.ThreadItem.Round := False; + AddMessageList('š1000”­Œ¾‚ð’´‚¦‚½‚̂ŏ„‰ñ‚ðíœ‚µ‚Ü‚µ‚½ - [' + Item.ThreadItem.Title + ']', nil, gmiOK); + end; end; TreeView.Refresh; //ListView‚Å‚±‚̃XƒŒ‚ªŠÜ‚Ü‚ê‚锂ð•\Ž¦‚µ‚Ä‚¢‚é‚Æ‚«‚̍XVˆ— - if (ActiveList <> nil) and (ActiveList is TBoard) then begin - TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount; - TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount; - TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount; - //ListView‚̃AƒCƒeƒ€‚̌”‚àXV - case GikoForm.ViewType of - gvtAll: ListView.Items.Count := TBoard(ActiveList).Count; - gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount; - gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount; - gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount; - gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount; - gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount; - end; - end; + UpdateListView(); RefreshListView(Item.ThreadItem); end; @@ -2601,6 +2779,9 @@ procedure TGikoForm.WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWork begin // SetProgressValue(Number, 0, AWorkCountMax); // ProgressBar.Visible := True; + if csDestroying in Self.ComponentState then + Exit; + ProgressBar.Position := 0; ProgressBar.Max := AWorkCountMax; FDownloadTitle := AWorkTitle; @@ -2610,6 +2791,8 @@ end; procedure TGikoForm.WorkEnd(Sender: TObject; AWorkMode: TWorkMode; Number: Integer); begin + if csDestroying in Self.ComponentState then + Exit; ProgressBar.Position := 0; if FDownloadMax <> 0 then StatusBar.Panels[1].Text := FDownloadTitle + ' - ƒ_ƒEƒ“ƒ[ƒh‚ªŠ®—¹‚µ‚Ü‚µ‚½'; @@ -2617,6 +2800,8 @@ end; procedure TGikoForm.Work(Sender: TObject; AWorkMode: TWorkMode; const AWorkCount: Integer; Number: Integer); begin + if csDestroying in Self.ComponentState then + Exit; ProgressBar.Position := AWorkCount; // SetProgressValue(Number, AWorkCount); StatusBar.Panels[1].Text := FDownloadTitle + ' - ƒ_ƒEƒ“ƒ[ƒh’† (' + IntToStr(AWorkCount) + '/' + IntToStr(FDownloadMax) + ')'; @@ -2798,7 +2983,7 @@ var BBSID: string; FileName: string; sTitle: string; - doc: Variant; + doc: OleVariant; s: string; idx: Integer; ThreadItem: TThreadItem; @@ -2812,14 +2997,14 @@ begin (FActiveContent <> nil) and (FActiveContent.Thread <> Thread.Thread) and (FActiveContent.Browser <> nil) and - (Assigned(FActiveContent.Browser.Document)) then begin - try - try - FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document).Body).ScrollTop; - except - on E: Exception do - MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0); - end; + (Assigned(FActiveContent.Browser.ControlInterface.Document)) then begin + try + try + FActiveContent.Thread.ScrollTop := FActiveContent.Browser.OleObject.Document.Body.ScrollTop; + except + on E: Exception do + MsgBox(Handle, E.Message, 'SetContent[<-ScrollTop]', 0); + end; finally end; end; @@ -2871,7 +3056,7 @@ begin ShowWindow(FActiveContent.Browser.Handle, SW_HIDE); end; ShowWindow(Thread.Browser.Handle, SW_SHOW); - if (not Assigned(Thread.Browser.Document)) then begin + if (not Assigned(Thread.Browser.ControlInterface.Document)) then begin Thread.Browser.Navigate('about:blank'); end; while (Thread.Browser.ReadyState <> READYSTATE_COMPLETE) and @@ -2885,7 +3070,7 @@ begin if (Thread <> nil) and (ThreadItem <>nil) then begin BrowserBoardNameLabel.Caption := ThreadPTitle; ItemIcon16.GetBitmap(4, ItemBoardImage.Picture.Bitmap); - BrowserNameLabel.Caption := ThreadTitle; + BrowserNameLabel.Caption := GikoSys.TrimThreadTitle(ThreadTitle); ItemImage.Picture := nil; if ThreadIsLog then if ThreadNewArraical then @@ -2909,7 +3094,7 @@ begin try Thread.Browser.BringToFront; s := '
‚±‚̃XƒŒƒbƒh‚͎擾‚µ‚Ä‚¢‚Ü‚¹‚ñ
'; - doc := Idispatch( olevariant(Thread.Browser.ControlInterface).Document) as IHTMLDocument2; + doc := Thread.Browser.OleObject.Document; doc.open; doc.charset := 'Shift_JIS'; doc.Write(s); @@ -2918,7 +3103,7 @@ begin end; end else begin - Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + ThreadTitle + ']'; + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GikoSys.TrimThreadTitle(ThreadTitle) + ']'; //ƒXƒe[ƒ^ƒXƒo[‚É•\Ž¦‚µ‚Ä‚¢‚éƒXƒŒ‚Ì—e—Ê‚ð•\Ž¦ StatusBar.Panels[THREADSIZE_PANEL].Text := Format('%6.2f kB', [ThreadItem.Size / 1024]); StatusBar.Panels[THREADSIZE_PANEL].Width := @@ -2981,7 +3166,7 @@ begin if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) and (FActiveContent.Thread.IsLogFile) then begin try - Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + FActiveContent.Thread.Title + ']' + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + GikoSys.TrimThreadTitle(FActiveContent.Thread.Title) + ']' except on E: Exception do begin //ƒXƒŒˆê——DLŒã‚È‚Ç‚ÉFActiveContent‚ÌŽ‚ÂThread‚ª @@ -3041,6 +3226,9 @@ begin BBSs[i].SelectText := SelectText; BBSs[i].KubetsuChk := KubetsuChk; end; + BoardGroup.SpecialBBS.SelectText := SelectText; + BoardGroup.SpecialBBS.KubetsuChk := KubetsuChk; + ViewType := AViewType; if ActiveList is TBoard then begin Board := TBoard(ActiveList); @@ -3640,29 +3828,32 @@ begin end; procedure TGikoForm.DeleteTab(index, selectIndex: Integer); var - doc: Variant; + browserRec : TBrowserRecord; + doc: OleVariant; j: Integer; begin + browserRec := TBrowserRecord(BrowserTab.Tabs.Objects[index]); try - if TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser <> nil then begin - doc := TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser.Document; - TBrowserRecord(BrowserTab.Tabs.Objects[index]).Thread.ScrollTop := doc.Body.ScrollTop; + if browserRec.Browser <> nil then begin + doc := browserRec.Browser.OleObject.Document; + browserRec.Thread.ScrollTop := doc.Body.ScrollTop; end; except - TBrowserRecord(BrowserTab.Tabs.Objects[index]).Thread.ScrollTop := 0; + browserRec.Thread.ScrollTop := 0; end; - if(FActiveContent = TBrowserRecord(BrowserTab.Tabs.Objects[index])) then + + if(FActiveContent = browserRec) then FActiveContent := nil; - if TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser <> nil then begin - j := FBrowsers.IndexOf(TBrowserRecord(BrowserTab.Tabs.Objects[index]).Browser); + if browserRec.Browser <> nil then begin + j := FBrowsers.IndexOf(browserRec.Browser); if j <> -1 then FBrowsers.Move(j, BROWSER_COUNT - 1); end; + BrowserTab.Tabs.BeginUpdate; try - GikoSys.Setting.LastCloseTabURL := - TBrowserRecord(BrowserTab.Tabs.Objects[index]).Thread.URL; - TBrowserRecord(BrowserTab.Tabs.Objects[index]).Free; + GikoSys.Setting.LastCloseTabURL := browserRec.Thread.URL; + browserRec.Free; if ( BrowserTab.Tabs.Count - 1 = index ) and ( BrowserTab.TabRect(index).Left <= BrowserTab.DisplayRect.Left ) then begin @@ -3683,6 +3874,7 @@ begin if BrowserTab.Tabs.Count = 0 then begin BrowserNullTab.Thread := nil; end; + if(BrowserTab.TabIndex <> -1) and ( TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser = nil) then begin // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é @@ -3750,6 +3942,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end else if TObject(FClickNode.Data) is TBoard then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := True; @@ -3760,6 +3953,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else if TObject(FClickNode.Data) is TFavoriteBoardItem then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := True; @@ -3770,6 +3964,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TThreadItem) then begin TreeSelectThreadPupupMenu.Visible := True; TreeSelectBoardPupupMenu.Visible := False; @@ -3780,6 +3975,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := True; TreeSelectLogDeletePopupMenu.Visible := True; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TFavoriteThreadItem) then begin TreeSelectThreadPupupMenu.Visible := True; TreeSelectBoardPupupMenu.Visible := False; @@ -3790,6 +3986,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := True; TreeSelectLogDeleteSeparator.Visible := True; TreeSelectLogDeletePopupMenu.Visible := True; + SearchBoardName.Visible := False; end else if (TObject(FClickNode.Data) is TCategory) then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3800,6 +3997,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else if FClickNode.IsFirstNode then begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3810,6 +4008,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := True; end else begin TreeSelectThreadPupupMenu.Visible := False; TreeSelectBoardPupupMenu.Visible := False; @@ -3820,6 +4019,7 @@ begin TreeSelectFavoriteAddPupupMenu.Visible := False; TreeSelectLogDeleteSeparator.Visible := False; TreeSelectLogDeletePopupMenu.Visible := False; + SearchBoardName.Visible := False; end; end; @@ -3835,90 +4035,103 @@ var BNum, BRes: string; threadItem: TThreadItem; aElement : IHTMLElement; + senderBrowser : TWebBrowser; + doc : IHTMLDocument2; begin {$IFDEF DEBUG} Writeln(IntToStr(Integer(ppDisp))); {$ENDIF} Cancel := True; - aElement := IHTMLDocument2(TWebBrowser(Sender).Document).activeElement; - if ( aElement <> nil) then begin - Text := aElement.Get_outerText; - Html := aElement.Get_outerHTML; - if(AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1) - or (AnsiPos('„„', Text) = 1) or (AnsiPos('„', Text) = 1) then begin - if GikoSys.Setting.ResAnchorJamp then begin - - Text := ZenToHan(Trim(Text)); - - if(AnsiPos('>>', Text) = 1) then begin - //Text := Copy(Text, 3, Length(Text) - 2); - Delete(Text, 1, 2); - end else begin - //Text := Copy(Text, 2, Length(Text) - 1); - Delete(Text, 1, 1); - end; - if AnsiPos('-', Text) <> 0 then begin - wkIntSt := StrToIntDef(Copy(Text, 1, AnsiPos('-', Text) - 1), 0); - Text := Copy(Text, AnsiPos('-', Text) + 1, Length(Text)); - wkIntTo := StrToIntDef(Text, 0); - if wkIntTo < wkIntSt then - wkIntSt := wkIntTo; - end else begin - wkIntSt := StrToIntDef(Text, 0); - end; + if not( TObject(Sender) is TWebBrowser )then + Exit; - if wkIntSt <> 0 then begin - FActiveContent.IDAnchorPopup(''); - MoveHisotryManager.pushItem(FActiveContent); - if (Sender is TResPopupBrowser) then begin - TResPopupBrowser(Sender).ChildClear; - OpenThreadItem( - GetActiveContent(true), - GetActiveContent(true).URL + '&st=' + - IntToStr(wkIntSt) + '&to=' + IntToStr(wkIntSt)); - end else begin - BrowserMovement(IntToStr(wkIntSt)); - end; - end; + senderBrowser := TWebBrowser(Sender); + doc := senderBrowser.ControlInterface.Document as IHTMLDocument2; + if not Assigned(doc) then + Exit; + + aElement := doc.activeElement; + if not Assigned(aElement) then + Exit; + + Text := aElement.Get_outerText; + Html := aElement.Get_outerHTML; + + if(AnsiPos('>>', Text) = 1) or (AnsiPos('>', Text) = 1) + or (AnsiPos('„„', Text) = 1) or (AnsiPos('„', Text) = 1) then begin + if GikoSys.Setting.ResAnchorJamp then begin + + Text := ZenToHan(Trim(Text)); + + if(AnsiPos('>>', Text) = 1) then begin + //Text := Copy(Text, 3, Length(Text) - 2); + Delete(Text, 1, 2); + end else begin + //Text := Copy(Text, 2, Length(Text) - 1); + Delete(Text, 1, 1); end; - end else begin - ////'http://be.2ch.net/test/p.php?i='+id+'&u=d:'+bas+num - - URL := GikoSys.GetHRefText(Html); - URL := GikoSys.HTMLDecode(URL); - if AnsiPos('BE:', URL) = 1 then begin - BNum := Copy(URL, 4, AnsiPos('/', URL) - 4); - BRes := Copy(URL, AnsiPos('/', URL) + 1, Length(URL)); - threadItem := FActiveContent.Thread; - if threadItem = nil then Exit; - URL := BE_PHP_URL + BNum + '&u=d' - + CustomStringReplace(threadItem.URL, 'l50', '') + BRes; - end; - if( AnsiPos('http://', URL) = 1) or (AnsiPos('https://', URL) = 1) or - ( AnsiPos('ftp://', URL) = 1) then begin - //ƒAƒhƒŒƒXƒo[‚Ì—š—ð - if GikoSys.Setting.LinkAddAddressBar then begin - idx := AddressComboBox.Items.IndexOf(URL); - if idx = -1 then begin - AddressComboBox.Items.Insert(0, URL); - if AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then - AddressComboBox.Items.Delete(AddressComboBox.Items.Count - 1); - end else begin - AddressComboBox.Items.Delete(idx); - AddressComboBox.Items.Insert(0, URL); - end; - end; + if AnsiPos('-', Text) <> 0 then begin + wkIntSt := StrToIntDef(Copy(Text, 1, AnsiPos('-', Text) - 1), 0); + Text := Copy(Text, AnsiPos('-', Text) + 1, Length(Text)); + wkIntTo := StrToIntDef(Text, 0); + if wkIntTo < wkIntSt then + wkIntSt := wkIntTo; + end else begin + wkIntSt := StrToIntDef(Text, 0); + end; + + if wkIntSt <> 0 then begin + FActiveContent.IDAnchorPopup(''); + MoveHisotryManager.pushItem(FActiveContent); if (Sender is TResPopupBrowser) then begin - TResPopupBrowser(Sender).ChildClear + TResPopupBrowser(Sender).ChildClear; + OpenThreadItem( + GetActiveContent(true), + GetActiveContent(true).URL + '&st=' + + IntToStr(wkIntSt) + '&to=' + IntToStr(wkIntSt)); + end else begin + BrowserMovement(IntToStr(wkIntSt)); end; + end; + end; + end else begin + ////'http://be.2ch.net/test/p.php?i='+id+'&u=d:'+bas+num + + URL := GikoSys.GetHRefText(Html); + URL := GikoSys.HTMLDecode(URL); + if AnsiPos('BE:', URL) = 1 then begin + BNum := Copy(URL, 4, AnsiPos('/', URL) - 4); + BRes := Copy(URL, AnsiPos('/', URL) + 1, Length(URL)); + threadItem := FActiveContent.Thread; + if threadItem = nil then Exit; + URL := BE_PHP_URL + BNum + '&u=d' + + CustomStringReplace(threadItem.URL, 'l50', '') + BRes; + end; - MoveHisotryManager.pushItem(FActiveContent); - MoveToURL( URL ); + if( AnsiPos('http://', URL) = 1) or (AnsiPos('https://', URL) = 1) or + ( AnsiPos('ftp://', URL) = 1) then begin + //ƒAƒhƒŒƒXƒo[‚Ì—š—ð + if GikoSys.Setting.LinkAddAddressBar then begin + idx := AddressComboBox.Items.IndexOf(URL); + if idx = -1 then begin + AddressComboBox.Items.Insert(0, URL); + if AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then + AddressComboBox.Items.Delete(AddressComboBox.Items.Count - 1); + end else begin + AddressComboBox.Items.Delete(idx); + AddressComboBox.Items.Insert(0, URL); + end; end; + if (Sender is TResPopupBrowser) then begin + TResPopupBrowser(Sender).ChildClear + end; + + MoveHisotryManager.pushItem(FActiveContent); + MoveToURL( URL ); end; - end; + end; end; @@ -4153,10 +4366,9 @@ end; procedure TGikoForm.BrowserDocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); var - FDispHtmlDocument: DispHTMLDocument; BrowserRecord :TBrowserRecord; i :Integer; - doc : Variant; + doc : IHTMLDocument2; threadItem : TThreadItem; begin if TObject(Sender) is TWebBrowser then begin @@ -4171,17 +4383,15 @@ begin if BrowserRecord <> nil then begin if BrowserRecord.Event <> nil then BrowserRecord.Event.Free; - FDispHtmlDocument := Idispatch(OleVariant(BrowserRecord.Browser.ControlInterface).Document) as DispHTMLDocument; - BrowserRecord.Event := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2); + BrowserRecord.Event := THTMLDocumentEventSink.Create(Self, BrowserRecord.Browser.ControlInterface.Document, HTMLDocumentEvents2); BrowserRecord.Event.OnContextMenu := OnDocumentContextMenu; BrowserRecord.Event.OnClick := WebBrowserClick; //’ljÁ‚µ‚½OnClickƒCƒxƒ“ƒg end; end else begin if GetActiveContent <> nil then begin - FDispHtmlDocument := Idispatch(OleVariant(Browser.ControlInterface).Document) as DispHTMLDocument; if FEvent <> nil then FEvent.Free; - FEvent := THTMLDocumentEventSink.Create(Self, FDispHtmlDocument, HTMLDocumentEvents2); + FEvent := THTMLDocumentEventSink.Create(Self, Browser.ControlInterface.Document, HTMLDocumentEvents2); FEvent.OnContextMenu := OnDocumentContextMenu; FEvent.OnClick := WebBrowserClick; //’ljÁ‚µ‚½OnClickƒCƒxƒ“ƒg end else begin @@ -4219,8 +4429,8 @@ begin RefreshListView(threadItem); end else if threadItem.ScrollTop <> 0 then begin try - doc := Idispatch( OleVariant( BrowserRecord.Browser.ControlInterface ).Document ) as IHTMLDocument2; - doc.Body.ScrollTop := threadItem.ScrollTop; + doc := BrowserRecord.Browser.ControlInterface.Document as IHTMLDocument2; + (doc.body as IHTMLElement2).ScrollTop := threadItem.ScrollTop; except on E: Exception do MsgBox(Handle, E.Message, 'SetContent[ScrollTop<-]', 0); @@ -4265,7 +4475,7 @@ procedure TGikoForm.SetSelectItemRound(RoundFlag: Boolean; RoundName: string; Pa var threadItem : TThreadItem; begin - if ParentName <> 'dummy1' then begin + if ParentName <> 'RoundItem' then begin SetSelectItemRound(RoundFlag, RoundName); end else begin threadItem := GetActiveContent; @@ -4545,7 +4755,7 @@ var stRes, edRes : Int64; browserRec : TBrowserRecord; threadNumber : String; - doc : Variant; + doc : IHTMLDocument2; begin stRes := 0; edRes := 0; @@ -4573,15 +4783,16 @@ begin browserRec.Move(IntToStr(stRes)); Thread.JumpAddress := 0; try - doc := Idispatch( OleVariant( browserRec.Browser.ControlInterface ).Document ) as IHTMLDocument2; - Thread.ScrollTop := doc.Body.ScrollTop; + doc := browserRec.Browser.ControlInterface.Document as IHTMLDocument2; + if Assigned(doc) then + Thread.ScrollTop := (doc.body as IHTMLElement2).ScrollTop; except end; end; end; end; -procedure TGikoForm.MoveToURL(const inURL: string); +procedure TGikoForm.MoveToURL(const inURL: string; KeyMask: Boolean = False); var protocol, host, path, document, port, bookmark : string; URL, protocol2, host2, path2, document2, port2, bookmark2 : string; @@ -4598,17 +4809,18 @@ begin GikoSys.ParseURI( inURL, protocol, host, path, document, port, bookmark ); GikoSys.Parse2chURL( inURL, path, document, BBSID, BBSKey ); - - - shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); - ctrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001); - if shiftDown then begin - GikoSys.OpenBrowser(inURL, gbtUserApp); - Exit; - end else if ctrlDown then begin - GikoSys.OpenBrowser(inURL, gbtIE); - Exit; - end; + // ƒAƒNƒVƒ‡ƒ“‚©‚çŒÄ‚΂ê‚é‚Æshift/ctrl‚Í‚¨‚µ‚Á‚ς̏ꍇ‚ª‚Ù‚Æ‚ñ‚ǂȂ̂Ń}ƒXƒN‚·‚é + if not KeyMask then begin + shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); + ctrlDown := GetAsyncKeyState(VK_CONTROL) = Smallint($8001); + if shiftDown then begin + GikoSys.OpenBrowser(inURL, gbtUserApp); + Exit; + end else if ctrlDown then begin + GikoSys.OpenBrowser(inURL, gbtIE); + Exit; + end; + end; //===== ƒvƒ‰ƒOƒCƒ“ try @@ -4775,8 +4987,8 @@ end; procedure TGikoForm.WndProc(var Message: TMessage); var - senderBrowser : TWebBrowser; - url : OleVariant; + senderBrowser : TWebBrowser; + url : OleVariant; begin try case Message.Msg of @@ -4807,12 +5019,16 @@ begin senderBrowser := TWebBrowser( Message.WParam ); BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url ); end; - USER_RESPOPUPCLEAR: + USER_POPUPCLEAR: if (TObject(Message.WParam) is TResPopupBrowser) then begin try TResPopupBrowser( Message.WParam ).Clear; except end; + end else if (TObject(Message.WParam) is TPreviewBrowser) then begin + if FPreviewBrowser <> nil then begin + ShowWindow(FPreviewBrowser.Handle, SW_HIDE); + end; end; end; @@ -4907,9 +5123,13 @@ begin if PreviewTimer.Enabled then PreviewTimer.Enabled := False; - if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin - FResPopupBrowser.Clear; - end; + //WindowŠO‚Ɉړ®‚µ‚½‚Æ‚«‚͏Á‚¦‚é‚悤‚É‚·‚邽‚ß•œŠˆ + if (FResPopupBrowser <> nil) and (IsWindowVisible(FResPopupBrowser.Handle)) then begin + // ‰EƒNƒŠƒbƒN‚ÌŽž‚͏Á‚³‚È‚¢‚悤‚ÉðŒ’Ç‰Á + if (Message.MouseMsg <> WM_RBUTTONUP) then begin + FResPopupBrowser.Clear; + end; + end; if (FPreviewBrowser <> nil) and (IsWindowVisible(FPreviewBrowser.Handle)) then begin @@ -4936,7 +5156,7 @@ end; function TGikoForm.OnDocumentContextMenu(Sender: TObject): WordBool; var - Doc: IHtmlDocument2; + doc: IHtmlDocument2; Range: IHTMLTxtRange; s: string; Num: Integer; @@ -4944,26 +5164,31 @@ var begin Result := False; FactiveContent.IDAnchorPopup(''); - Doc := FactiveContent.Browser.Document as IHtmlDocument2; - if Assigned(Doc) then begin - Range := Doc.selection.createRange as IHTMLTxtRange; - s := CustomStringReplace(Range.text, '@', ' ');//‘SŠp‹ó”’‚𔼊p‹ó”’‚É - s := ZenToHan(Trim(s)); - if GikoSys.IsNumeric(s) then begin - Num := StrToInt64Def(s, -1); - ThreadItem := GetActiveContent(true); - if (ThreadItem <> nil) and (Num <= ThreadItem.Count) - and (Num > 0)then begin - CreateResPopupBrowser; - FResPopupBrowser.CreateNewBrowser.PopupType := gptThread; - HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False); - FResPopupBrowser.Popup; - Result := False; - end else - Result := True; - end else begin + + doc := FactiveContent.Browser.ControlInterface.Document as IHtmlDocument2; + if not Assigned(doc) then + Exit; + + Range := doc.selection.createRange as IHTMLTxtRange; + if not Assigned(Range) then + Exit; + + s := CustomStringReplace(Range.text, '@', ' ');//‘SŠp‹ó”’‚𔼊p‹ó”’‚É + s := ZenToHan(Trim(s)); + if GikoSys.IsNumeric(s) then begin + Num := StrToInt64Def(s, -1); + ThreadItem := GetActiveContent(true); + if (ThreadItem <> nil) and (Num <= ThreadItem.Count) + and (Num > 0)then begin + CreateResPopupBrowser; + FResPopupBrowser.CreateNewBrowser.PopupType := gptThread; + HTMLCreater.SetResPopupText(FResPopupBrowser.CreateNewBrowser, ThreadItem, Num, Num, False, False); + FResPopupBrowser.Popup; + Result := False; + end else Result := True; - end; + end else begin + Result := True; end; end; @@ -5130,8 +5355,7 @@ begin SenderNode.Selected := False; FavoriteDragDrop( SenderNode, Source ); - SetLinkBar; - + PostMessage( Handle, USER_SETLINKBAR, 0, 0 ); end; procedure TGikoForm.LinkToolButtonOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -5660,7 +5884,7 @@ procedure TGikoForm.SelectComboBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var IMC: HIMC; - Len: integer; + Len, idx: integer; Str: string; tmp: string; begin @@ -5686,6 +5910,20 @@ begin SetSelectWord(Str); end; end; + end else if (Key = Windows.VK_DELETE) and (ssCtrl in Shift) then begin + // Ctrl + DEL ‚ō폜‚·‚é + Str := SelectComboBox.Text; + idx := GikoSys.Setting.SelectTextList.IndexOf( Str ); + if idx <> -1 then begin + GikoSys.Setting.SelectTextList.Delete( idx ); + end; + idx := SelectComboBox.Items.IndexOf( Str ); + if idx <> -1 then begin + SelectComboBox.Items.Delete( idx ); + end; + SelectComboBox.Text := ''; + // iž‚Ý‚ð‰ðœ‚·‚邽‚߂ɕύXƒCƒxƒ“ƒg‚ðŒÄ‚яo‚· + SelectComboBox.OnChange(Sender); end else if Length( SelectComboBox.Text ) = 0 then begin {* SelectComboBox.Text‚ª‹ó‚Å‚àA“ü—Í“r’†‚ÅEsc‚µ‚½‚Æ‚© @@ -6189,13 +6427,16 @@ begin if FDragWFirst = true then FDragWFirst := false; - if GikoSys.Setting.ListOrientation = gloHorizontal then begin - if GikoSys.Setting.ListWidthState = glsMin then begin - GikoDM.BrowserMaxAndFocusAction.Execute; - end; - end else begin - if GikoSys.Setting.ListHeightState = glsMin then begin - GikoDM.BrowserMaxAndFocusAction.Execute; + // ƒ}ƒEƒX‚Ì’†ƒ{ƒ^ƒ“‚ŕ‚¶‚½‚Æ‚«‚ɍő剻‚µ‚Ä‚µ‚Ü‚¤‚Ì‚ð–h‚®@ + if Button <> mbMiddle then begin + if GikoSys.Setting.ListOrientation = gloHorizontal then begin + if GikoSys.Setting.ListWidthState = glsMin then begin + GikoDM.BrowserMaxAndFocusAction.Execute; + end; + end else begin + if GikoSys.Setting.ListHeightState = glsMin then begin + GikoDM.BrowserMaxAndFocusAction.Execute; + end; end; end; end; @@ -6339,17 +6580,24 @@ end; procedure TGikoForm.BrowserTabPopupMenuPopup(Sender: TObject); +var + i:Integer; begin - AddRoundNameMenu(dummy1); - AddMenuSameBoardThread; + for i := 0 to BrowserTabPopupMenu.Items.Count - 1 do begin + if (BrowserTabPopupMenu.Items[i].Name='RoundItem') then begin + AddRoundNameMenu(BrowserTabPopupMenu.Items[i]); + end else if (BrowserTabPopupMenu.Items[i].Name='BoardThreadItem') then begin + AddMenuSameBoardThread(BrowserTabPopupMenu.Items[i]) + end; + end; end; //! ƒAƒNƒeƒBƒu‚ȃ^ƒu‚Æ“¯‚¶”‚̊J‚¢‚Ä‚¢‚éƒXƒŒƒbƒh‚ðƒƒjƒ…[ƒAƒCƒeƒ€‚ɒljÁ -procedure TGikoForm.AddMenuSameBoardThread; +procedure TGikoForm.AddMenuSameBoardThread(MenuItem: TMenuItem); var i: Integer; Item: TMenuItem; begin - SameBoardThreadItem.Clear; + MenuItem.Clear; for i := 0 to BrowserTab.Tabs.Count - 1 do begin // “¯‚¶”‚©‚Ç‚¤‚© if (FActiveContent.Thread.ParentBoard = @@ -6359,23 +6607,23 @@ begin TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin Item := TMenuItem.Create(Self); Item.Caption := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title; + Item.Hint := TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.URL; Item.OnClick := SameBoardThreadSubItemOnClick; - SameBoardThreadItem.Add(Item); + MenuItem.Add(Item); end; end; end; // ‰½‚à–³‚¢‚È‚çŽg—p‚Å‚«‚È‚¢‚悤‚É‚·‚é - SameBoardThreadItem.Enabled := SameBoardThreadItem.Count > 0; + MenuItem.Enabled := MenuItem.Count > 0; end; //! ƒAƒNƒeƒBƒu‚ȃ^ƒu‚Æ“¯‚¶”‚̊J‚¢‚Ä‚¢‚éƒXƒŒƒbƒhƒNƒŠƒbƒNƒCƒxƒ“ƒg procedure TGikoForm.SameBoardThreadSubItemOnClick(Sender: TObject); var - i, j: Integer; + i: Integer; MenuItem: TMenuItem; begin if Sender is TMenuItem then begin try - j := 0; MenuItem := TMenuItem(Sender); for i := 0 to BrowserTab.Tabs.Count - 1 do begin // “¯‚¶”‚©‚Ç‚¤‚© @@ -6383,12 +6631,11 @@ begin TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin if FActiveContent.Thread <> TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin - if (SameBoardThreadItem.Items[j] = MenuItem) then begin - MoveToURL( TBrowserRecord(BrowserTab.Tabs.Objects[i]) - .Thread.URL); + if (MenuItem.Hint = TBrowserRecord(BrowserTab.Tabs.Objects[i]) + .Thread.URL) then begin + MoveToURL( MenuItem.Hint); Exit; end; - Inc(j); end; end; end; @@ -6467,10 +6714,15 @@ end; /// Å¬‰»‚³‚ê‚é procedure TGikoForm.OnMinimize; +var + doc: IHTMLDocument2; begin if FActiveContent <> nil then begin FIsMinimize := mtMinimizing; - FActiveContent.Thread.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop; + doc := FActiveContent.Browser.ControlInterface.Document as IHTMLDocument2; + if Assigned(doc) then begin + FActiveContent.Thread.ScrollTop := (doc.body as IHTMLElement2).ScrollTop; + end; end; end; @@ -6666,9 +6918,8 @@ end; procedure TGikoForm.OnResized; var - doc : Variant; + doc : IHTMLDocument2; begin - FOldFormWidth := Width; FIsIgnoreResize := rtNone; @@ -6683,8 +6934,8 @@ begin begin // Å¬‰»‚ÍŠù‚ÉŠ®—¹‚µ‚Ä‚¢‚é (‚‚܂èƒ^ƒXƒNƒo[‚©‚çƒEƒBƒ“ƒhƒE‚𕜌³’†) if FActiveContent <> nil then begin - doc := Idispatch( olevariant(FActiveContent.Browser.ControlInterface).Document) as IHTMLDocument2; - doc.Body.ScrollTop := FActiveContent.Thread.ScrollTop; + doc := FActiveContent.Browser.ControlInterface.Document as IHTMLDocument2; + (doc.body as IHTMLElement2).ScrollTop := FActiveContent.Thread.ScrollTop; end; FIsMinimize := mtNone; end; @@ -6695,74 +6946,70 @@ end; //! ƒXƒŒƒbƒhƒuƒ‰ƒEƒUƒNƒŠƒbƒNƒCƒxƒ“ƒg // ************************************************************************* function TGikoForm.WebBrowserClick(Sender: TObject): WordBool; -const - LIMIT = 20; var - p : TPoint; e: IHTMLElement; - AID: string; - stlist : TStringList; - i, count: Integer; - body : String; - limited : Integer; + doc : IHTMLDocument2; FOleInPlaceActiveObject: IOleInPlaceActiveObject; + p : TPoint; + AID: string; begin - result := true; - try - if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then - FOleInPlaceActiveObject := FActiveContent.Browser.ControlInterface as IOleInPlaceActiveObject; - FOleInPlaceActiveObject.OnFrameWindowActivate(True); - try - GetCursorPos(p); - p.x := p.x - FActiveContent.Browser.ClientOrigin.x; - p.y := p.y - FActiveContent.Browser.ClientOrigin.y; - e := IHTMLDocument2(FActiveContent.Browser.Document).elementFromPoint(p.x, p.y); - if (Assigned(e)) then begin - if (e.className = 'date') or (e.id = 'date') then begin - AID := e.innerText; - if AnsiPos('id', AnsiLowerCase(AID)) > 0 then begin - AID := Copy(AID, AnsiPos('id', AnsiLowerCase(AID)) - 1, 11); - if AnsiPos(' be:', AnsiLowerCase(AID)) > 0 then begin - AID := Copy(AID, 1, AnsiPos(' BE:', AnsiLowerCase(AID)) - 1) - end; - end else begin - stlist := TStringList.Create; - try - stList.DelimitedText := AID; - AID := ''; - for i := 0 to stList.Count - 1 do - if Length(WideString(stList[i])) = 8 then begin - if GikoSys.NotDateorTimeString(stList[i]) then begin - AID := stList[i]; - break; - end; - end; - finally - stList.Free; - end; - end; - count := GikoSys.GetSameIDResCount(AID, FActiveContent.Thread); - limited := LIMIT; - if not (GikoSys.Setting.LimitResCountMessage) then begin - limited := -1; - end else if (count > LIMIT) then begin - if (GikoUtil.MsgBox(Handle, - IntToStr(LIMIT) + 'ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H', - 'IDƒ|ƒbƒvƒAƒbƒvŒx', - MB_YESNO or MB_ICONQUESTION) = ID_YES) then begin - limited := -1; - end - end; - body := GikoSys.GetSameIDResAnchor(AID, FActiveContent.Thread, limited); - FActiveContent.IDAnchorPopup(body); - end; - end; - except + result := true; + if not Assigned(FActiveContent) then + Exit; + if not Assigned(FActiveContent.Browser) then + Exit; + + try + FOleInPlaceActiveObject := FActiveContent.Browser.ControlInterface as IOleInPlaceActiveObject; + FOleInPlaceActiveObject.OnFrameWindowActivate(True); + GetCursorPos(p); + + p.x := p.x - FActiveContent.Browser.ClientOrigin.x; + p.y := p.y - FActiveContent.Browser.ClientOrigin.y; + + doc := FActiveContent.Browser.ControlInterface.Document as IHTMLDocument2; + if not Assigned(doc) then + Exit; + + e := doc.elementFromPoint(p.x, p.y); + if not Assigned(e) then + Exit; + + if (e.className = 'date') or (e.id = 'date') then begin + AID := GikoSys.ExtructResID(e.innerText); + ShowSameIDAncher(AID); end; - except - end; + except + end; end; +procedure TGikoForm.ShowSameIDAncher(const AID: String); +const + LIMIT = 20; +var + numbers : TStringList; + limited : Integer; +begin + numbers := TStringList.Create; + try + GikoSys.GetSameIDRes(AID, FActiveContent.Thread, numbers); + limited := LIMIT; + if not (GikoSys.Setting.LimitResCountMessage) then begin + limited := -1; + end else if (numbers.Count > LIMIT) then begin + if (GikoUtil.MsgBox(Handle, + IntToStr(LIMIT) + 'ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H', + 'IDƒ|ƒbƒvƒAƒbƒvŒx', + MB_YESNO or MB_ICONQUESTION) = ID_YES) then begin + limited := -1; + end + end; + FActiveContent.IDAnchorPopup( + GikoSys.CreateResAnchor(numbers, FActiveContent.Thread, limited)); + finally + numbers.Free; + end; +end; //ƒXƒŒƒbƒhˆê——‚ðÅ‘剻‚µ‚ătƒH[ƒJƒX‚ð“–‚Ä‚é procedure TGikoForm.SelectTimerTimer(Sender: TObject); begin @@ -7149,15 +7396,22 @@ end; //‚±‚̃ŒƒX‚ ‚ځ`‚ñ procedure TGikoForm.IndividualAbon(Atag, Atype : Integer); var - ThreadItem : TThreadItem; - ReadList : TStringList; - wordCount : TWordCount; + doc : IHTMLDocument2; + ThreadItem : TThreadItem; + ReadList : TStringList; + wordCount : TWordCount; begin - ThreadItem := GetActiveContent(True); - ReadList := TStringList.Create; - wordCount := TWordCount.Create; + if not Assigned(FActiveContent) then + Exit; + doc := FActiveContent.Browser.ControlInterface.Document as IHTMLDocument2; + if not Assigned(doc) then + Exit; + + ThreadItem := GetActiveContent(True); + ReadList := TStringList.Create; + wordCount := TWordCount.Create; try - ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop; + ThreadItem.ScrollTop := (doc.body as IHTMLElement2).ScrollTop; {$IFDEF SPAM_FILTER_ENABLED} // ƒXƒpƒ€‚ɐݒè ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); @@ -7178,6 +7432,7 @@ end; //“¯ˆêID‚ðNGƒ[ƒh‚É“o˜^ procedure TGikoForm.AddIDtoNGWord(invisible : boolean); var + doc : IHTMLDocument2; ThreadItem : TThreadItem; No : Integer; {$IFDEF SPAM_FILTER_ENABLED} @@ -7186,17 +7441,26 @@ var wordCount : TWordCount; {$ENDIF} id, dateStr: String; + ThreadTitle: String; + Idx: Integer; begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent(True); + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; id := GikoSys.GetResID(No, ThreadItem); if (id <> '') and (not IsNoValidID(id)) then begin + ThreadTitle := ThreadItem.Title; + while (True) do begin + Idx := Pos(#9, ThreadTitle); + if (Idx < 1) then + Break; + Delete(ThreadTitle, Idx, 1); + end; // ƒRƒƒ“ƒg‚Æ‚µ‚āAƒXƒŒƒbƒh–¼‚ƍ¡“ú‚Ì“ú•t‚ð’ljÁ DateTimeToString(dateStr, 'yyyymmdd', Now); - id := id + #9'>>add ' + dateStr + ',' + ThreadItem.Title; + id := id + #9'>>add ' + dateStr + ',' + ThreadTitle; if (GikoSys.FAbon.AddToken(id, invisible)) then begin GikoSys.FAbon.ReLoadFromNGwordFile; FActiveContent.Repaint := True; @@ -7227,7 +7491,11 @@ begin end; {$ENDIF} if (FActiveContent.Repaint) then begin - ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop; + doc := FActiveContent.Browser.ControlInterface.Document as IHTMLDocument2; + + if not Assigned(doc) then + Exit; + ThreadItem.ScrollTop := (doc.body as IHTMLElement2).ScrollTop; if ThreadItem <> nil then InsertBrowserTab( ThreadItem, True ); end; @@ -7244,7 +7512,7 @@ var begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent(True); + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; body := TStringList.Create; try @@ -7253,7 +7521,7 @@ begin ReadList := TStringList.Create; wordCount := TWordCount.Create; try - ThreadItem.ScrollTop := OleVariant(IHTMLDocument2(FActiveContent.Browser.Document)).Body.ScrollTop; + ThreadItem.ScrollTop := FActiveContent.Browser.OleObject.Document.Body.ScrollTop; {$IFDEF SPAM_FILTER_ENABLED} // ƒXƒpƒ€‚ɐݒè ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); @@ -7283,14 +7551,17 @@ end; procedure TGikoForm.KokoPopupMenuPopup(Sender: TObject); var firstElement: IHTMLElement; - document: IHTMLDocument2; + doc: IHTMLDocument2; begin - document := FActiveContent.Browser.Document as IHTMLDocument2; - if Assigned(document) then - firstElement := document.all.item('idSearch', 0) as IHTMLElement; - if Assigned(firstElement) then - if firstElement.style.visibility <> 'hidden' then - firstElement.style.visibility := 'hidden'; + try + doc := FActiveContent.Browser.ControlInterface.Document as IHTMLDocument2; + if Assigned(doc) then + firstElement := doc.all.item('idSearch', 0) as IHTMLElement; + if Assigned(firstElement) then + if firstElement.style.visibility <> 'hidden' then + firstElement.style.visibility := 'hidden'; + except + end; end; procedure TGikoForm.RepaintAllTabsBrowser(); @@ -7473,6 +7744,7 @@ begin BrowserNullTab.Browser.Navigate(BLANK_HTML); FBrowsers := TList.Create; + for i := 0 to count -1 do begin FBrowsers.Add(TWebBrowser.Create(BrowserPanel)); newBrowser := FBrowsers[FBrowsers.Count - 1]; @@ -7488,6 +7760,8 @@ begin newBrowser.OnStatusTextChange := BrowserStatusTextChange; newBrowser.Navigate(BLANK_HTML); ShowWindow(newBrowser.Handle, SW_HIDE); + GikoSys.ShowRefCount('Browser' + IntToStr(i), newBrowser.ControlInterface); + GikoSys.ShowRefCount('Document' + IntToStr(i), newBrowser.ControlInterface.Document); end; BrowserNullTab.Browser.BringToFront; ShowWindow(BrowserNullTab.Browser.Handle, SW_SHOW); @@ -7661,10 +7935,17 @@ begin end; procedure TGikoForm.TaskTrayIconMessage(var Msg: TMsg); +var + p: TPoint; begin // ¶ƒNƒŠƒbƒN‚È‚ç•œŒ³‚·‚é if (Msg.wParam = WM_LBUTTONUP) then begin UnStoredTaskTray; + end else if (Msg.wParam=WM_RBUTTONUP) then begin + // ‰EƒNƒŠƒbƒN‚È‚çI—¹‚·‚é + GetCursorPos ( p ); + SetForegroundWindow ( Self.Handle ); + TaskTrayPopupMenu.Popup ( p.X, p.Y ); end; end; //! ƒ^ƒXƒNƒgƒŒƒC‚ɃAƒCƒRƒ““o˜^•ƒtƒH[ƒ€‰B‚µ @@ -7737,7 +8018,6 @@ var Board: TBoard; LogFolder: String; datList: TStringList; - p: TPoint; begin // •\Ž¦‚µ‚Ä‚¢‚é‚̔‚̂Ƃ«ˆÈŠO‚Í‹‘”Û if GetActiveList is TBoard then begin @@ -7774,10 +8054,12 @@ begin if (datList.Count > 0) then begin GikoSys.AddOutofIndexDat(Board, datList, False); ShowMessage(IntToStr(datList.Count) + 'ŒÂ‚Ìdatƒtƒ@ƒCƒ‹‚ªƒRƒs[‚³‚ê‚Ü‚µ‚½B' ); - if GikoForm.TreeView.Visible then + if GikoForm.TreeView.Visible then begin GikoForm.TreeView.Refresh; - if GikoForm.ListView.Visible then - GikoForm.ListView.Refresh; + end; + if GikoForm.ListView.Visible then begin + UpdateListView(); + end; end else begin ShowMessage('ˆê‚‚àƒRƒs[‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B' ); end; @@ -7790,7 +8072,25 @@ begin ShowMessage('”‚ð•\Ž¦‚µ‚Ä‚­‚¾‚³‚¢B'); end; end; - +procedure TGikoForm.UpdateListView(); +begin + //ListView‚Å‚±‚̃XƒŒ‚ªŠÜ‚Ü‚ê‚锂ð•\Ž¦‚µ‚Ä‚¢‚é‚Æ‚«‚̍XVˆ— + if (ActiveList <> nil) and (ActiveList is TBoard) then begin + TBoard(ActiveList).LogThreadCount := TBoard(ActiveList).GetLogThreadCount; + TBoard(ActiveList).NewThreadCount := TBoard(ActiveList).GetNewThreadCount; + TBoard(ActiveList).UserThreadCount:= TBoard(ActiveList).GetUserThreadCount; + //ListView‚̃AƒCƒeƒ€‚̌”‚àXV + case GikoForm.ViewType of + gvtAll: ListView.Items.Count := TBoard(ActiveList).Count; + gvtLog: ListView.Items.Count := TBoard(ActiveList).LogThreadCount; + gvtNew: ListView.Items.Count := TBoard(ActiveList).NewThreadCount; + gvtArch: ListView.Items.Count := TBoard(ActiveList).ArchiveThreadCount; + gvtLive: ListView.Items.Count := TBoard(ActiveList).LiveThreadCount; + gvtUser: ListView.Items.Count := TBoard(ActiveList).UserThreadCount; + end; + end; + ListView.Refresh; +end; //! ƒtƒ@ƒCƒ‹ƒ`ƒFƒbƒN function TGikoForm.isValidFile(FileName: String) : boolean; var @@ -7807,7 +8107,7 @@ begin end else begin // ƒƒOƒtƒ@ƒCƒ‹‚ÌŠg’£Žq‚ð‚Í‚¸‚µ‚½‚à‚Ì‚ªƒXƒŒì¬“úŽž try - dt := GikoSys.GetCreateDateFromName(FileName); + dt := GikoSys.GetCreateDateFromName(ExtractFileName(FileName)); if ((UnixToDateTime(ZERO_DATE) + OffsetFromUTC) = dt) then begin Result := False; GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '‚̃tƒ@ƒCƒ‹–¼‚ª•s³‚Å‚·B', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); @@ -7828,10 +8128,85 @@ begin FResPopupBrowser.CurrentBrowser.ChildClear; end; end; +//! ƒAƒCƒRƒ““ǂݍž‚Ý +procedure TGikoForm.LoadIcon(); +const + ICONI6 = 'icon16.bmp'; + ICON32 = 'icon32.bmp'; + ICONSTAT = 'state_icon.bmp'; + ICONMES = 'message_icon.bmp'; + ICONADD = 'address_icon.bmp'; + ICONITEM = 'item_icon.bmp'; + ICONTOOL = 'hottoolbar_icon.bmp'; +begin + if FileExists(GikoSys.Setting.GetAppDir + ICONI6) then begin + ItemIcon16.Clear; + ItemIcon16.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICONI6, clPurple); + end; + if FileExists(GikoSys.Setting.GetAppDir + ICON32) then begin + ItemIcon32.Clear; + ItemIcon32.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICON32, clPurple); + end; + if FileExists(GikoSys.Setting.GetAppDir + ICONSTAT) then begin + StateIconImageList.Clear; + StateIconImageList.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICONSTAT, clPurple); + end; + if FileExists(GikoSys.Setting.GetAppDir + ICONMES) then begin + MessageImageList.Clear; + MessageImageList.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICONMES, clPurple); + end; + if FileExists(GikoSys.Setting.GetAppDir + ICONADD) then begin + AddressImageList.Clear; + AddressImageList.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICONADD, clPurple); + end; + if FileExists(GikoSys.Setting.GetAppDir + ICONITEM) then begin + ItemImageList.Clear; + ItemImageList.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICONITEM, clPurple); + end; + if FileExists(GikoSys.Setting.GetAppDir + ICONTOOL) then begin + HotToobarImageList.Clear; + HotToobarImageList.FileLoad(rtBitmap, + GikoSys.Setting.GetAppDir + ICONTOOL, clPurple); + end; +end; + +//! ƒXƒŒƒ^ƒC•\Ž¦XV +procedure TGikoForm.UpdateThreadTitle; +var + i: Integer; + DspTitle: String; +begin + BrowserTab.Tabs.BeginUpdate; + for i := 0 to BrowserTab.Tabs.Count - 1 do begin + BrowserTab.Tabs.Strings[i] := + GikoSys.GetShortName(TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.Title, 20); + end; + BrowserTab.Tabs.EndUpdate; + + if (FActiveContent <> nil) and (FActiveContent.Thread <> nil) then begin + DspTitle := GikoSys.TrimThreadTitle(FActiveContent.Thread.Title); + BrowserNameLabel.Caption := DspTitle; + Self.Caption := GikoDataModule.CAPTION_NAME + ' - [' + DspTitle + ']'; + end; +end; + +//! ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[“ǂݍž‚Ý +procedure TGikoForm.LoadPopupMenu(); +begin + + +end; initialization OleInitialize(nil); finalization OleUninitialize; + end.