X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=Giko.pas;h=b2107acace4a144d84d48f788c8ac97752e0d63f;hb=6c0bebedd1f897c001f281e424e6ff98cfc6b9b8;hp=c704a75fd070e86e3005ca756322535eb06fb169;hpb=e999974720523047ef737f4e72511ae1eb551043;p=gikonavigoeson%2Fgikonavi.git diff --git a/Giko.pas b/Giko.pas index c704a75..b2107ac 100644 --- a/Giko.pas +++ b/Giko.pas @@ -16,17 +16,17 @@ uses ToolWin, Buttons, IdComponent, UrlMon, Tabs, IdGlobal, StrUtils, CommCtrl, Dialogs, GikoSystem, Setting, BoardGroup, ThreadControl, ItemDownload, Editor, RoundData, GikoPanel, Favorite, HTMLDocumentEvent, - HintWindow, GikoCoolBar, GikoListView, Search, ExternalBoardManager, + {HintWindow,} GikoCoolBar, GikoListView, Search, ExternalBoardManager, ExternalBoardPlugInMain, StdActns, Variants, ExtActns,IdTCPConnection, IdBaseComponent, IdTCPClient, AppEvnts, BrowserRecord, MoveHistoryItem, - ShellAPI; + ShellAPI,Preview, HistoryList, ResPopupBrowser, ExtPreviewDatamodule; const NGWORDNAME_PANEL = 3; THREADSIZE_PANEL = 2; - + USER_POPUPCLEAR = WM_USER + 2005; ///< wParam : TWebBrowser type - TGikoTreeType = (gttNone, gtt2ch, gttHistory, gttFavorite); + TToolBarSettingSenderType = (tssNone, tssMain, tssList, tssBrowser); TMinimizeType = (mtNone, mtMinimizing, mtMinimized); TResizeType = (rtNone, rtResizing); @@ -192,10 +192,6 @@ type ListToolBar: TToolBar; BrowserCoolBar: TGikoCoolBar; BrowserToolBar: TToolBar; - ToolButton3: TToolButton; - ToolButton9: TToolButton; - ToolButton11: TToolButton; - ToolButton5: TToolButton; ListNameToolBar: TToolBar; ListNameLabel: TLabel; FolderImage: TImage; @@ -284,7 +280,7 @@ type SelectItemNameCopyAction1: TMenuItem; B6: TMenuItem; T9: TMenuItem; - C2: TMenuItem; + NameCopyPMenu: TMenuItem; SelectComboBox: TComboBox; MainCoolBarPopupMenu: TPopupMenu; StdToolBarVisiblePMenu: TMenuItem; @@ -310,7 +306,6 @@ type F4: TMenuItem; N48: TMenuItem; T14: TMenuItem; - ToolButton16: TToolButton; N50: TMenuItem; A11: TMenuItem; S5: TMenuItem; @@ -346,7 +341,6 @@ type FavoriteTreeLogDeletePopupMenu: TMenuItem; N59: TMenuItem; FavoriteTreeNameURLCopyPopupMenu: TMenuItem; - ToolButton20: TToolButton; N60: TMenuItem; ExportFavoriteFileAction1: TMenuItem; N6: TMenuItem; @@ -399,7 +393,6 @@ type N73: TMenuItem; SelectComboBoxPanel: TPanel; SelectComboBoxSplitter: TImage; - ToolButton1: TToolButton; N74: TMenuItem; WikiFAQ: TMenuItem; GikoApplicationEvents: TApplicationEvents; @@ -412,8 +405,30 @@ type FavoriteTreeItemNameCopyPopupMenu: TMenuItem; N77: TMenuItem; N78: TMenuItem; + SaveThreadFile: TMenuItem; + N79: TMenuItem; + HTML1: TMenuItem; + DAT4: TMenuItem; + N80: TMenuItem; + SameBoardThreadItem: TMenuItem; + N81: TMenuItem; + N82: TMenuItem; + 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; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); + procedure SaveSettingAll(); procedure BrowserStatusTextChange(Sender: TObject; const Text: WideString); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); @@ -548,13 +563,13 @@ type procedure GetResURLMenuClick(Sender: TObject); procedure MainCoolBarContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); + procedure ResPopupClearTimerTimer(Sender: TObject); private { Private éŒ¾ } FEnabledCloseButton: Boolean; FClickNode: TTreeNode; FHttpState: Boolean; - FHint: TResPopup; - FPreviewBrowser: TWebBrowser; + FPreviewBrowser: TPreviewBrowser; FPreviewURL: string; FBrowserSizeHeight: Integer; FBrowserSizeWidth: Integer; @@ -565,7 +580,7 @@ type FActiveList: TObject; FActiveContent: TBrowserRecord; // FActiveBBS : TBBS; - FHistoryList: TList; //ƒqƒXƒgƒŠƒŠƒXƒg + FHistoryList: THistoryList; //ƒqƒXƒgƒŠƒŠƒXƒg FTreeType: TGikoTreeType; FWorkCount: Integer; FNameCookie: string; @@ -597,7 +612,10 @@ type FOrigenCaption: String; //‚¨‹C‚É“ü‚èƒcƒŠ[‚̃AƒCƒeƒ€•ÒWŽž‚̕ҏW‘O‚Ì•¶Žš—ñ FPreviewBrowserRect: TRect; ///< ƒvƒŒƒrƒ…[‚Ì•\Ž¦ˆÊ’u‚ð‹L‰¯‚·‚é FActionListGroupIndexes: array of Integer; /// '') then begin + if ( FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin + while (FActiveContent.Browser.ReadyState <> READYSTATE_COMPLETE) and + (FActiveContent.Browser.ReadyState <> READYSTATE_INTERACTIVE) do begin + // ƒƒ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; + //ShowWindow(Self.Handle, SW_SHOW); + end; end; - - //ActionList‚ÌGroupIndex‚ðŒ³‚É–ß‚· - SetGroupIndex(GikoDM.GikoFormActionList); - - FStartUp := false; end; end; @@ -1474,45 +1553,54 @@ begin Exit; end; + GikoSys.Setting.LastCloseTabURL := ''; if GikoSys.Setting.TabAutoLoadSave then begin GikoDM.TabsSaveAction.Execute; + if (GetActiveContent <> nil) and + (GetActiveContent.IsLogFile) then begin + GikoSys.Setting.LastCloseTabURL := GetActiveContent.URL; + end; end; 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; -// CoolSet: TCoolSet; wp : TWindowPlacement; - tmpBool : Boolean; + WindowPlacement: TWindowPlacement; begin - // ƒ}ƒEƒXƒWƒFƒXƒ`ƒƒ[ŠJ•ú - try - MouseGesture.UnHook; - 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); @@ -1520,8 +1608,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; @@ -1541,20 +1629,11 @@ 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; //“ü—̓AƒVƒXƒg‹@\‚̐ݒè‚Ì•Û‘¶ InputAssistDM.SaveToFile(GikoSys.GetInputAssistFileName); @@ -1562,11 +1641,75 @@ begin //‚¨‹C‚É“ü‚è•Û‘¶ try //FavoriteDM‚ÍŽ©“®¶¬ƒtƒH[ƒ€‚Ȃ̂ŁA‰ð•ú‚ÍŽ©“®“I‚É‚³‚ê‚é - FavoriteDM.WriteFavorite; + // ‰Šú‰»ˆÙíŽž‚©‚ç‚̏I—¹‚Å‚Í•Û‘¶‚µ‚È‚¢ + 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; @@ -1575,8 +1718,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; @@ -1584,6 +1733,7 @@ begin finally FBrowsers.Free; end; + try if BrowserNullTab <> nil then begin BrowserNullTab.Browser := nil; {*BrowserNullTab‚ÌBrowser‚͐݌vŽž‚É“\‚è•t‚¯‚Ä‚é“z @@ -1602,32 +1752,16 @@ 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 - SaveHistory; - except - end; try try - ClearHistory; + FHistoryList.Clear; except end; finally FHistoryList.Free; end; - //„‰ñƒŠƒXƒg•Û‘¶&”jŠü - try - RoundList.SaveRoundFile; - except - end; + try try RoundList.Clear; @@ -1638,13 +1772,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 @@ -1667,6 +1802,7 @@ begin BBSs[ i ].Free; BBSs[ i ] := nil; end; + DestorySpecialBBS(BoardGroup.SpecialBBS); except end; @@ -1674,20 +1810,27 @@ begin if FEvent <> nil then FEvent.Free; - //Hint”jŠü - if FHint <> nil then begin - FHint.ReleaseHandle; - FHint.Free; - FHint := nil; - end; + try + if FResPopupBrowser <> nil then begin + TOleControl(FResPopupBrowser).Parent := nil; + FResPopupBrowser.Free; + end; + + except + end; //Preview”jŠü - if TPreviewBrowser <> nil then begin + if FPreviewBrowser <> nil then begin FPreviewBrowser.Free; FPreviewBrowser := nil; end; except end; - LockWindowUpdate(0); + + // Update‚ª‚¢‚ê‚ÎŽÀs‚·‚é + if FileExists(FUpdateExePath) then begin + // ƒAƒbƒvƒf[ƒgŽÀs + GikoSys.CreateProcess(FUpdateExePath, FUpdateExeArgs); + end; end; // ŠeŠ‚É‚ ‚éƒLƒƒƒrƒlƒbƒgE BBS ƒƒjƒ…[‚ðƒZƒbƒg^XV @@ -1762,8 +1905,8 @@ begin //—š—ð‚Ì•Û‘¶‚Æ”jŠü try - SaveHistory; - ClearHistory; + FHistoryList.SaveToFile(GikoSys.GetConfigDir + 'History.xml'); + FHistoryList.Clear; except end; @@ -1814,7 +1957,8 @@ begin ShowBBSTree( BBSs[ 0 ] ); // —š—ð“ǂݍž‚Ý - LoadHistory; + FHistoryList.LoadFromFile(GikoSys.GetConfigDir + 'History.xml', + TreeView, FTreeType); //‚¨‹C‚É“ü‚è“ǂݍž‚Ý FavoriteDM.ReadFavorite; @@ -1852,30 +1996,41 @@ var e: IHTMLElement; Ext: string; PathRec: TPathRec; - Text2: string; -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; + 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; + 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), '') @@ -1886,26 +2041,64 @@ begin Exit; end; + // ‘O‰ñ‚Æ“¯‚¶ê‡I—¹ + if (StatusBar.Panels[1].Text = Text2) then begin + if Text2 = '' then begin + if FResPopupBrowser <> nil then begin + if not(Sender is TResPopupBrowser) then + FResPopupBrowser.Clear + else begin + TResPopupBrowser(Sender).ChildClear; + end; + end; + end; + Exit; + end; StatusBar.Panels[1].Text := Text2; - if FHint <> nil then begin - FHint.ReleaseHandle; - FHint.ClearAllRes; - end; + if FPreviewBrowser <> nil then ShowWindow(FPreviewBrowser.Handle, SW_HIDE); - if not GikoSys.Setting.UnActivePopup then - if not GikoForm.Active then - Exit; + if FResPopupBrowser <> nil then begin + if not(Sender is TResPopupBrowser) then begin + if (FResPopupBrowser.Visible) then begin + if ResPopupClearTimer.Interval > 0 then begin + ResPopupClearTimer.Enabled := True; + ResPopupClearTimer.Tag := 0; + end else begin + FResPopupBrowser.Clear; + end; + end; + end else begin + if ResPopupClearTimer.Interval > 0 then begin + ResPopupClearTimer.Enabled := True; + ResPopupClearTimer.Tag := 1; + end else begin + TResPopupBrowser(Sender).ChildClear; + end; + end; + end; + cResPopup := nil; + + if not(Sender is TResPopupBrowser) then + if not GikoSys.Setting.UnActivePopup then + if not GikoForm.Active then + Exit; + + //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 + ((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); @@ -1916,29 +2109,49 @@ begin PreviewTimer.Interval := GikoSys.Setting.PreviewWait; PreviewTimer.Enabled := True; end else if (Pos('about:blank', Text2) = 1) or (Pos('http://', Text2) = 1) or (Pos('mailto:', Text2) = 1) then begin - if Pos('mailto:', Text2) = 1 then begin + if (Pos('mailto:', Text2) = 1) and (GikoSys.Setting.RespopupMailTo) then 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 - tmp2 := ZenToHan(e.Get_outerText); + CreateResPopupBrowser; + + if not(Sender is TResPopupBrowser) then begin + if (FResPopupBrowser.Visible) then begin + FResPopupBrowser.Clear; + end; + end else begin + TResPopupBrowser(Sender).ChildClear; + end; + + cResPopup := FResPopupBrowser.CreateNewBrowser; + tmp2 := Trim(ZenToHan(e.Get_outerText)); if (GikoSys.IsNumeric(tmp2)) then begin //‚“‚̓ŒƒX”ԍ†‚Á‚Û‚¢‚Á‚·B wkIntSt := StrToInt64(tmp2); wkIntTo := StrToInt64(tmp2); - //s := GetThreadText(wkBBS, wkKey, wkIntSt, wkIntTo, False, False); - FHint.PopupType := gptThread; - HTMLCreater.SetResPopupText(FHint, GetActiveContent, wkIntSt, wkIntTo, False, False); + cResPopup.PopupType := gptThread; + HTMLCreater.SetResPopupText(cResPopup, GetActiveContent(true), wkIntSt, wkIntTo, False, False); end else begin - FHint.PopupType := gptRaw; - FHint.Caption := s; + cResPopup.PopupType := gptRaw; + cResPopup.Title := s; end; end; end else begin - threadItem := GetActiveContent; + CreateResPopupBrowser; + + if not(Sender is TResPopupBrowser) then begin + if (FResPopupBrowser.Visible) then begin + FResPopupBrowser.Clear; + end; + end else begin + TResPopupBrowser(Sender).ChildClear; + end; + + threadItem := GetActiveContent(true); URL := THTMLCreate.GetRespopupURL(Text2, threadItem.URL); PathRec := Gikosys.Parse2chURL2(URL); if (PathRec.FNoParam) then begin @@ -1990,19 +2203,27 @@ begin wkIntSt := 1; wkIntTo := 1; end; - FHint.PopupType := gptThread; - HTMLCreater.SetResPopupText(FHint, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst ); + cResPopup := FResPopupBrowser.CreateNewBrowser; + cResPopup.PopupType := gptThread; + HTMLCreater.SetResPopupText(cResPopup, threadItem, wkIntSt, wkIntTo, ATitle, PathRec.FFirst ); end; end; end; + if (cResPopup <> nil) then begin + ResPopupClearTimer.Enabled := False; - if FHint.PopupType = gptRaw then begin - if FHint.Caption <> '' then - ShowTextPopup; - end else begin - if (FHint.ResCount <> 0) or (FHint.Title <> '') then - ShowTextPopup; - end; + if cResPopup.PopupType = gptRaw then begin + if cResPopup.Title <> '' then begin + cResPopup.TitlePopup; + end; + end else begin + if cResPopup.RawDocument <> '' then begin + cResPopup.Popup; + end else if cResPopup.Title <> '' then begin + cResPopup.TitlePopup; + end; + end; + end; end; end; @@ -2121,6 +2342,7 @@ var ARect: TRect; begin DefaultDraw := True; +// ‚È‚º‚©–³ðŒ‚ÅExit‚µ‚Ä‚¢‚é Exit; DefaultDraw := False; if (cdsSelected in State) or (cdsHot in State) then begin @@ -2160,18 +2382,41 @@ var const kMenuName: string = 'menu:'; 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; GetCursorpos(p); + 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; @@ -2313,6 +2558,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; // ************************************************************************* @@ -2327,6 +2574,8 @@ var Res : TResRec; begin try + if csDestroying in Self.ComponentState then + Exit; if Item.DownType = gdtBoard then ATitle := Item.Board.Title else @@ -2404,26 +2653,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; @@ -2468,6 +2706,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; @@ -2477,6 +2718,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‚ªŠ®—¹‚µ‚Ü‚µ‚½'; @@ -2484,6 +2727,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) + ')'; @@ -2510,6 +2755,19 @@ begin end; end; +//! ‚à‚Á‚Æ‚àŒÃ‚¢Browser‚ÌŠJ•ú +procedure TGikoForm.ReleaseOldestBrowser; +var + i: Integer; +begin + for i := BrowserTab.Tabs.Count - 1 downto 0 do begin + if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = + TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin + ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i])); + break; + end; + end; +end; function TGikoForm.InsertBrowserTab( ThreadItem : TThreadItem; @@ -2519,6 +2777,7 @@ var i, j, idx : Integer; favItem : TFavoriteThreadItem; newBrowser : TBrowserRecord; + ins : Integer; begin Result := nil; @@ -2534,7 +2793,7 @@ begin FBrowsers.Move(BROWSER_COUNT - 1, 0); end; favItem := TFavoriteThreadItem.Create(ThreadItem.URL, ThreadItem.Title ); - if not AddHistory( favItem ) then + if not FHistoryList.AddHistory( favItem, TreeView, FTreeType ) then favItem.Free; for i := 0 to BrowserTab.Tabs.Count - 1 do begin @@ -2542,12 +2801,8 @@ begin if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread = ThreadItem then begin Result := TBrowserRecord( BrowserTab.Tabs.Objects[i] ); if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = nil then begin - for j := BrowserTab.Tabs.Count - 1 downto 0 do begin - if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin - ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); - break; - end; - end; + //ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é + ReleaseOldestBrowser; TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); TBrowserRecord(BrowserTab.Tabs.Objects[i]).Repaint := true; FBrowsers.Move(BROWSER_COUNT - 1, 0); @@ -2562,21 +2817,15 @@ begin end; end; idx := BrowserTab.TabIndex; - if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin - newBrowser := TBrowserRecord.Create; - for j := BrowserTab.Tabs.Count - 1 downto 0 do begin - if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin - ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); - break; - end; - end; - newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); - FBrowsers.Move(BROWSER_COUNT - 1, 0); - //newBrowser.Browser.Navigate(BLANK_HTML); - newBrowser.thread := ThreadItem; - newBrowser.Repaint := true; -// newBrowser.OnlyHundred := GikoSys.OnlyAHundredRes; + newBrowser := TBrowserRecord.Create; + // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é + ReleaseOldestBrowser; + newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); + FBrowsers.Move(BROWSER_COUNT - 1, 0); + newBrowser.thread := ThreadItem; + newBrowser.Repaint := true; + if GikoSys.Setting.BrowserTabAppend = gtaFirst then begin BrowserTab.Tabs.InsertObject(0, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser); if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) ); @@ -2586,22 +2835,7 @@ begin if ActiveTab then begin BrowserTab.TabIndex := 0; end; - - end else begin - newBrowser := TBrowserRecord.Create; - for j := BrowserTab.Tabs.Count - 1 downto 0 do begin - if TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin - ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); - break; - end; - end; - newBrowser.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); - FBrowsers.Move(BROWSER_COUNT - 1, 0); - //newBrowser.Browser.Navigate(BLANK_HTML); - newBrowser.thread := ThreadItem; -// newBrowser.OnlyHundred := GikoSys.OnlyAHundredRes; - newBrowser.Repaint := true; - + end else if GikoSys.Setting.BrowserTabAppend = gtaLast then begin i := BrowserTab.Tabs.AddObject(GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser); if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) ); @@ -2614,7 +2848,40 @@ begin else BrowserTab.TabIndex := i; end; - end; + end else begin + // ƒ^ƒuˆÊ’u‚ðŽæ“¾ + ins := -1; + for i := BrowserTab.Tabs.Count - 1 downto 0 do begin + if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = + TWebBrowser(FBrowsers[1]) then begin + ins := i; + break; + end; + end; + if GikoSys.Setting.BrowserTabAppend = gtaRight then begin + Inc(ins); + end; + // ƒ^ƒu‚ª–³‚¢‚Æ‚«‚ȂǑ΍ô + if (ins < 0) then begin + ins := 0; + end; + BrowserTab.Tabs.InsertObject(ins, GikoSys.GetShortName(ThreadItem.Title, 20), newBrowser); + if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 1) then begin + if GikoSys.Setting.BrowserTabAppend = gtaRight then begin + DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 0 ] ) ); + end else begin + DeleteTab( TBrowserRecord( BrowserTab.Tabs.Objects[ 1 ] ) ); + end; + end; + //end; + BrowserTab.Repaint; + if ActiveTab then begin + if (not GikoSys.Setting.BrowserTabVisible) and (BrowserTab.Tabs.Count > 0) then + BrowserTab.TabIndex := 0 + else + BrowserTab.TabIndex := ins; + end; + end; Result := newBrowser; if(ActiveTab) or (idx = -1) then begin BrowserTab.OnChange(nil); @@ -2643,9 +2910,8 @@ var BBSID: string; FileName: string; sTitle: string; - doc: Variant; + doc: OleVariant; s: string; - i: Integer; idx: Integer; ThreadItem: TThreadItem; Thread: TBrowserRecord; @@ -2654,17 +2920,18 @@ var begin Thread := inThread; idx := BrowserTab.TabIndex; - if (FActiveContent <> nil) and + if (not FStartUp) and + (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; @@ -2682,12 +2949,8 @@ begin end else if Thread.Browser = nil then begin if FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then FBrowsers.Move(BROWSER_COUNT - 1, 0); - for i := BrowserTab.Tabs.Count - 1 downto 0 do begin - if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin - ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i])); - break; - end; - end; + // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é + ReleaseOldestBrowser; Thread.Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); FBrowsers.Move(BROWSER_COUNT - 1, 0); end; @@ -2695,6 +2958,12 @@ begin ThreadTitle := Thread.Thread.Title; ThreadPTitle := Thread.Thread.ParentBoard.Title; //ThreadScrollTop := Thread.Thread.ScrollTop; + if Thread.Thread.IsLogFile then begin + if not FileExists(Thread.Thread.GetThreadFileName) then begin + Thread.Thread.DeleteLogFile; + end; + end; + ThreadIsLog := Thread.Thread.IsLogFile; ThreadItem := Thread.Thread; ThreadNewArraical := Thread.Thread.NewArrival; @@ -2714,7 +2983,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 @@ -2752,7 +3021,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); @@ -2785,12 +3054,17 @@ begin end; end; -function TGikoForm.GetActiveContent: TThreadItem; +function TGikoForm.GetActiveContent(popup :Boolean = false): TThreadItem; begin try - if FActiveContent <> nil then - Result := FActiveContent.Thread - else + if FActiveContent <> nil then begin + Result := FActiveContent.Thread; + if (popup) and + (FResPopupBrowser <> nil) and (FResPopupBrowser.CurrentBrowser.Visible = True) then + if (FResPopupBrowser.CurrentBrowser.Thread <> nil) then begin + Result := FResPopupBrowser.CurrentBrowser.Thread; + end; + end else Result := nil; except Result := nil; @@ -2879,6 +3153,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); @@ -3014,209 +3291,10 @@ begin end; end; -function TGikoForm.AddHistory( favItem : TFavoriteThreadItem ): Boolean; -var - i: Integer; - Item: TFavoriteThreadItem; - Node: TTreeNode; -begin -// Result := False; -// if (GetActiveContent = ThreadItem) and -// (ThreadItem.Count <= ThreadItem.Kokomade) then -// Exit; -// if GetActiveContent = ThreadItem then -// Exit; - - Result := True; - if FTreeType = gttHistory then - TreeView.Selected := nil; - - for i := 0 to FHistoryList.Count - 1 do begin - if TObject(FHistoryList[i]) is TFavoriteThreadItem then begin - Item := TFavoriteThreadItem(FHistoryList[i]); - if Item.URL = favItem.URL then begin -// SetContent(ThreadItem); - FHistoryList.Move(i, 0); - if FTreeType = gttHistory then - if TreeView.Items.GetFirstNode <> TreeView.Items[ i ] then - TreeView.Items[ i ].MoveTo( TreeView.Items.GetFirstNode, naInsert ); - Result := false; - Exit; - end; - end; - end; - - if FHistoryList.Count > 0 then - FHistoryList.Insert( 0, favItem ) - else - FHistoryList.Add( favItem ); -// SetContent(ThreadItem); -// while GikoSys.Setting.AddressHistoryCount < FHistoryList.Count do begin - while GikoSys.Setting.MaxRecordCount < FHistoryList.Count do begin - i := FHistoryList.Count - 1; - TObject( FHistoryList.Items[ i ] ).Free; - FHistoryList.Delete( i ); - end; - - if FTreeType = gttHistory then begin - Node := TreeView.Items.Add( nil, favItem.Title ); - Node.MoveTo( TreeView.Items.GetFirstNode, naInsert ); - { - if favItem.NewArrival then begin - Node.ImageIndex := ITEM_ICON_THREADNEW1; - Node.SelectedIndex := ITEM_ICON_THREADNEW2; - end else begin - Node.ImageIndex := ITEM_ICON_THREADLOG1; - Node.SelectedIndex := ITEM_ICON_THREADLOG2; - end; - } - // •‰‰×‚ð‚©‚¯‚½‚­‚È‚¢‚Ì‚Å NewArrival ‚̃`ƒFƒbƒN‚ðs‚í‚È‚¢ - // ¦favItem.Item ƒvƒƒpƒeƒB‚Í dat ‚̓ǂݍž‚Ý‚ð•K—v‚Æ‚·‚é - Node.ImageIndex := ITEM_ICON_THREADLOG1; - Node.SelectedIndex := ITEM_ICON_THREADLOG2; - Node.Data := favItem; - //while GikoSys.Setting.AddressHistoryCount < TreeView.Items.Count do begin - while GikoSys.Setting.MaxRecordCount < TreeView.Items.Count do begin - i := TreeView.Items.Count - 1; - TreeView.Items.Item[ i ].Delete; - end; - end; -end; - +//—š—ð‚©‚çíœ procedure TGikoForm.DeleteHistory( threadItem: TThreadItem ); -var - i: Integer; - node: TTreeNode; -begin - // ƒLƒƒƒrƒlƒbƒg‚É—š—ð‚ª•\Ž¦‚³‚ê‚Ä‚¢‚½‚çA - // ƒLƒƒƒrƒlƒbƒg“à‚̃AƒCƒeƒ€‚àíœ‚·‚éB - if (FTreeType = gttHistory) then begin - node := TreeView.Items.GetFirstNode; - while (node <> nil) do begin - if ( TFavoriteThreadItem(node.Data).Item = threadItem ) then begin - TreeView.Items.Delete(node); - TreeView.Refresh; - node := nil; - end else begin - node := node.GetNext; - end; - end; - end; - for i := 0 to FHistoryList.Count - 1 do begin - if threadItem = TFavoriteThreadItem( FHistoryList.Items[i] ).Item then begin - TFavoriteThreadItem( FHistoryList.Items[ i ] ).Free; - FHistoryList.Delete(i); - FHistoryList.Capacity := FHistoryList.Count; - Break; - end; - end; -end; - -procedure TGikoForm.ClearHistory; -var - i : Integer; begin - //FHistoryList.Clear; - - try - for i := FHistoryList.Count - 1 downto 0 do begin - if TObject(FHistoryList[ i ]) is TFavoriteThreadItem then - TFavoriteThreadItem(FHistoryList[ i ]).Free - else if TObject(FHistoryList[ i ]) is TFavoriteBoardItem then - TFavoriteBoardItem(FHistoryList[ i ]).Free; - - //FHistoryList.Delete(i); - end; - except - end; - - FHistoryList.Clear; - FHistoryList.Capacity := FHistoryList.Count; - -end; - -procedure TGikoForm.SaveHistory; -var - i, bound : Integer; - saveList : TstringList; -begin - - saveList := TStringList.Create; - try - FHistoryList.Pack; - FHistoryList.Capacity := FHistoryList.Count; - saveList.Add(''); - saveList.Add('
'); - bound := FHistoryList.Count - 1; - for i := bound downto 0 do begin - // title ‚͍¡‚Ì‚Æ‚±‚ëŽg‚Á‚Ä‚¢‚È‚¢ - saveList.Add( - ''); - end; - saveList.Add('
'); - saveList.SaveToFile( GikoSys.GetConfigDir + 'History.xml' ); - finally - saveList.Free; - end; - -end; - -procedure TGikoForm.LoadHistory; -var - i, bound : Integer; - fileName : string; - XMLDoc : IXMLDocument; - XMLNode : IXMLNode; - HistoryNode : IXMLNode; - s : string; - favItem : TFavoriteThreadItem; -{$IFDEF DEBUG} - st, rt : Cardinal; -{$ENDIF} -begin -{$IFDEF DEBUG} - st := GetTickCount; -{$ENDIF} - - fileName := GikoSys.GetConfigDir + 'History.xml'; - - if FileExists( fileName ) then begin - try - XMLDoc := IXMLDocument.Create; - //XMLDoc := LoadXMLDocument(FileName); - LoadXMLDocument(FileName, XMLDoc); - try - XMLNode := XMLDoc.DocumentElement; - - if XMLNode.NodeName = 'address' then begin - bound := XMLNode.ChildNodes.Count - 1; - for i := 0 to bound do begin - HistoryNode := XMLNode.ChildNodes[i]; - if HistoryNode.NodeName = 'history' then begin - //if FReadCount >= sl.Count then begin - s := Trim(HistoryNode.Attributes['url']); - if s <> '' then begin - favItem := TFavoriteThreadItem.Create( - s, MojuUtils.UnSanitize(HistoryNode.Attributes[ 'title' ]) ); - if not AddHistory( favItem ) then - favItem.Free; - end; - //end; - end; - end; - end; - finally - XMLDoc.Free; - end; - except - end; - end; -{$IFDEF DEBUG} - rt := GetTickCount - st; - Writeln('Runtime(Load Histroy) : ' + IntToStr(rt) + ' ms'); -{$ENDIF} - + FHistoryList.DeleteHistory( threadItem, TreeView, TreeType ); end; procedure TGikoForm.ShowBBSTreeOld( @@ -3378,43 +3456,11 @@ begin FTreeType := gttHistory; HistoryToolBar.Show; FavoriteToolBar.Hide; - SetHistoryTreeNode; + FHistoryList.SetTreeNode( TreeView ); CabinetSelectToolButton.Caption := '—š—ðƒŠƒXƒg'; end; end; -procedure TGikoForm.SetHistoryTreeNode; -var - i: Integer; - Node: TTreeNode; - Item: TFavoriteThreadItem; -begin - TreeView.Items.BeginUpdate; - try - TreeView.Items.Clear; - for i := 0 to FHistoryList.Count - 1 do begin - Item := TFavoriteThreadItem(FHistoryList[i]); - Node := TreeView.Items.Add(nil, Item.Title); - { - if Item.Item.NewArrival then begin - Node.ImageIndex := ITEM_ICON_THREADNEW1; - Node.SelectedIndex := ITEM_ICON_THREADNEW2; - end else begin - Node.ImageIndex := ITEM_ICON_THREADLOG1; - Node.SelectedIndex := ITEM_ICON_THREADLOG2; - end; - } - // •‰‰×‚ð‚©‚¯‚½‚­‚È‚¢‚Ì‚Å NewArrival ‚̃`ƒFƒbƒN‚ðs‚í‚È‚¢ - // ¦Item.Item ƒvƒƒpƒeƒB‚Í dat ‚̓ǂݍž‚Ý‚ð•K—v‚Æ‚·‚é - Node.ImageIndex := ITEM_ICON_THREADLOG1; - Node.SelectedIndex := ITEM_ICON_THREADLOG2; - Node.Data := Item; - end; - finally - TreeView.Items.EndUpdate; - end; -end; - procedure TGikoForm.SelectTreeNode(Item: TObject; CallEvent: Boolean); var ChangeEvent: TTVChangedEvent; @@ -3612,7 +3658,14 @@ begin FActiveContent.Move(AName); end; end; - +//Œ»Ý•\Ž¦‚µ‚Ä‚¢‚éƒXƒŒƒbƒh‚ðƒXƒNƒ[ƒ‹ +procedure TGikoForm.BrowserMovement(scroll: Integer); +begin + if(BrowserTab.Tabs.Count > 0) and (BrowserTab.TabIndex >= 0) + and (FActiveContent <> nil) then begin + FActiveContent.Move(scroll); + end; +end; procedure TGikoForm.TreeViewCollapsed(Sender: TObject; Node: TTreeNode); begin if TObject(Node.Data) is TBBS then begin @@ -3702,27 +3755,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 - 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 @@ -3743,16 +3801,12 @@ 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 - for j := BrowserTab.Tabs.Count - 1 downto 0 do begin - if(TBrowserRecord(BrowserTab.Tabs.Objects[j]).Browser - = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) )then - begin - ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[j])); - break; - end; - end; + // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é + ReleaseOldestBrowser; + TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); TBrowserRecord(BrowserTab.Tabs.Objects[BrowserTab.TabIndex]).Repaint := true; @@ -3797,7 +3851,7 @@ begin LPMSep06.Visible := bCategory or bBoard; BoardFavoriteAddMenu.Visible := bCategory; ThreadFavoriteAddMenu.Visible := bBoard; - + SaveThreadFile.Visible := bBoard; AddRoundNameMenu(ItemReservPMenu); AddRoundNameMenu(ListReservPMenu); end; @@ -3900,75 +3954,101 @@ 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; + + 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 - if wkIntSt <> 0 then begin - FActiveContent.IDAnchorPopup(''); - MoveHisotryManager.pushItem(FActiveContent); - BrowserMovement(IntToStr(wkIntSt)); - end; + 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; - 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; + + 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; + 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; + 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; - MoveHisotryManager.pushItem(FActiveContent); - MoveToURL( URL ); end; + if (Sender is TResPopupBrowser) then begin + TResPopupBrowser(Sender).ChildClear + end; + + MoveHisotryManager.pushItem(FActiveContent); + MoveToURL( URL ); end; end; @@ -4024,7 +4104,7 @@ end; procedure TGikoForm.BrowserTabChange(Sender: TObject); var - i, j: Integer; + j: Integer; idx: Integer; begin BrowserTab.Tabs.BeginUpdate; @@ -4047,12 +4127,9 @@ begin (FActiveContent.Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1])) then FBrowsers.Move(BROWSER_COUNT - 1, 0); - for i := 0 to BrowserTab.Tabs.Count - 1 do begin - if TBrowserRecord(BrowserTab.Tabs.Objects[i]).Browser = TWebBrowser(FBrowsers[BROWSER_COUNT - 1]) then begin - ReleaseBrowser(TBrowserRecord(BrowserTab.Tabs.Objects[i])); - break; - end; - end; + // ˆê”Ԍ¢ƒuƒ‰ƒEƒU‚ðŠJ•ú‚·‚é + ReleaseOldestBrowser; + TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Browser := TWebBrowser(FBrowsers[BROWSER_COUNT - 1]); TBrowserRecord(BrowserTab.Tabs.Objects[idx]).Repaint := true; FBrowsers.Move(BROWSER_COUNT - 1, 0); @@ -4165,6 +4242,7 @@ procedure TGikoForm.BrowserTabDragDrop(Sender, Source: TObject; X, var idx: Integer; begin + FDragWFirst := False; idx := BrowserTab.IndexOfTabAt(X, Y); if idx <> -1 then BrowserTab.Tabs.Move(BrowserTab.TabIndex, idx); @@ -4179,14 +4257,11 @@ begin TabIdx := BrowserTab.IndexOfTabAt(x, y); - if ( ssLeft in Shift ) and ( BrowserTab.Style = tsTabs ) then begin - if FDragWFirst = false then begin - FDragWFirst := true; - end else begin + if ( ssLeft in Shift ) then begin + if (FDragWFirst) then begin BrowserTab.EndDrag(false); BrowserTab.BeginDrag(false, DandD_THRESHOLD); - FDragWFirst := false; - end; + end; end else begin BrowserTab.EndDrag(false); FDragWFirst := false; @@ -4210,10 +4285,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 @@ -4228,17 +4302,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 @@ -4276,8 +4348,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); @@ -4322,7 +4394,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; @@ -4411,7 +4483,6 @@ begin MenuToolBar.Buttons[0].AutoSize := True; MainCoolBar.AutoSize := False; MainCoolBar.AutoSize := True; - GikoSys.MenuFont(ListCoolBar.Font); GikoSys.MenuFont(BrowserCoolBar.Font); // MenuToolBar.Font.Color := clMenuText; @@ -4603,7 +4674,7 @@ var stRes, edRes : Int64; browserRec : TBrowserRecord; threadNumber : String; - doc : Variant; + doc : IHTMLDocument2; begin stRes := 0; edRes := 0; @@ -4631,15 +4702,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; @@ -4656,17 +4728,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 @@ -4810,7 +4883,7 @@ end; procedure TGikoForm.BrowserEnter(Sender: TObject); begin - Browser.DoObjectVerb(OLEIVERB_UIACTIVATE); + Browser.DoObjectVerb(OLEIVERB_UIACTIVATE); end; procedure TGikoForm.WMCopyData(var Message: TWMCopyData); @@ -4833,8 +4906,8 @@ end; procedure TGikoForm.WndProc(var Message: TMessage); var - senderBrowser : TWebBrowser; - url : OleVariant; + senderBrowser : TWebBrowser; + url : OleVariant; begin try case Message.Msg of @@ -4842,8 +4915,10 @@ begin if not (ssAlt in KeyDataToShiftState(TWMChar(Message).KeyData)) then Exit; WM_SYSCOMMAND: - if Message.WParam = SC_MINIMIZE then + if Message.WParam = SC_MINIMIZE then begin OnMinimize; + PostMessage(Handle, USER_MINIMIZED, 0, 0); + end; USER_TREECLICK: TreeClick( TreeView.Selected ); USER_RESIZED: @@ -4851,10 +4926,9 @@ begin USER_MINIMIZED: begin if (GikoSys.Setting.StoredTaskTray) then begin - // ƒ^ƒXƒNƒgƒŒƒC‚ɃAƒCƒRƒ“‚ð’ljÁ‚·‚é StoredTaskTray; end; - OnMinimized; + OnMinimized; end; USER_SETLINKBAR: SetLinkBar; @@ -4864,6 +4938,17 @@ begin senderBrowser := TWebBrowser( Message.WParam ); BrowserDocumentComplete( senderBrowser, senderBrowser.Parent, url ); end; + 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; inherited; @@ -4919,141 +5004,51 @@ procedure TGikoForm.PreviewTimerTimer(Sender: TObject); var p: TPoint; ARect: TRect; - sl: TStringList; - html: string; - HtmlFileName: string; - - NavURL: OleVariant; - Flags: OleVariant; - TargetFrameName: OleVariant; - PostData: OleVariant; - Headers: OleVariant; - WindowHeight: Integer; - WindowWidth: Integer; - -// Style: Longint; - Referer: string; - Protocol, Host, Path, Document, Port, Bookmark: string; begin PreviewTimer.Enabled := False; GetCursorpos(p); - case GikoSys.Setting.PreviewSize of - gpsXSmall: begin - WindowWidth := 128; - WindowHeight := 96; - end; - gpsSmall: begin - WindowWidth := 256; - WindowHeight := 192; - end; - gpsLarge: begin - WindowWidth := 512; - WindowHeight := 384; - end; - gpsXLarge: begin - WindowWidth := 640; - WindowHeight := 480; - end; - else begin //gpsMedium - WindowWidth := 384; - WindowHeight := 288; - end; - end; - - ARect := Rect(0, 0, WindowWidth, WindowHeight); - - case GikoSys.Setting.PopupPosition of - gppRightTop: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - (ARect.Bottom - ARect.Top) - 15); - gppRight: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - ((ARect.Bottom - ARect.Top) div 2)); - gppRightBottom: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y + 15); - gppTop: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - (ARect.Bottom - ARect.Top) - 15); - gppCenter: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - ((ARect.Bottom - ARect.Top) div 2)); - gppBottom: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y + 15); - gppLeftTop: OffsetRect(ARect, p.x + 15, p.y - (ARect.Bottom - ARect.Top) - 15); - gppLeft: OffsetRect(ARect, p.x + 15, p.y - ((ARect.Bottom - ARect.Top) div 2)); - gppLeftBottom: OffsetRect(ARect, p.x + 15, p.y + 15); //ƒMƒRƒiƒrƒXƒŒ ƒp[ƒg‚P‚Ì453Ž‚ÉŠ´ŽÓ - end; - - html := ''#13#10 - + ''#13#10 - + ''#13#10 - + ''#13#10 - + '
ƒvƒŒƒrƒ…[ì¬’†
'#13#10 - + '
'#13#10 - + ''; - sl := TStringList.Create; - try - try - HtmlFileName := GikoSys.GetAppDir + HTML_FILE_NAME; - sl.Text := AnsiReplaceStr(html, '%ImageURL%', FPreviewURL); - sl.SaveToFile(HtmlFileName); - finally - sl.Free; - end; - except - end; + ARect := FPreviewBrowser.GetWindowRect(p); + + FPreviewBrowser.PreviewImage(FPreviewURL); + + if ARect.Bottom > Screen.DesktopHeight then begin + OffsetRect(ARect, 0, -(ARect.Bottom - Screen.DesktopHeight)); + end; + if (ARect.Right > Screen.DesktopWidth) then begin + OffsetRect(ARect, -(ARect.Right - Screen.DesktopWidth), 0); + end; + if (ARect.Left < Screen.DesktopLeft) then begin + OffsetRect(ARect, +(Screen.DesktopLeft - ARect.Left), 0); + end; + if (ARect.Top < Screen.DesktopTop) then begin + OffsetRect(ARect, 0, (Screen.DesktopTop - ARect.Top)); + end; + + SetWindowPos(FPreviewBrowser.Handle, HWND_TOPMOST, + ARect.Left, ARect.Top, + (ARect.Right - ARect.Left), (ARect.Bottom - ARect.Top), + SWP_NOACTIVATE or SWP_HIDEWINDOW); - NavURL := HtmlFileName; - Flags := 0; - TargetFrameName := ''; - PostData := ''; - - GikoSys.ParseURI(FPreviewURL, Protocol, Host, Path, Document, Port, Bookmark); - Referer := Protocol + '://' + Host; - if Port <> '' then - Referer := Referer + ':' + Port; - Referer := Referer + Path; - Headers := 'Referer: ' + Referer; - FPreviewBrowser.Navigate(NavURL, Flags, TargetFrameName, PostData, Headers); - if ARect.Top + WindowHeight > Screen.DesktopHeight then - ARect.Top := Screen.DesktopHeight - WindowHeight; - if ARect.Left + WindowWidth > Screen.DesktopWidth then - ARect.Left := Screen.DesktopWidth - WindowWidth; - if ARect.Left < Screen.DesktopLeft then ARect.Left := Screen.DesktopLeft; - if ARect.Bottom < Screen.DesktopTop then ARect.Bottom := Screen.DesktopTop; - - SetWindowPos(FPreviewBrowser.Handle, HWND_TOPMOST, ARect.Left, ARect.Top, WindowWidth, WindowHeight, SWP_NOACTIVATE or SWP_HIDEWINDOW); ShowWindow(FPreviewBrowser.Handle, SW_SHOWNOACTIVATE); FPreviewBrowserRect := ARect; -// Style := GetWindowLong(FPreviewBrowser.Handle, GWL_EXSTYLE); -// SetWindowLong(FPreviewBrowser.Handle, GWL_EXSTYLE, Style xor WS_EX_APPWINDOW); - end; procedure TGikoForm.WMSetCursor(var Message: TWMSetCursor); var Pos : TPoint; begin - if PreviewTimer.Enabled then PreviewTimer.Enabled := False; - if (FHint <> nil) and (IsWindowVisible(FHint.Handle)) then begin - FHint.ReleaseHandle; - FHint.ClearAllRes; - 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 @@ -5080,7 +5075,7 @@ end; function TGikoForm.OnDocumentContextMenu(Sender: TObject): WordBool; var - Doc: IHtmlDocument2; + doc: IHtmlDocument2; Range: IHTMLTxtRange; s: string; Num: Integer; @@ -5088,66 +5083,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 - - ThreadItem := GetActiveContent; - if ThreadItem <> nil then begin - Num := StrToInt64(s); - FHint.PopupType := gptThread; - HTMLCreater.SetResPopupText(FHint, ThreadItem, Num, Num, False, False); - if FHint.ResCount <> 0 then - ShowTextPopup; - Result := False; - end else - Result := True; - end else begin - Result := True; - end; - end; -end; -procedure TGikoForm.ShowTextPopup; -var - p: TPoint; - ARect: TRect; -begin -// if Trim(s) = '' then -// Exit; - try - FHint.Font.Name := GikoSys.Setting.HintFontName; - FHint.Font.Size := GikoSys.Setting.HintFontSize; - FHint.Font.Color := GikoSys.Setting.HintFontColor; - FHint.Color := GikoSys.Setting.HintBackColor; - FHint.HeaderBold := GikoSys.Setting.ResPopupHeaderBold; - GetCursorpos(p); - if FHint.PopupType = gptRaw then - ARect := FHint.CalcHintRect(Screen.Width, FHint.Caption, nil) - else - ARect := FHint.CalcHintRect(Screen.Width, '', nil); - case GikoSys.Setting.PopupPosition of - gppRightTop: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - (ARect.Bottom - ARect.Top) - 15); - gppRight: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y - ((ARect.Bottom - ARect.Top) div 2)); - gppRightBottom: OffsetRect(ARect, p.x - (ARect.Right - ARect.Left) - 15, p.y + 15); - gppTop: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - (ARect.Bottom - ARect.Top) - 15); - gppCenter: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y - ((ARect.Bottom - ARect.Top) div 2)); - gppBottom: OffsetRect(ARect, p.x - ((ARect.Right - ARect.Left) div 2), p.y + 15); - gppLeftTop: OffsetRect(ARect, p.x + 15, p.y - (ARect.Bottom - ARect.Top) - 15); - gppLeft: OffsetRect(ARect, p.x + 15, p.y - ((ARect.Bottom - ARect.Top) div 2)); - gppLeftBottom: OffsetRect(ARect, p.x + 15, p.y + 15); //ƒMƒRƒiƒrƒXƒŒ ƒp[ƒg‚P‚Ì453Ž‚ÉŠ´ŽÓ - end; - //FHint.ActivateHint(ARect, s); - if FHint.PopupType = gptRaw then - FHint.ActivateHint(ARect, FHint.Caption) - else - FHint.ActivateHint(ARect, ''); - except - FHint.ReleaseHandle; - FHint.ClearAllRes; + 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 else begin + Result := True; end; end; @@ -5160,7 +5120,6 @@ begin if (GetKeyState( VK_SHIFT ) and $80000000) = 0 then if MsgBox(Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then Exit; - ClearHistory; FHistoryList.Clear; TreeView.Items.Clear; end; @@ -5845,7 +5804,7 @@ procedure TGikoForm.SelectComboBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var IMC: HIMC; - Len: integer; + Len, idx: integer; Str: string; tmp: string; begin @@ -5871,6 +5830,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‚µ‚½‚Æ‚© @@ -6371,24 +6344,21 @@ end; procedure TGikoForm.BrowserTabMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin - if FDragWFirst <> true then begin + if FDragWFirst = true then FDragWFirst := false; -{ - end else if (abs( X - FMouseDownPos.X ) < Mouse.DragThreshold) - and (abs( Y - FMouseDownPos.Y ) < Mouse.DragThreshold) then begin -(*} - end else 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; + + // ƒ}ƒ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; procedure TGikoForm.LinkToolBarDragOver(Sender, Source: TObject; X, @@ -6472,7 +6442,7 @@ var boardPlugIn : TBoardPlugIn; begin if Number = 0 then Exit; - ThreadItem := GetActiveContent; + ThreadItem := GetActiveContent(True); if ThreadItem <> nil then begin //if ThreadItem.IsBoardPlugInAvailable then begin @@ -6530,10 +6500,69 @@ end; procedure TGikoForm.BrowserTabPopupMenuPopup(Sender: TObject); +var + i:Integer; begin - AddRoundNameMenu(dummy1); + 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(MenuItem: TMenuItem); +var + i: Integer; + Item: TMenuItem; +begin + MenuItem.Clear; + for i := 0 to BrowserTab.Tabs.Count - 1 do begin + // “¯‚¶”‚©‚Ç‚¤‚© + if (FActiveContent.Thread.ParentBoard = + TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin + // Ž©•ª‚ÍŠO‚· + if FActiveContent.Thread <> + 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; + MenuItem.Add(Item); + end; + end; + end; + // ‰½‚à–³‚¢‚È‚çŽg—p‚Å‚«‚È‚¢‚悤‚É‚·‚é + 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: Integer; + MenuItem: TMenuItem; +begin + if Sender is TMenuItem then begin + try + MenuItem := TMenuItem(Sender); + for i := 0 to BrowserTab.Tabs.Count - 1 do begin + // “¯‚¶”‚©‚Ç‚¤‚© + if (FActiveContent.Thread.ParentBoard = + TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread.ParentBoard) then begin + if FActiveContent.Thread <> + TBrowserRecord(BrowserTab.Tabs.Objects[i]).Thread then begin + if (MenuItem.Hint = TBrowserRecord(BrowserTab.Tabs.Objects[i]) + .Thread.URL) then begin + MoveToURL( MenuItem.Hint); + Exit; + end; + end; + end; + end; + except + end; + end; end; - procedure TGikoForm.FavoritesURLReplace(oldURLs: TStringList; newURLs: TStringList); begin FavoriteDM.URLReplace(oldURLs, newURLs); @@ -6605,10 +6634,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; @@ -6737,7 +6771,10 @@ begin TreeDoubleClick( TreeView.Selected ); end else if Key = VK_RETURN then begin TreeClick( TreeView.Selected ); - TreeView.Selected.Expanded := not TreeView.Selected.Expanded; + // —š—ð‚̏ꍇAÁ‚³‚ê‚Ä‚¢‚é‚̂Ń`ƒFƒbƒN‚·‚é + if (TreeView.Selected <> nil) then begin + TreeView.Selected.Expanded := not TreeView.Selected.Expanded; + end; end; end; //! ‚¨‹C‚É“ü‚è‚ÌMouseDownƒCƒxƒ“ƒg @@ -6801,9 +6838,8 @@ end; procedure TGikoForm.OnResized; var - doc : Variant; + doc : IHTMLDocument2; begin - FOldFormWidth := Width; FIsIgnoreResize := rtNone; @@ -6818,8 +6854,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; @@ -6827,70 +6863,73 @@ begin end; // ************************************************************************* -//! ‚¨‹C‚É“ü‚èƒcƒŠ[‚̃}ƒEƒXƒAƒbƒvƒCƒxƒ“ƒg +//! ƒXƒŒƒbƒhƒuƒ‰ƒEƒUƒNƒŠƒbƒNƒCƒxƒ“ƒg // ************************************************************************* function TGikoForm.WebBrowserClick(Sender: TObject): WordBool; var - p : TPoint; e: IHTMLElement; + doc : IHTMLDocument2; + FOleInPlaceActiveObject: IOleInPlaceActiveObject; + p : TPoint; AID: string; - stlist : TStringList; - i, count, rc : Integer; - body : String; - limited : boolean; -begin - result := true; - try - if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then - FActiveContent.Browser.SetFocus; - 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 := false; - if count > 20 then begin - rc := GikoUtil.MsgBox(Handle, - '20ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H', - 'IDƒ|ƒbƒvƒAƒbƒvŒx', - MB_YESNO or MB_ICONQUESTION); - limited := rc <> ID_YES; - end; - body := GikoSys.GetSameIDResAnchor(AID, FActiveContent.Thread, limited); - FActiveContent.IDAnchorPopup(body); - end; - end; - except +begin + 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 @@ -7113,6 +7152,7 @@ var Action: TAction; begin s := MouseGesture.GetGestureStr; + MouseGesture.Clear; Action := GikoSys.Setting.Gestures.GetGestureAction(s); if Action <> nil then Action.Execute; @@ -7165,10 +7205,11 @@ end; procedure TGikoForm.BrowserPanelResize(Sender: TObject); begin - if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin - MoveWindow(FActiveContent.Browser.Handle, 0, 0, BrowserPanel.ClientWidth, BrowserPanel.ClientHeight, false); - end; - + if (FIsMinimize <> mtMinimizing) then begin + if (FActiveContent <> nil) and (FActiveContent.Browser <> nil) then begin + MoveWindow(FActiveContent.Browser.Handle, 0, 0, BrowserPanel.ClientWidth, BrowserPanel.ClientHeight, false); + end; + end; end; procedure TGikoForm.CoolBarResized(Sender: TObject; CoolBar: TCoolBar); var @@ -7275,15 +7316,22 @@ end; //‚±‚̃ŒƒX‚ ‚ځ`‚ñ procedure TGikoForm.IndividualAbon(Atag, Atype : Integer); var - ThreadItem : TThreadItem; - ReadList : TStringList; - wordCount : TWordCount; -begin - ThreadItem := GetActiveContent; - ReadList := TStringList.Create; - wordCount := TWordCount.Create; + doc : IHTMLDocument2; + ThreadItem : TThreadItem; + ReadList : TStringList; + wordCount : TWordCount; +begin + 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 ); @@ -7301,6 +7349,68 @@ begin if ThreadItem <> nil then InsertBrowserTab( ThreadItem, True ); end; +//“¯ˆêID‚ðNGƒ[ƒh‚É“o˜^ +procedure TGikoForm.AddIDtoNGWord(invisible : boolean); +var + doc : IHTMLDocument2; + ThreadItem : TThreadItem; + No : Integer; +{$IFDEF SPAM_FILTER_ENABLED} + body : TStringList; + ReadList : TStringList; + wordCount : TWordCount; +{$ENDIF} + id, dateStr: String; +begin + No := KokoPopupMenu.Tag; + if No = 0 then Exit; + ThreadItem := GikoForm.KokoPopupThreadItem; + if ThreadItem = nil then Exit; + + id := GikoSys.GetResID(No, ThreadItem); + if (id <> '') and (not IsNoValidID(id)) then begin + // ƒRƒƒ“ƒg‚Æ‚µ‚āAƒXƒŒƒbƒh–¼‚ƍ¡“ú‚Ì“ú•t‚ð’ljÁ + DateTimeToString(dateStr, 'yyyymmdd', Now); + id := id + #9'>>add ' + dateStr + ',' + ThreadItem.Title; + if (GikoSys.FAbon.AddToken(id, invisible)) then begin + GikoSys.FAbon.ReLoadFromNGwordFile; + FActiveContent.Repaint := True; + end; + end else begin + ShowMessage('ID‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B'); + end; +{$IFDEF SPAM_FILTER_ENABLED} + body := TStringList.Create; + try + GikoSys.GetSameIDRes(id, ThreadItem, body); + ReadList := TStringList.Create; + wordCount := TWordCount.Create; + try + // ƒXƒpƒ€‚ɐݒè + ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); + for i := 0 to body.Count - 1 do begin + GikoSys.SpamCountWord( ReadList[ i ], wordCount ); + GikoSys.SpamForget( wordCount, False ); // ƒnƒ€‚ð‰ðœ + GikoSys.SpamLearn( wordCount, True ); // ƒXƒpƒ€‚ɐݒè + end; + finally + wordCount.Free; + ReadList.Free; + end; + finally + body.Free; + end; +{$ENDIF} + if (FActiveContent.Repaint) then begin + 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; +end; //“¯ˆêID‚Ì‚ ‚ځ`‚ñ procedure TGikoForm.IndividualAbonID(Atype : Integer); @@ -7313,7 +7423,7 @@ var begin No := KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GetActiveContent; + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; body := TStringList.Create; try @@ -7322,7 +7432,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 ); @@ -7352,15 +7462,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(); @@ -7461,7 +7573,9 @@ begin WM_KEYFIRST..WM_KEYLAST : begin //ƒL[ƒAƒbƒv‚Í–³Ž‹‚·‚é@KeyDown‚ƍ‡‚킹‚Ä‚Q‰ñŒÄ‚΂ê‚é‚©‚ç - if (Msg.message <> WM_KEYUP) and (Msg.message <> WM_CHAR) then begin + if (Msg.message <> WM_KEYUP) + and (Msg.message <> WM_CHAR) + and (Msg.message <> WM_SYSKEYUP) then begin wmMsg.Msg := Msg.message; wmMsg.CharCode := Word(Msg.wParam); wmMsg.KeyData := Msg.lParam; @@ -7470,7 +7584,13 @@ begin end; end; end; - end; + end else begin + // Explorer‚ÌD&D‚ðŽó‚¯‚é‚Æ‚Ì”ñƒAƒNƒeƒBƒu + if Msg.message = WM_DROPFILES then begin + AcceptDropFiles(Msg); + Handled := True; + end; + end; end; // ************************************************************************* //! ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ªƒAƒNƒeƒBƒu‚Å‚È‚­‚È‚Á‚½‚Æ‚«‚̃Cƒxƒ“ƒg @@ -7480,12 +7600,11 @@ begin Application.ProcessMessages; if not Application.Terminated then begin if PreviewTimer.Enabled then - PreviewTimer.Enabled := False; - //ƒtƒH[ƒJƒX‚ª‘¼‚̃AƒvƒŠ‚É•Ï‚í‚Á‚½‚Æ‚«‚Ƀqƒ“ƒg‚ðÁ‹Ž - if FHint <> nil then begin - FHint.ReleaseHandle; - FHint.ClearAllRes; - end; + PreviewTimer.Enabled := False; + //ƒtƒH[ƒJƒX‚ª‘¼‚̃AƒvƒŠ‚É•Ï‚í‚Á‚½‚Æ‚«‚Ƀ|ƒbƒvƒAƒbƒvÁ‹Ž + if (FResPopupBrowser <> nil) then + FResPopupBrowser.Clear; + //ƒvƒŒƒrƒ…[‚ð‰B‚· if FPreviewBrowser <> nil then ShowWindow(FPreviewBrowser.Handle, SW_HIDE); @@ -7534,7 +7653,9 @@ begin BrowserNullTab := TBrowserRecord.Create; BrowserNullTab.Browser := Browser; 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]; @@ -7550,9 +7671,12 @@ 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); + //‹N“®Žž‚Ƀ^ƒuŽ©“®•œŒ³‚ð“ü‚ê‚Ä‚¢‚é‚ƁA‹óƒy[ƒW—p‚ÌBrowser‚Ì //•`‰æ‚ªI‚í‚Á‚Ä‚¢‚È‚­‚āAƒNƒŠƒbƒNƒCƒxƒ“ƒg‚̐ݒ蓙‚É“Ë“ü‚·‚é‚Ì‚Å //‚±‚±‚ŏI‚í‚点‚Ä‚¨‚­ @@ -7722,10 +7846,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‚µ @@ -7741,6 +7872,7 @@ begin FIconData.hIcon := Application.Icon.Handle; {ƒAƒCƒRƒ“Žw’è} FIconData.szTip := 'ƒMƒRƒiƒr'; {ƒqƒ“ƒg•¶Žš—ñ} Shell_NotifyIcon(NIM_ADD, @FIconData); + ShowEditors(SW_HIDE); ShowWindow(Self.Handle, SW_HIDE); end; except @@ -7763,13 +7895,208 @@ begin end else begin ShowWindow(Self.Handle, SW_SHOW); end; + ShowEditors(SW_SHOW); GikoDM.StoredTaskTrayAction.Tag := 0; end; end; +{ +\brief ƒŒƒXƒGƒfƒBƒ^‚Ì•\Ž¦”ñ•\Ž¦ +\param nCmdShow Windows.ShowWindow‚É‘—‚éƒpƒ‰ƒ[ƒ^‚Æ“¯‚¶ +} +procedure TGikoForm.ShowEditors(nCmdShow: Integer); +var + i : Integer; +begin + // ƒŒƒXƒGƒfƒBƒ^‚ð’T‚· + for i := 0 to Screen.CustomFormCount - 1 do begin + if TObject(Screen.CustomForms[i]) is TEditorForm then + ShowWindow(Screen.CustomForms[i].Handle, nCmdShow); + + end; +end; +//! ƒ|ƒbƒvƒAƒbƒvƒuƒ‰ƒEƒUì¬ +procedure TGikoForm.CreateResPopupBrowser; +begin + if (FResPopupBrowser = nil) then begin + FResPopupBrowser := TResPopupBrowser.Create(BrowserPanel); + end; +end; +//! ListView‚ÌD&DŽó‚¯Žæ‚è +procedure TGikoForm.AcceptDropFiles(var Msg: TMsg); +var + FileName: Array[0..MAX_PATH] of Char; + Cnt, K: Integer; + Board: TBoard; + LogFolder: String; + datList: TStringList; +begin + // •\Ž¦‚µ‚Ä‚¢‚é‚̔‚̂Ƃ«ˆÈŠO‚Í‹‘”Û + if GetActiveList is TBoard then begin + Board := TBoard(GetActiveList); + if MsgBox(Handle, Board.Title + + ' ”‚ɓü‚ê‚Ä‚¢‚¢‚Å‚·‚©H', 'ƒMƒRƒiƒr', MB_YESNO or MB_ICONQUESTION) = IDYES then begin + // ”‚̎ž‚́AƒƒOƒtƒHƒ‹ƒ_‚ɃRƒs[‚µ‚Ä‚Í‚®‚ꃍƒO‘Ήž‚Æ“¯‚¶ˆ—H + datList := TStringList.Create; + try + Cnt := DragQueryFile(Msg.WParam, $FFFFFFFF, FileName, SizeOf(FileName)); + for K := 0 to Cnt - 1 do begin + DragQueryFile(Msg.WParam, K, FileName, SizeOf(FileName)); + // FileName‚Édrop‚³‚ꂽƒtƒ@ƒCƒ‹–¼‚ª“ü‚Á‚Ä‚¢‚é‚̂ŁA‚±‚±‚ʼn½‚ç‚©‚̏ˆ—‚ð‚·‚éB‚½‚Æ‚¦‚ÎŽŸ‚̍s + // ƒtƒ@ƒCƒ‹‚̃`ƒFƒbƒN + if (isValidFile(FileName)) then begin + LogFolder := ExtractFilePath(Board.FilePath); + if (FileExists( LogFolder + ExtractFileName(FileName))) then begin + GikoUtil.MsgBox(Handle, LogFolder + '‚É' + ExtractFileName(FileName) + '‚ªŠù‚É‘¶Ý‚µ‚Ü‚·B', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); + end else begin + if (not DirectoryExists(LogFolder)) then begin + if (not GikoSys.ForceDirectoriesEx(LogFolder) ) then begin + GikoUtil.MsgBox(Handle, LogFolder + '‚̐¶¬‚ÉŽ¸”s‚µ‚Ü‚µ‚½B', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); + end; + end; + if (not Windows.CopyFile(FileName, PChar(LogFolder + ExtractFileName(FileName)), true)) then begin + GikoUtil.MsgBox(Handle, FileName + '‚̃Rƒs[‚ÉŽ¸”s‚µ‚Ü‚µ‚½B', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); + end else begin + datList.Add(ExtractFileName(FileName)); + end; + end; + end; + end; + DragFinish(Msg.WParam); + 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 begin + GikoForm.TreeView.Refresh; + end; + if GikoForm.ListView.Visible then begin + UpdateListView(); + end; + end else begin + ShowMessage('ˆê‚‚àƒRƒs[‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B' ); + end; + finally + datList.Free; + end; + + end; + end else 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 + dt: TDateTime; +begin + Result := True; + // ‘¶Ý‚·‚é‚©AŠg’£ŽqdatAƒtƒ@ƒCƒ‹–¼ + if ( not FileExists(FileName) ) then begin + Result := False; + GikoUtil.MsgBox(Handle, FileName + '‚Í‘¶Ý‚µ‚Ü‚¹‚ñB', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); + end else if (ExtractFileExt(ExtractFileName(FileName)) <> '.dat' ) then begin + Result := False; + GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '‚ÌŠg’£Žq‚ª".dat"‚Å‚ ‚è‚Ü‚¹‚ñB', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); + end else begin + // ƒƒOƒtƒ@ƒCƒ‹‚ÌŠg’£Žq‚ð‚Í‚¸‚µ‚½‚à‚Ì‚ªƒXƒŒì¬“úŽž + try + 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); + end; + except + Result := False; + GikoUtil.MsgBox(Handle, ExtractFileName(FileName) + '‚̃tƒ@ƒCƒ‹–¼‚ª•s³‚Å‚·B', 'ƒGƒ‰[', MB_ICONSTOP or MB_OK); + end; + end; +end; + +procedure TGikoForm.ResPopupClearTimerTimer(Sender: TObject); +begin + ResPopupClearTimer.Enabled := False; + if ResPopupClearTimer.Tag = 0 then begin + FResPopupBrowser.Clear; + end else 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; +//! ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[“ǂݍž‚Ý +procedure TGikoForm.LoadPopupMenu(); +begin + + +end; initialization OleInitialize(nil); finalization OleUninitialize; + end.