X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=GikoDataModule.pas;h=30456e946bc658507962dc356d8273fd3d9ace84;hb=refs%2Fheads%2FBb60;hp=11660e1652ce12b52160eacc394b6274ca9dab93;hpb=35a06b41b160ac6a078fd7a7b80c5429bb920a97;p=gikonavigoeson%2Fgikonavi.git diff --git a/GikoDataModule.pas b/GikoDataModule.pas index 11660e1..30456e9 100644 --- a/GikoDataModule.pas +++ b/GikoDataModule.pas @@ -11,10 +11,45 @@ uses SHDocVw_TLB, MSHTML_TLB, {$IFEND} - ComCtrls; + ComCtrls, BrowserRecord, Graphics, Messages, Setting, Dialogs, + ActiveX, GikoSystem, MoveHistoryItem, HistoryList; + +const + CAPTION_NAME: string = 'ƒMƒRƒiƒr'; + USER_SETLINKBAR = WM_USER + 2003; + + ITEM_ICON_SORT1 = 12; //!< ƒ\[ƒgƒAƒCƒRƒ“ + ITEM_ICON_SORT2 = 13; //!< ƒ\[ƒgƒAƒCƒRƒ“ + + //ƒc[ƒ‹ƒo[ƒAƒCƒRƒ“ + TOOL_ICON_HEIGHT_MAX = 16; //!< ‚‚³Å‘åƒAƒCƒRƒ“ + TOOL_ICON_HEIGHT_MIN = 17; //!< ‚‚³Å¬ƒAƒCƒRƒ“ + TOOL_ICON_HEIGHT_NORMAL = 18; //!< ‚‚³•W€ƒAƒCƒRƒ“ + TOOL_ICON_WIDTH_MAX = 19; //!< •Å‘åƒAƒCƒRƒ“ + TOOL_ICON_WIDTH_MIN = 20; //!< •Å¬ƒAƒCƒRƒ“ + TOOL_ICON_WIDTH_NORMAL = 21; //!< ••W€ƒAƒCƒRƒ“ + + TOOL_ICON_FAV_FOLDER = 30; //!< ‚¨‹C‚É“ü‚èƒtƒHƒ‹ƒ_ƒAƒCƒRƒ“ + TOOL_ICON_FAV_BOARD = 31; //!< ‚¨‹C‚É“ü‚蔃AƒCƒRƒ“ + TOOL_ICON_FAV_THREAD = 32; //!< ‚¨‹C‚É“ü‚èƒXƒŒƒAƒCƒRƒ“ + + //! HTTP + PROTOCOL_HTTP : string = 'http://'; + //! ƒMƒRƒiƒrƒTƒCƒg‚ÌURL + URL_GIKONAVI: string = 'gikonavi.sourceforge.jp/'; + //! MonazillaƒTƒCƒg‚ÌURL + URL_MONAZILLA: string = 'www.monazilla.org/'; + //! 2‚¿‚á‚ñ‚Ë‚é‚ÌURL + URL_2ch: string = 'www.2ch.net/'; + //! ƒMƒRƒiƒrWiki‚ÌURL + URL_Wiki: string = 'sourceforge.jp/projects/gikonavi/wiki/FAQ'; + + SELECTCOMBOBOX_NAME: string = ''; // 'ƒXƒŒƒbƒhižŒŸõ'; + SELECTCOMBOBOX_COLOR: TColor = clWindow; type + TGikoDM = class(TDataModule) GikoFormActionList: TActionList; OnlyAHundredResAction: TAction; @@ -154,13 +189,10 @@ type BrowserMaxAndFocusAction: TAction; SelectItemSaveForHTML: TAction; SelectItemSaveForDat: TAction; - FileSaveAs1: TFileSaveAs; LogFolderOpenAction: TAction; TabsSaveAction: TAction; TabsOpenAction: TAction; BrowsBoradHeadAction: TAction; - TabAutoSaveAction: TAction; - TabAutoLoadAction: TAction; JumpToNumOfResAction: TAction; FavoriteTreeViewCollapseAction: TAction; RightTabCloseAction: TAction; @@ -180,6 +212,39 @@ type UnSelectedListViewAction: TAction; WikiFAQWebPageAction: TAction; ToobarImageList: TImageList; + SaveDialog: TSaveDialog; + ThreadSizeCalcForFileAction: TAction; + SetInputAssistAction: TAction; + OpenFindDialogAction: TAction; + ArchiveItemAction: TAction; + LiveItemAction: TAction; + FavoriteTreeViewItemNameCopyAction: TAction; + CloseAllEditorAction: TAction; + PrevMoveHistory: TAction; + NextMoveHistory: TAction; + ClickActiveElementAction: TAction; + VKDownAction: TAction; + VKUpAction: TAction; + VKRightAction: TAction; + VKLeftAction: TAction; + StoredTaskTrayAction: TAction; + AllImageLinkToClipbordAction: TAction; + NewImageLinkToClipBoardAction: TAction; + SetForcusForAddresBarAction: TAction; + NewBoardSearchAction: TAction; + NGWordEditFormAction: TAction; + ScrollPageDownAction: TAction; + ScrollPageUpAction: TAction; + AllLinkToClipboardAction: TAction; + NewLinkToClipboardAction: TAction; + AddIDtoNGWord0Action: TAction; + AddIDtoNGWord1Action: TAction; + ExtractSameIDAction: TAction; + ShowTabListAction: TAction; + DereferenceResAction: TAction; + UpdateGikonaviAction: TAction; + konoURLPATHAction: TAction; + konoURLQueryAction: TAction; procedure EditNGActionExecute(Sender: TObject); procedure ReloadActionExecute(Sender: TObject); procedure GoFowardActionExecute(Sender: TObject); @@ -267,8 +332,6 @@ type procedure SelectItemSaveForDatExecute(Sender: TObject); procedure TabsSaveActionExecute(Sender: TObject); procedure TabsOpenActionExecute(Sender: TObject); - procedure TabAutoSaveActionExecute(Sender: TObject); - procedure TabAutoLoadActionExecute(Sender: TObject); procedure BeLogInOutActionExecute(Sender: TObject); procedure BeLogInOutActionUpdate(Sender: TObject); procedure KokomadeActionExecute(Sender: TObject); @@ -361,18 +424,79 @@ type procedure MidokuActionExecute(Sender: TObject); procedure AllSelectActionExecute(Sender: TObject); procedure AllSelectActionUpdate(Sender: TObject); + procedure ThreadSizeCalcForFileActionExecute(Sender: TObject); + procedure SetInputAssistActionExecute(Sender: TObject); + procedure OpenFindDialogActionExecute(Sender: TObject); + procedure ArchiveItemActionExecute(Sender: TObject); + procedure LiveItemActionExecute(Sender: TObject); + procedure FavoriteTreeViewItemNameCopyActionExecute(Sender: TObject); + procedure CloseAllEditorActionExecute(Sender: TObject); + procedure CloseAllEditorActionUpdate(Sender: TObject); + procedure PrevMoveHistoryUpdate(Sender: TObject); + procedure PrevMoveHistoryExecute(Sender: TObject); + procedure NextMoveHistoryUpdate(Sender: TObject); + procedure NextMoveHistoryExecute(Sender: TObject); + procedure ClickActiveElementActionExecute(Sender: TObject); + procedure VKDownActionExecute(Sender: TObject); + procedure VKUpActionExecute(Sender: TObject); + procedure VKRightActionExecute(Sender: TObject); + procedure VKLeftActionExecute(Sender: TObject); + procedure StoredTaskTrayActionExecute(Sender: TObject); + procedure LeftTabSelectActionUpdate(Sender: TObject); + procedure RightmostTabSelectActionUpdate(Sender: TObject); + procedure NewImageLinkToClipBoardActionExecute(Sender: TObject); + procedure AllImageLinkToClipbordActionExecute(Sender: TObject); + procedure SetForcusForAddresBarActionExecute(Sender: TObject); + procedure NewBoardSearchActionExecute(Sender: TObject); + procedure ScrollPageDownActionExecute(Sender: TObject); + procedure ScrollPageUpActionExecute(Sender: TObject); + procedure AllLinkToClipboardActionExecute(Sender: TObject); + procedure NewLinkToClipboardActionExecute(Sender: TObject); + procedure AddIDtoNGWord0ActionExecute(Sender: TObject); + procedure AddIDtoNGWord1ActionExecute(Sender: TObject); + procedure ExtractSameIDActionExecute(Sender: TObject); + procedure ShowTabListActionExecute(Sender: TObject); + procedure DereferenceResActionExecute(Sender: TObject); + procedure UpdateGikonaviActionExecute(Sender: TObject); + procedure konoURLPATHActionExecute(Sender: TObject); + procedure konoURLQueryActionExecute(Sender: TObject); + procedure konoURLQueryActionUpdate(Sender: TObject); private { Private éŒ¾ } + procedure ClearResFilter; + procedure SetResRange(range: Integer); + procedure SetThreadAreaHorNormal; + procedure SetThreadAreaHorizontal(gls : TGikoListState); + procedure SetThreadAreaVerNormal; + procedure SetThreadAreaVertical(gls : TGikoListState); + procedure SetThreadReadProperty(read: Boolean); + procedure SelectThreadSaveToFile(dat: Boolean); + function GetSortProperties(List: TObject;var vSortOrder: Boolean): Boolean; + procedure RecalcThreadSize(limit : Integer); + procedure ClearSelectComboBox; + procedure ClearMailAllEditor(); + procedure ClearNameTextAllEditor(); + procedure MoveURLWithHistory(URL : String; KeyMask: Boolean = False); + procedure BackToHistory(item: TMoveHistoryItem); + function GetActiveThreadLinks : IHTMLElementCollection; + procedure GetLinkURLs(links : IHTMLElementCollection; + URLs : TStringList; const Start: Integer; Exts : TStringList); public { Public éŒ¾ } + procedure RepaintStatusBar; + function EditorFormExists(): boolean; + procedure GetTabURLs(AStringList: TStringList); + procedure OpenURLs(AStringList: TStringList); published { Published éŒ¾ } //! TAction‚ÅGetActiveContent‚ªnilˆÈŠO‚Å—LŒø‚É‚È‚é procedure DependActiveCntentActionUpdate(Sender: TObject); //! TAction‚ÅGetActiveContent‚ªnilˆÈŠO‚©‚ƒƒO‚ðŽ‚Á‚Ä‚¢‚é‚Æ—LŒø‚É‚È‚é procedure DependActiveCntentLogActionUpdate(Sender: TObject); - //! TAction‚ÅActiveList‚ªTBoard‚Å—LŒø‚É‚È‚é + //! TAction‚ÅActiveList‚ªTBoard(”ñ“ÁŽê”Â)‚Å—LŒø‚É‚È‚é procedure DependActiveListTBoardActionUpdate(Sender: TObject); + //! TAction‚ÅActiveList‚ªTBoard‚Å—LŒø‚É‚È‚é + procedure DependActiveListTBoardWithSpeciapActionUpdate(Sender: TObject); end; var @@ -382,46 +506,19 @@ var implementation uses - Windows, Math, Messages, Dialogs, Clipbrd, - Giko, GikoSystem, GikoUtil, BoardGroup, - FavoriteArrange, Favorite, Setting, MojuUtils, + Windows, Math, Clipbrd, + Giko, GikoUtil, BoardGroup, + FavoriteArrange, Favorite, MojuUtils, Editor, ListSelect, Search, Option, Round, KeySetting, Gesture, Kotehan, ToolBarSetting, ToolBarUtil, NewBoard, HTMLCreate, IndividualAbon, - GikoBayesian, About, ShellAPI, Graphics, + GikoBayesian, About, ShellAPI, RoundName, RoundData, Menus, ListViewUtils, - ThreadControl; + ThreadControl, GikoMessage, InputAssist, + DefaultFileManager, Forms, NewBoardURL, UpdateCheck; const - CAPTION_NAME: string = 'ƒMƒRƒiƒr'; - USER_SETLINKBAR = WM_USER + 2003; - - ITEM_ICON_SORT1 = 12; //!< ƒ\[ƒgƒAƒCƒRƒ“ - ITEM_ICON_SORT2 = 13; //!< ƒ\[ƒgƒAƒCƒRƒ“ - - //ƒc[ƒ‹ƒo[ƒAƒCƒRƒ“ - TOOL_ICON_HEIGHT_MAX = 16; //!< ‚‚³Å‘åƒAƒCƒRƒ“ - TOOL_ICON_HEIGHT_MIN = 17; //!< ‚‚³Å¬ƒAƒCƒRƒ“ - TOOL_ICON_HEIGHT_NORMAL = 18; //!< ‚‚³•W€ƒAƒCƒRƒ“ - TOOL_ICON_WIDTH_MAX = 19; //!< •Å‘åƒAƒCƒRƒ“ - TOOL_ICON_WIDTH_MIN = 20; //!< •Å¬ƒAƒCƒRƒ“ - TOOL_ICON_WIDTH_NORMAL = 21; //!< ••W€ƒAƒCƒRƒ“ - - TOOL_ICON_FAV_FOLDER = 30; //!< ‚¨‹C‚É“ü‚èƒtƒHƒ‹ƒ_ƒAƒCƒRƒ“ - TOOL_ICON_FAV_BOARD = 31; //!< ‚¨‹C‚É“ü‚蔃AƒCƒRƒ“ - TOOL_ICON_FAV_THREAD = 32; //!< ‚¨‹C‚É“ü‚èƒXƒŒƒAƒCƒRƒ“ - - //! ƒMƒRƒiƒrƒTƒCƒg‚ÌURL - URL_GIKONAVI: string = 'http://gikonavi.sourceforge.jp/'; - //! MonazillaƒTƒCƒg‚ÌURL - URL_MONAZILLA: string = 'http://www.monazilla.org/'; - //! 2‚¿‚á‚ñ‚Ë‚é‚ÌURL - URL_2ch: string = 'http://www.2ch.net/'; - //! ƒMƒRƒiƒrWiki‚ÌURL - URL_Wiki: string = 'http://gikowiki.dyndns.info/index.php?FAQ'; - - SELECTCOMBOBOX_NAME: string = ''; // 'ƒXƒŒƒbƒhižŒŸõ'; - SELECTCOMBOBOX_COLOR: TColor = clWindow; + MSG_ERROR : string = 'ƒGƒ‰['; {$R *.dfm} // ************************************************************************* @@ -440,10 +537,18 @@ begin and (GikoForm.GetActiveContent.IsLogFile); end; // ************************************************************************* -//! TAction‚ÅActiveList‚ªTBoard‚Å—LŒø‚É‚È‚é +//! TAction‚ÅActiveList‚ªTBoard(”ñ“ÁŽê”Â)‚Å—LŒø‚É‚È‚é // ************************************************************************* procedure TGikoDM.DependActiveListTBoardActionUpdate(Sender: TObject); begin + TAction(Sender).Enabled := (GikoForm.GetActiveList is TBoard) and + (GikoForm.GetActiveList <> BoardGroup.SpecialBoard); +end; +// ************************************************************************* +//! TAction‚ÅActiveList‚ªTBoard‚Å—LŒø‚É‚È‚é +// ************************************************************************* +procedure TGikoDM.DependActiveListTBoardWithSpeciapActionUpdate(Sender: TObject); +begin TAction(Sender).Enabled := (GikoForm.GetActiveList is TBoard); end; // ************************************************************************* @@ -461,7 +566,8 @@ procedure TGikoDM.ReloadActionExecute(Sender: TObject); begin //ƒŠƒ[ƒh‚ðŽÀs@Ž¸”s‚µ‚½‚烁ƒbƒZ[ƒWo—Í if GikoSys.FAbon.ReLoadFromNGwordFile =false then begin - MsgBox(GikoForm.Handle, 'NGƒ[ƒhƒtƒ@ƒCƒ‹‚̍ēǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', 'ƒGƒ‰[', MB_OK or MB_ICONEXCLAMATION); + MsgBox(GikoForm.Handle, 'NGƒ[ƒhƒtƒ@ƒCƒ‹‚̍ēǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', + MSG_ERROR, MB_OK or MB_ICONEXCLAMATION); end else begin //‘S‚Ẵ^ƒu‚ɍĕ`‰æ‚ðÝ’è GikoForm.RepaintAllTabsBrowser(); @@ -471,19 +577,14 @@ end; //! NGƒ[ƒh“ǂݍž‚݁iˆê‚ÂŒã‚ëj // ************************************************************************* procedure TGikoDM.GoFowardActionExecute(Sender: TObject); -var - s: string; begin //ˆê‚ÂŒã‚ë‚̓ǂݍž‚݁@Ž¸”s‚µ‚½‚烁ƒbƒZ[ƒWo—Í if GikoSys.FAbon.GoBack =false then begin - MsgBox(GikoForm.Handle, 'ˆê‚ÂŒã‚ë‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', 'ƒGƒ‰[', MB_OK or MB_ICONEXCLAMATION); + MsgBox(GikoForm.Handle, 'ˆê‚ÂŒã‚ë‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', + MSG_ERROR, MB_OK or MB_ICONEXCLAMATION); end else begin //ƒXƒe[ƒ^ƒX‚É•\Ž¦‚³‚ê‚éNGƒ[ƒhƒtƒ@ƒCƒ‹–¼‚ðXV - s := GikoSys.FAbon.NGwordname; - GikoForm.StatusBar.Panels.Items[2].Text := s; - //ƒXƒe[ƒ^ƒX‚Ì•\Ž¦ƒTƒCƒY‚̃ŠƒTƒCƒY - GikoForm.StatusBar.Panels[2].Width := Max(GikoForm.StatusBar.Canvas.TextWidth(s), 100); - GikoForm.StatusBarResize(Sender); + RepaintStatusBar; //‘S‚Ẵ^ƒu‚ɍĕ`‰æ‚ðÝ’è GikoForm.RepaintAllTabsBrowser(); end; @@ -492,45 +593,41 @@ end; //! NGƒ[ƒh“ǂݍž‚݁iˆê‚‘Oj // ************************************************************************* procedure TGikoDM.GoBackActionExecute(Sender: TObject); -var - s: string; begin //ˆê‚ÂŒã‚ë‚̓ǂݍž‚݁@Ž¸”s‚µ‚½‚烁ƒbƒZ[ƒWo—Í if GikoSys.FAbon.GoForward =false then begin - MsgBox(GikoForm.Handle, 'ˆê‚‘O‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', 'ƒGƒ‰[', MB_OK or MB_ICONEXCLAMATION); + MsgBox(GikoForm.Handle, 'ˆê‚‘O‚ÌNGƒ[ƒhƒtƒ@ƒCƒ‹‚̓ǂݍž‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½', + MSG_ERROR, MB_OK or MB_ICONEXCLAMATION); end else begin - //ƒXƒe[ƒ^ƒX‚É•\Ž¦‚³‚ê‚éNGƒ[ƒhƒtƒ@ƒCƒ‹–¼‚ðXV - s := GikoSys.FAbon.NGwordname; - GikoForm.StatusBar.Panels.Items[2].Text := s; - //ƒXƒe[ƒ^ƒX‚Ì•\Ž¦ƒTƒCƒY‚̃ŠƒTƒCƒY - GikoForm.StatusBar.Panels[2].Width := Max(GikoForm.StatusBar.Canvas.TextWidth(s), 100); - GikoForm.StatusBarResize(Sender); - //‘S‚Ẵ^ƒu‚ɍĕ`‰æ‚ðÝ’è + //ƒXƒe[ƒ^ƒX‚É•\Ž¦‚³‚ê‚éNGƒ[ƒhƒtƒ@ƒCƒ‹–¼‚ðXV + RepaintStatusBar; + //‘S‚Ẵ^ƒu‚ɍĕ`‰æ‚ðÝ’è GikoForm.RepaintAllTabsBrowser(); end; end; // ************************************************************************* +//! NGƒ[ƒh‚ð•ÏX‚µ‚½Œã‚̃Xƒe[ƒ^ƒXƒo[‚̍XVˆ— +// ************************************************************************* +procedure TGikoDM.RepaintStatusBar; +var + s : String; +begin + //ƒXƒe[ƒ^ƒX‚É•\Ž¦‚³‚ê‚éNGƒ[ƒhƒtƒ@ƒCƒ‹–¼‚ðXV + s := GikoSys.FAbon.NGwordname; + GikoForm.StatusBar.Panels.Items[GiKo.NGWORDNAME_PANEL].Text := s; + //ƒXƒe[ƒ^ƒX‚Ì•\Ž¦ƒTƒCƒY‚̃ŠƒTƒCƒY + GikoForm.StatusBar.Panels[GiKo.NGWORDNAME_PANEL].Width + := Max(GikoForm.StatusBar.Canvas.TextWidth(s), 100); + GikoForm.StatusBarResize(nil); +end; +// ************************************************************************* //! ƒAƒhƒŒƒXƒo[‚É•\Ž¦‚µ‚Ä‚¢‚éƒAƒhƒŒƒX‚ÖˆÚ“®‚·‚é // ************************************************************************* procedure TGikoDM.MoveToActionExecute(Sender: TObject); -var - URL: string; - idx: Integer; begin //ƒAƒhƒŒƒXƒRƒ“ƒ{ƒ{ƒbƒNƒX‚©‚çURL‚ðŽæ“¾ - URL := Trim(GikoForm.AddressComboBox.Text); //URL‚Ɉړ® - GikoForm.MoveToURL(URL); - //ˆÈ‰ºA—š—ð‚̏ˆ— - idx := GikoForm.AddressComboBox.Items.IndexOf(URL); - if idx = -1 then begin - GikoForm.AddressComboBox.Items.Insert(0, URL); - if GikoForm.AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then - GikoForm.AddressComboBox.Items.Delete(GikoForm.AddressComboBox.Items.Count - 1); - end else begin - GikoForm.AddressComboBox.Items.Delete(idx); - GikoForm.AddressComboBox.Items.Insert(0, URL); - end; + MoveURLWithHistory( Trim(GikoForm.AddressComboBox.Text) ); end; // ************************************************************************* //! ‚¨‹C‚É“ü‚è‚̒ljÁƒ_ƒCƒAƒƒO‚ðŠJ‚­ @@ -598,7 +695,8 @@ begin end else begin GikoForm.ClickNode.Text := InputBox( '–¼‘O‚̕ύX', '‚¨‹C‚É“ü‚è‚̐V‚µ‚¢–¼‘O‚ð“ü—Í‚µ‚Ä‚­‚¾‚³‚¢', GikoForm.ClickNode.Text ); end; - + //XV‚µ‚½‚±‚Æ‚ð‹³‚¦‚é + FavoriteDM.Modified := true; GikoForm.SetLinkBar; end; // ************************************************************************* @@ -626,6 +724,8 @@ begin // FClickNode.Selected.Expanded := True; GikoForm.FavoriteTreeView.Selected := Node; GikoForm.ClickNode := Node; + //XV‚µ‚½‚±‚Æ‚ð‹³‚¦‚é + FavoriteDM.Modified := true; FavoriteTreeViewRenameAction.Execute; finally end; @@ -656,6 +756,8 @@ begin end; GikoForm.ClickNode.Delete; + //XV‚µ‚½‚±‚Æ‚ð‹³‚¦‚é + FavoriteDM.Modified := true; GikoForm.SetLinkBar; @@ -673,148 +775,73 @@ end; // ************************************************************************* procedure TGikoDM.FavoriteTreeViewReloadActionExecute(Sender: TObject); var - ThreadItem: TThreadItem; FavThread: TFavoriteThreadItem; - Board: TBoard; FavBoard: TFavoriteBoardItem; shiftDown: Boolean; begin - - if GikoForm.ClickNode = nil then Exit; + if (GikoForm.ClickNode = nil) then Exit; shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); if TObject( GikoForm.ClickNode.Data ) is TFavoriteThreadItem then begin FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data ); - ThreadItem := FavThread.Item; - if ThreadItem <> nil then - GikoForm.DownloadContent(ThreadItem, shiftDown); + if FavThread.Item <> nil then + GikoForm.DownloadContent(FavThread.Item, shiftDown); end else if TObject( GikoForm.ClickNode.Data ) is TFavoriteBoardItem then begin FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data ); - Board := FavBoard.Item; - GikoForm.DownloadList(Board, shiftDown); + GikoForm.DownloadList(FavBoard.Item, shiftDown); end; end; // ************************************************************************* -//! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚ÌURL‚ðƒRƒs[‚·‚é +//! ‘I‘ð‚³‚ê‚Ä‚¢‚邨‹C‚É“ü‚è‚ÌURL‚ðƒRƒs[‚·‚é // ************************************************************************* procedure TGikoDM.FavoriteTreeViewURLCopyActionExecute(Sender: TObject); -var - FavThread : TFavoriteThreadItem; - FavBoard : TFavoriteBoardItem; - s : string; begin if GikoForm.ClickNode = nil then Exit; - if (TObject(GikoForm.ClickNode.Data) is TFavoriteThreadItem) then begin - - FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data ); - s := FavThread.URL + #13#10; - if s <> '' then - Clipboard.AsText := s; - - end else if (TObject(GikoForm.ClickNode.Data) is TFavoriteBoardItem) then begin - - FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data ); - s := FavBoard.URL + #13#10; - if s <> '' then - Clipboard.AsText := s; - + if (TObject(GikoForm.ClickNode.Data) is TFavoriteItem) then begin + Clipboard.AsText := TFavoriteItem( GikoForm.ClickNode.Data ).URL + #13#10; end; end; // ************************************************************************* -//! ‘I‘ð‚³‚ê‚Ä‚¢‚锂̖¼‘O‚ðƒRƒs[‚·‚é +//! ‘I‘ð‚³‚ê‚Ä‚¢‚邨‹C‚É“ü‚è‚Ì–¼‘O‚ðƒRƒs[‚·‚é // ************************************************************************* procedure TGikoDM.FavoriteTreeViewNameCopyActionExecute(Sender: TObject); -var - ThreadItem: TThreadItem; - FavThread: TFavoriteThreadItem; - Board: TBoard; - FavBoard: TFavoriteBoardItem; - s: string; begin if GikoForm.ClickNode = nil then Exit; - if (TObject(GikoForm.ClickNode.Data) is TFavoriteThreadItem) then begin - - FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data ); - ThreadItem := FavThread.Item; - - try - s := ThreadItem.Title + #13#10; - if s <> '' then - Clipboard.AsText := s; - finally - end; - - end else if (TObject(GikoForm.ClickNode.Data) is TFavoriteBoardItem) then begin - - FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data ); - Board := FavBoard.Item; - if Board <> nil then - if not Board.IsThreadDatRead then - GikoSys.ReadSubjectFile(Board); - - try - s := Board.Title + #13#10; - if s <> '' then - Clipboard.AsText := s; - finally - end; + if (TObject(GikoForm.ClickNode.Data) is TFavoriteItem) then begin + Clipboard.AsText := + TFavoriteItem(GikoForm.ClickNode.Data).GetItemTitle + #13#10; + end else begin + Clipboard.AsText := + GikoForm.ClickNode.Text + #13#10; end; - end; // ************************************************************************* -//! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚Ì–¼‘O‚ÆURL‚ðƒRƒs[‚·‚é +//! ‘I‘ð‚³‚ê‚Ä‚¢‚邨‹C‚É“ü‚è‚Ì–¼‘O‚ÆURL‚ðƒRƒs[‚·‚é // ************************************************************************* procedure TGikoDM.FavoriteTreeViewNameURLCopyActionExecute( Sender: TObject); var - ThreadItem: TThreadItem; - FavThread: TFavoriteThreadItem; - Board: TBoard; - FavBoard: TFavoriteBoardItem; - s: string; + favItem : TFavoriteItem; begin if GikoForm.ClickNode = nil then Exit; - if (TObject(GikoForm.ClickNode.Data) is TFavoriteThreadItem) then begin - - FavThread := TFavoriteThreadItem( GikoForm.ClickNode.Data ); - ThreadItem := FavThread.Item; - - try - s := ThreadItem.Title + #13#10 + ThreadItem.URL + #13#10; - if s <> '' then - Clipboard.AsText := s; - finally - end; - - end else if (TObject(GikoForm.ClickNode.Data) is TFavoriteBoardItem) then begin - - FavBoard := TFavoriteBoardItem( GikoForm.ClickNode.Data ); - Board := FavBoard.Item; - if Board <> nil then - if not Board.IsThreadDatRead then - GikoSys.ReadSubjectFile(Board); - - try - s := Board.Title + #13#10 + Board.URL + #13#10; - if s <> '' then - Clipboard.AsText := s; - finally - end; - + if (TObject(GikoForm.ClickNode.Data) is TFavoriteItem) then begin + favItem := TFavoriteItem(GikoForm.ClickNode.Data); + Clipboard.AsText := favItem.GetItemTitle + #13#10 + + favItem.URL + #13#10; end; end; // ************************************************************************* -//! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚ðíœ‚·‚é +//! ‘I‘ð‚³‚ê‚Ä‚¢‚邨‹C‚É“ü‚èƒXƒŒƒbƒh‚ðíœ‚·‚é // ************************************************************************* procedure TGikoDM.FavoriteTreeViewLogDeleteActionExecute(Sender: TObject); const @@ -867,41 +894,50 @@ begin end; end; +//! ƒŒƒX‚̍iž‚݃tƒBƒ‹ƒ^[‚ð‹ó‚É‚·‚é +procedure TGikoDM.ClearResFilter; +var + FilterList : TStringList; +begin + // ƒtƒBƒ‹ƒ^•¶Žš—ñ‚ð‹ó‚É‚·‚é + FilterList := TStringList.Create; + try + GikoSys.FSelectResFilter.LoadFromStringList( FilterList ); + GikoSys.FSelectResFilter.Reverse := False; + finally + FilterList.Free; + end; + GikoForm.SelectResWord := ''; +end; +// ************************************************************************* +//! ƒŒƒX‚Ì•\Ž¦”͈͂ðÝ’è‚·‚é +// ************************************************************************* +procedure TGikoDM.SetResRange(range: Integer); +begin + if GikoSys.ResRange <> range then begin + GikoSys.ResRange := range; + // ƒtƒBƒ‹ƒ^•¶Žš—ñ‚ð‹ó‚É‚·‚é + ClearResFilter; + GikoForm.RepaintAllTabsBrowser(); + end; +end; // ************************************************************************* //! ÅV100ƒŒƒX‚Ì‚Ý•\Ž¦ // ************************************************************************* procedure TGikoDM.OnlyAHundredResActionExecute(Sender: TObject); -var - FilterList : TStringList; begin if (GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil) and (GikoForm.ActiveContent.Browser.Busy) then Exit; GikoForm.ResRangeMenuSelect := 100; OnlyAHundredResAction.Checked := True; - - if GikoSys.ResRange <> 100 then begin - GikoSys.ResRange := 100; - - // ƒtƒBƒ‹ƒ^•¶Žš—ñ‚ð‹ó‚É‚·‚é - FilterList := TStringList.Create; - try - GikoSys.FSelectResFilter.LoadFromStringList( FilterList ); - GikoSys.FSelectResFilter.Reverse := False; - finally - FilterList.Free; - end; - - GikoForm.SelectResWord := ''; - GikoForm.RepaintAllTabsBrowser(); - end; + //@•\Ž¦”͈͂ðÝ’è‚·‚éBÝ’è’l‚©‚ç‚Æ‚Á‚Ä‚­‚éB + SetResRange(GikoSys.Setting.ResRangeExCount); end; // ************************************************************************* //! –¢“ǃŒƒX‚Ì‚Ý•\Ž¦ // ************************************************************************* procedure TGikoDM.OnlyKokoResActionExecute(Sender: TObject); -var - FilterList : TStringList; begin if (GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil) and (GikoForm.ActiveContent.Browser.Busy) then Exit; @@ -909,28 +945,13 @@ begin GikoForm.ResRangeMenuSelect := Ord( grrKoko ); OnlyKokoResAction.Checked := True; - if GikoSys.ResRange <> Ord( grrKoko ) then begin - GikoSys.ResRange := Ord( grrKoko ); - - // ƒtƒBƒ‹ƒ^•¶Žš—ñ‚ð‹ó‚É‚·‚é - FilterList := TStringList.Create; - try - GikoSys.FSelectResFilter.LoadFromStringList( FilterList ); - GikoSys.FSelectResFilter.Reverse := False; - finally - FilterList.Free; - end; - - GikoForm.SelectResWord := ''; - GikoForm.RepaintAllTabsBrowser(); - end; + //@•\Ž¦”͈͂ðÝ’è‚·‚é + SetResRange(Ord( grrKoko )); end; // ************************************************************************* //! V’…ƒŒƒX‚Ì‚Ý•\Ž¦ // ************************************************************************* procedure TGikoDM.OnlyNewResActionExecute(Sender: TObject); -var - FilterList : TStringList; begin if (GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil) and (GikoForm.ActiveContent.Browser.Busy) then Exit; @@ -938,20 +959,68 @@ begin GikoForm.ResRangeMenuSelect := Ord( grrNew ); OnlyNewResAction.Checked := True; - if GikoSys.ResRange <> Ord( grrNew ) then begin - GikoSys.ResRange := Ord( grrNew ); - - // ƒtƒBƒ‹ƒ^•¶Žš—ñ‚ð‹ó‚É‚·‚é - FilterList := TStringList.Create; - try - GikoSys.FSelectResFilter.LoadFromStringList( FilterList ); - GikoSys.FSelectResFilter.Reverse := False; - finally - FilterList.Free; - end; - - GikoForm.SelectResWord := ''; - GikoForm.RepaintAllTabsBrowser(); + //@•\Ž¦”͈͂ðÝ’è‚·‚é + SetResRange(Ord( grrNew )); +end; +// ************************************************************************* +//! ƒXƒŒƒbƒh•\Ž¦ƒGƒŠƒA’ʏí•\Ž¦‚É‚·‚é ’)ListOrientation = gloHorizontal@ +// ************************************************************************* +procedure TGikoDM.SetThreadAreaHorNormal; +begin + //’ʏí•\Ž¦‚É‚·‚é + GikoForm.ViewPanel.Width := GikoForm.BrowserSizeWidth; + BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX; + BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN; + GikoSys.Setting.ListWidthState := glsNormal; +end; +// ************************************************************************* +//! ƒXƒŒƒbƒh•\Ž¦ƒGƒŠƒAÅ‘å/Å¬•\Ž¦‚É‚·‚é ’)ListOrientation = gloHorizontal@ +// ************************************************************************* +procedure TGikoDM.SetThreadAreaHorizontal(gls : TGikoListState); +begin + if GikoSys.Setting.ListWidthState = glsNormal then + GikoForm.BrowserSizeWidth := GikoForm.ViewPanel.Width; + //Å‘å•\Ž¦ + if (gls = glsMax) then begin + GikoForm.ViewPanel.Width := 1; + BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL; + BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN; + GikoSys.Setting.ListWidthState := glsMax; + end else if (gls = glsMin) then begin + GikoForm.ViewPanel.Width := GikoForm.ThreadMainPanel.Width - 80; + BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX; + BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL; + GikoSys.Setting.ListWidthState := glsMin; + end; +end; +// ************************************************************************* +//! ƒXƒŒƒbƒh•\Ž¦ƒGƒŠƒA’ʏí•\Ž¦‚É‚·‚é ’)ListOrientation = gloVertical +// ************************************************************************* +procedure TGikoDM.SetThreadAreaVerNormal; +begin + //’ʏí•\Ž¦‚É‚·‚é + GikoForm.ViewPanel.Height := GikoForm.BrowserSizeHeight; + BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX; + BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN; + GikoSys.Setting.ListHeightState := glsNormal; +end; +// ************************************************************************* +//! ƒXƒŒƒbƒh•\Ž¦ƒGƒŠƒAÅ‘å/Å¬•\Ž¦‚É‚·‚é ’)ListOrientation = gloVertical +// ************************************************************************* +procedure TGikoDM.SetThreadAreaVertical(gls : TGikoListState); +begin + if GikoSys.Setting.ListHeightState = glsNormal then + GikoForm.BrowserSizeHeight := GikoForm.ViewPanel.Height; + if (gls = glsMin) then begin + GikoForm.ViewPanel.Height := GikoForm.ThreadMainPanel.Height - GikoForm.BrowserCoolBar.Height - 7; + BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX; + BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL; + GikoSys.Setting.ListHeightState := glsMin; + end else if (gls = glsMax) then begin + GikoForm.ViewPanel.Height := 1; + BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL; + BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN; + GikoSys.Setting.ListHeightState := glsMax; end; end; // ************************************************************************* @@ -963,54 +1032,22 @@ begin case GikoSys.Setting.ListWidthState of glsMax: begin //’ʏí•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - GikoForm.ViewPanel.Width := GikoForm.BrowserSizeWidth; - BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX; - BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN; - GikoSys.Setting.ListWidthState := glsNormal; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ + SetThreadAreaHorNormal; end; glsMin, glsNormal: begin //Å‘å•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - if GikoSys.Setting.ListWidthState = glsNormal then - GikoForm.BrowserSizeWidth := GikoForm.ViewPanel.Width; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ - GikoForm.ViewPanel.Width := 1; - BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL; - BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN; - GikoSys.Setting.ListWidthState := glsMax; + SetThreadAreaHorizontal(glsMax); end; end; end else begin case GikoSys.Setting.ListHeightState of glsMax: begin //’ʏí•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - GikoForm.ViewPanel.Height := GikoForm.BrowserSizeHeight; - BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX; - BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN; - GikoSys.Setting.ListHeightState := glsNormal; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ + SetThreadAreaVerNormal; end; glsMin, glsNormal: begin //Å‘å•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - if GikoSys.Setting.ListHeightState = glsNormal then - GikoForm.BrowserSizeHeight := GikoForm.ViewPanel.Height; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ - GikoForm.ViewPanel.Height := 1; - BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL; - BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN; - GikoSys.Setting.ListHeightState := glsMax; + SetThreadAreaVertical(glsMax); end; end; end; @@ -1024,54 +1061,22 @@ begin case GikoSys.Setting.ListWidthState of glsMax, glsNormal: begin //Å¬•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - if GikoSys.Setting.ListWidthState = glsNormal then - GikoForm.BrowserSizeWidth := GikoForm.ViewPanel.Width; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ - GikoForm.ViewPanel.Width := GikoForm.ThreadMainPanel.Width - 80; - BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX; - BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_NORMAL; - GikoSys.Setting.ListWidthState := glsMin; + SetThreadAreaHorizontal(glsMin); end; glsMin: begin //’ʏí•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - GikoForm.ViewPanel.Width := GikoForm.BrowserSizeWidth; - BrowserMaxAction.ImageIndex := TOOL_ICON_WIDTH_MAX; - BrowserMinAction.ImageIndex := TOOL_ICON_WIDTH_MIN; - GikoSys.Setting.ListWidthState := glsNormal; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ + SetThreadAreaHorNormal; end; end; end else begin case GikoSys.Setting.ListHeightState of glsMax, glsNormal: begin //Å¬•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - if GikoSys.Setting.ListHeightState = glsNormal then - GikoForm.BrowserSizeHeight := GikoForm.ViewPanel.Height; - GikoForm.ViewPanel.Height := GikoForm.ThreadMainPanel.Height - GikoForm.BrowserCoolBar.Height - 7; - BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX; - BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_NORMAL; - GikoSys.Setting.ListHeightState := glsMin; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ + SetThreadAreaVertical(glsMin); end; glsMin: begin //’ʏí•\Ž¦‚É‚·‚é - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 0, 0); //•`‰æ’âŽ~ - GikoForm.ViewPanel.Height := GikoForm.BrowserSizeHeight; - BrowserMaxAction.ImageIndex := TOOL_ICON_HEIGHT_MAX; - BrowserMinAction.ImageIndex := TOOL_ICON_HEIGHT_MIN; - GikoSys.Setting.ListHeightState := glsNormal; - if GikoForm.ActiveContent <> nil then - SendMessage(GikoForm.ActiveContent.Browser.Handle, WM_SETREDRAW, 1, 0); //•`‰æ + SetThreadAreaVerNormal; end; end; end; @@ -1125,7 +1130,6 @@ begin if Item = nil then Exit; Editor := TEditorForm.Create(GikoForm.GetMainForm); Editor.SetThreadItem(Item); - GikoSys.LoadEditorKeySetting(Editor.ActionList); Editor.Show; Editor.BodyEdit.SetFocus; end; @@ -1311,6 +1315,7 @@ begin if MsgBox(GikoForm.Handle, StringReplace( DEL_MSG, '^0', ThreadItem.Title, [rfReplaceAll] ) , DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then Exit; GikoForm.DeleteTab(TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[idx])); + GikoForm.DeleteHistory(ThreadItem); ThreadItem.DeleteLogFile; if ThreadItem.ParentBoard = GikoForm.ActiveList then GikoForm.ListView.Refresh; @@ -1328,6 +1333,18 @@ begin end; end; // ************************************************************************* +//! ¶‚̃^ƒu‚ð‘I‘ð‚·‚é‚ÌUpdateƒCƒxƒ“ƒg +// ************************************************************************* +procedure TGikoDM.LeftTabSelectActionUpdate(Sender: TObject); +begin + if ( not GikoSys.Setting.LoopBrowserTabs ) then begin + LeftmostTabSelectActionUpdate(Sender); + end else begin + TAction(Sender).Enabled := (GikoForm.BrowserTab.Tabs.Count > 1); + end; +end; + +// ************************************************************************* //! ƒ^ƒu‚̐”‚ª‚PˆÈã‚ŁAƒ^ƒu‚̃Cƒ“ƒfƒbƒNƒX‚ª‚OˆÈŠO‚Å—LŒø‚É‚È‚éUpdateƒCƒxƒ“ƒg // ************************************************************************* procedure TGikoDM.LeftmostTabSelectActionUpdate(Sender: TObject); @@ -1347,7 +1364,13 @@ begin end else if GikoForm.BrowserTab.TabIndex > 0 then begin GikoForm.BrowserTab.TabIndex := GikoForm.BrowserTab.TabIndex - 1; GikoForm.BrowserTab.OnChange(nil); - end; + end else begin + if (GikoSys.Setting.LoopBrowserTabs) and + (GikoForm.BrowserTab.TabIndex = 0) then begin + GikoForm.BrowserTab.TabIndex := GikoForm.BrowserTab.Tabs.Count - 1; + GikoForm.BrowserTab.OnChange(nil); + end; + end; end; end; // ************************************************************************* @@ -1362,17 +1385,27 @@ begin end else if GikoForm.BrowserTab.TabIndex < (GikoForm.BrowserTab.Tabs.Count - 1) then begin GikoForm.BrowserTab.TabIndex := GikoForm.BrowserTab.TabIndex + 1; GikoForm.BrowserTab.OnChange(nil); - end; + end else begin + if (GikoSys.Setting.LoopBrowserTabs) and + (GikoForm.BrowserTab.TabIndex = (GikoForm.BrowserTab.Tabs.Count - 1)) then begin + GikoForm.BrowserTab.TabIndex := 0; + GikoForm.BrowserTab.OnChange(nil); + end; + end; end; end; // ************************************************************************* -//! ƒ^ƒu‚̐”‚ª‚PˆÈã‚ŁAƒ^ƒu‚ª‰E’[ˆÈŠO‚Å—LŒø‚É‚È‚éUpdateƒCƒxƒ“ƒg +//! ‰E‚̃^ƒu‚ð‘I‘ð‚·‚éUpdateƒCƒxƒ“ƒg // ************************************************************************* procedure TGikoDM.RightTabSelectActionUpdate(Sender: TObject); begin - TAction(Sender).Enabled := (GikoForm.BrowserTab.Tabs.Count > 0) - and (GikoForm.BrowserTab.TabIndex <> GikoForm.BrowserTab.Tabs.Count - 1); + if ( not GikoSys.Setting.LoopBrowserTabs ) then begin + RightmostTabSelectActionUpdate(Sender); + end else begin + TAction(Sender).Enabled := (GikoForm.BrowserTab.Tabs.Count > 1); + end; end; + // ************************************************************************* //! ˆê”Ô‰E‚̃^ƒu‚ð‘I‘ð‚·‚é // ************************************************************************* @@ -1384,6 +1417,15 @@ begin end; end; // ************************************************************************* +//! ˆê”Ô‰E‚̃^ƒu‚ð‘I‘ð‚·‚é‚ÌUpdateƒCƒxƒ“ƒg +// ************************************************************************* +procedure TGikoDM.RightmostTabSelectActionUpdate(Sender: TObject); +begin + TAction(Sender).Enabled := (GikoForm.BrowserTab.Tabs.Count > 0) + and (GikoForm.BrowserTab.TabIndex <> GikoForm.BrowserTab.Tabs.Count - 1); + +end; +// ************************************************************************* //! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚ð‚¨‹C‚É“ü‚è‚ɒljÁ // ************************************************************************* procedure TGikoDM.ThreadFavoriteAddActionExecute(Sender: TObject); @@ -1466,8 +1508,6 @@ end; //! ‘S‚ẴŒƒX‚ð•\Ž¦‚·‚é // ************************************************************************* procedure TGikoDM.AllResActionExecute(Sender: TObject); -var - FilterList : TStringList; begin if(GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil ) and (GikoForm.ActiveContent.Browser.Busy) then Exit; @@ -1475,22 +1515,8 @@ begin GikoForm.ResRangeMenuSelect := Ord( grrAll ); AllResAction.Checked := True; - if GikoSys.ResRange <> Ord( grrAll ) then begin - GikoSys.ResRange := Ord( grrAll ); - - // ƒtƒBƒ‹ƒ^•¶Žš—ñ‚ð‹ó‚É‚·‚é - FilterList := TStringList.Create; - try - GikoSys.FSelectResFilter.LoadFromStringList( FilterList ); - GikoSys.FSelectResFilter.Reverse := False; - finally - FilterList.Free; - end; - - GikoForm.SelectResWord := ''; - - GikoForm.RepaintAllTabsBrowser(); - end; + //@•\Ž¦”͈͂ðÝ’è‚·‚é + SetResRange(Ord( grrAll )); end; // ************************************************************************* //! ƒŒƒX‚Ì•\Ž¦”͈͂ðÝ’è @@ -1525,10 +1551,10 @@ begin str := ZenToHan(str); res := StrToIntDef(str, -1); if (res > 0) and (res <= GikoForm.GetActiveContent.Count) then begin - GikoForm.BrowserMovement(IntToStr(res), GikoForm.ActiveContent); + GikoForm.ActiveContent.Move(IntToStr(res)); SetFocusForBrowserAction.Execute; end else if res > GikoForm.GetActiveContent.Count then begin - GikoForm.BrowserMovement(IntToStr(GikoForm.GetActiveContent.Count), GikoForm.ActiveContent); + GikoForm.ActiveContent.Move(IntToStr(GikoForm.GetActiveContent.Count)); SetFocusForBrowserAction.Execute; end; end; @@ -1579,6 +1605,11 @@ end; ////////////////////////////////ƒXƒŒƒbƒh‚Ü‚Å‚¨‚µ‚Ü‚¢///////////////////// procedure TGikoDM.DataModuleCreate(Sender: TObject); begin + // GikoDM‚æ‚è‚à‘‚­‰Šú‰»‚³‚ê‚é•K—v‚ª‚ ‚éƒtƒ@ƒCƒ‹‚ª‚¢‚é‚Æ‚±‚¯‚éII + // ‰Šú‰»‡”Ô‚É’ˆÓ‚·‚邱‚ƁII + //‰‰ñ‹N“®Žž‚̏‰Šú‰»ƒtƒ@ƒCƒ‹Ý’è + TDefaultFileManager.CopyDefaultFiles( + GikoSys.GetAppDir + 'defaultFiles.ini'); end; // ************************************************************************* //! ƒƒOŒŸõƒ_ƒCƒAƒƒO‚ð•\Ž¦‚·‚é @@ -1641,8 +1672,8 @@ begin Dlg := TKeySettingForm.Create(GikoForm); try if Dlg.ShowModal = mrOk then begin - GikoSys.SaveKeySetting(GikoFormActionList); - GikoSys.SaveEditorKeySetting(Dlg.EditorForm.ActionList); + GikoSys.SaveKeySetting(GikoFormActionList, Setting.KEY_SETTING_FILE_NAME); + GikoSys.SaveKeySetting(Dlg.EditorForm.ActionList, Setting.EKEY_SETTING_FILE_NAME); GikoSys.Setting.Gestures.SaveGesture( GikoSys.Setting.GetGestureFileName ); end; @@ -1681,8 +1712,6 @@ procedure TGikoDM.ToolBarSettingActionExecute(Sender: TObject); var Dlg: TToolBarSettingDialog; i: Integer; - //Component: TComponent; - ToolButton : TToolButton; begin Dlg := TToolBarSettingDialog.Create(GikoForm, GikoFormActionList); try @@ -1903,7 +1932,7 @@ begin //ƒƒOƒAƒEƒg GikoSys.Dolib.Disconnect; LoginAction.Checked := False; - GikoForm.AddMessageList(GikoSys.Setting.GetMessage(Ord(gmLogout)), nil, gmiOK); + GikoForm.AddMessageList(GikoSys.GetGikoMessage(gmLogout), nil, gmiOK); LoginAction.Caption := 'ƒƒOƒCƒ“(&L)'; end else begin TmpCursor := GikoForm.ScreenCursor; @@ -1923,7 +1952,7 @@ begin end; if GikoSys.Dolib.Connect then begin LoginAction.Checked := True; - GikoForm.AddMessageList(GikoSys.Setting.GetMessage(Ord(gmLogin)) + GikoSys.Setting.UserID, nil, gmiOK); + GikoForm.AddMessageList(GikoSys.GetGikoMessage(gmLogin) + GikoSys.Setting.UserID, nil, gmiOK); LoginAction.Caption := 'ƒƒOƒAƒEƒg(&L)'; //LoginToolButton.Style := tbsCheck; end else begin @@ -1953,7 +1982,7 @@ begin GikoSys.Dolib.ForcedConnect; if GikoSys.Dolib.Connect then begin LoginAction.Checked := True; - GikoForm.AddMessageList(GikoSys.Setting.GetMessage(Ord(gmForceLogin)) + GikoSys.Setting.UserID, nil, gmiOK); + GikoForm.AddMessageList(GikoSys.GetGikoMessage(gmForceLogin) + GikoSys.Setting.UserID, nil, gmiOK); LoginAction.Caption := 'ƒƒOƒAƒEƒg(&L)'; //LoginToolButton.Style := tbsCheck; end else begin @@ -1983,9 +2012,9 @@ var Dlg: TNewBoardDialog; Msg: string; begin - if GikoForm.EditorFormExists then begin + if (EditorFormExists) then begin Msg := 'ƒŒƒXƒGƒfƒBƒ^‚ð‘S‚ĕ‚¶‚Ä‚­‚¾‚³‚¢'; - MsgBox(GikoForm.Handle, Msg, 'ƒGƒ‰[', MB_OK or MB_ICONSTOP); + MsgBox(GikoForm.Handle, Msg, MSG_ERROR, MB_OK or MB_ICONSTOP); Exit; end; Dlg := TNewBoardDialog.Create(GikoForm); @@ -2038,9 +2067,8 @@ begin GikoForm.DeleteHistory(ThreadItem); GikoForm.DeleteTab(ThreadItem); ThreadItem.DeleteLogFile; - - GikoForm.TreeView.Refresh; // UnRead ‚Ì•\Ž¦‚ðXV end; + GikoForm.TreeView.Refresh; // UnRead ‚Ì•\Ž¦‚ðXV GikoForm.ListView.Refresh; finally List.Free; @@ -2082,7 +2110,7 @@ begin if MsgBox(GikoForm.Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then Exit; GikoSys.Setting.NameList.Clear; - GikoForm.AllEditroFormNameTextClearClear; + ClearNameTextAllEditor end; // ************************************************************************* //! ƒŒƒXƒGƒfƒBƒ^‚̃[ƒ‹—š—ð‚ðÁ‹Ž‚·‚é @@ -2096,7 +2124,7 @@ begin if MsgBox(GikoForm.Handle, DEL_MSG, DEL_TITLE, MB_YESNO or MB_ICONWARNING or MB_DEFBUTTON2) <> ID_YES then Exit; GikoSys.Setting.MailList.Clear; - GikoForm.AllEditroFormMailTextClearClear; + ClearMailAllEditor; end; // ************************************************************************* //! ƒMƒRƒiƒr‚ðI—¹‚·‚é @@ -2124,9 +2152,9 @@ begin end; end; // ************************************************************************* -//! ‘I‘ðƒXƒŒƒbƒh‚ðHTML‰»‚µ‚Ä•Û‘¶ +//! ‘I‘ðƒXƒŒƒbƒh‚ðƒtƒ@ƒCƒ‹‚É•Û‘¶‚·‚é // ************************************************************************* -procedure TGikoDM.SelectItemSaveForHTMLExecute(Sender: TObject); +procedure TGikoDM.SelectThreadSaveToFile(dat: Boolean); var List: TList; i: Integer; @@ -2145,20 +2173,34 @@ begin else if(List.Count = 0) then ShowMessage('ƒXƒŒƒbƒh‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢') else begin - FileSaveAs1.Dialog.Title := '‘I‘ðƒXƒŒƒbƒh‚ðHTML‰»‚µ‚Ä•Û‘¶'; - FileSaveAs1.Dialog.Filter := 'HTMLƒtƒ@ƒCƒ‹(*.html)|*.html'; + if dat then begin + SaveDialog.Title := '‘I‘ðƒXƒŒƒbƒh‚ðdat‚Ì‚Ü‚Ü•Û‘¶'; + SaveDialog.Filter := 'DATƒtƒ@ƒCƒ‹(*.dat)|*.dat'; + end else begin + SaveDialog.Title := '‘I‘ðƒXƒŒƒbƒh‚ðHTML‰»‚µ‚Ä•Û‘¶'; + SaveDialog.Filter := 'HTMLƒtƒ@ƒCƒ‹(*.html)|*.html'; + end; for i := 0 to List.Count - 1 do begin if (TObject(List[i]) is TThreadItem) and (TThreadItem(List[i]).IsLogFile) then begin - FileSaveAs1.Dialog.FileName := ReplaseNoValidateChar(TThreadItem(List[i]).Title) + '.html'; - if FileSaveAs1.Dialog.Execute then begin - html := TStringList.Create; - title := TThreadItem(List[i]).Title; - try - HTMLCreater.CreateHTML3(html, TThreadItem(List[i]), title); - html.SaveToFile(FileSaveAs1.Dialog.FileName); - THTMLCreate.SkinorCSSFilesCopy(ExtractFilePath(FileSaveAs1.Dialog.FileName)); - finally - html.Free; + if dat then begin + SaveDialog.FileName := TThreadItem(List[i]).FileName; + end else begin + SaveDialog.FileName := ReplaseNoValidateChar(TThreadItem(List[i]).Title) + '.html'; + end; + if SaveDialog.Execute then begin + if dat then begin + CopyFile(PChar(TThreadItem(List[i]).FilePath), + PChar(SaveDialog.FileName), true); + end else begin + html := TStringList.Create; + title := TThreadItem(List[i]).Title; + try + HTMLCreater.CreateHTML3(html, TThreadItem(List[i]), title); + html.SaveToFile(SaveDialog.FileName); + THTMLCreate.SkinorCSSFilesCopy(ExtractFilePath(SaveDialog.FileName)); + finally + html.Free; + end; end; end; end; @@ -2170,80 +2212,127 @@ begin end; end; // ************************************************************************* +//! ‘I‘ðƒXƒŒƒbƒh‚ðHTML‰»‚µ‚Ä•Û‘¶ +// ************************************************************************* +procedure TGikoDM.SelectItemSaveForHTMLExecute(Sender: TObject); +begin + SelectThreadSaveToFile(false); +end; +// ************************************************************************* //! ‘I‘ðƒXƒŒƒbƒh‚ðDATŒ`Ž®‚Ì‚Ü‚Ü•Û‘¶ // ************************************************************************* procedure TGikoDM.SelectItemSaveForDatExecute(Sender: TObject); -var - List: TList; - i: Integer; begin - List := TList.Create; - try - GikoForm.ScreenCursor := crHourGlass; - GikoForm.SelectListItem(List); - if ((GikoSys.Setting.ListOrientation = gloVertical) and - (GikoSys.Setting.ListHeightState = glsMax)) or - ((GikoSys.Setting.ListOrientation = gloHorizontal) and - (GikoSys.Setting.ListWidthState = glsMax)) then - ShowMessage('ƒXƒŒƒbƒhˆê——‚ð•\Ž¦‚µ‚Ä‚­‚¾‚³‚¢') - else if(List.Count = 0) then - ShowMessage('ƒXƒŒƒbƒh‚ð‘I‘ð‚µ‚Ä‚­‚¾‚³‚¢') - else begin - FileSaveAs1.Dialog.Title := '‘I‘ðƒXƒŒƒbƒh‚ðdat‚Ì‚Ü‚Ü•Û‘¶'; - FileSaveAs1.Dialog.Filter := 'DATƒtƒ@ƒCƒ‹(*.dat)|*.dat'; - for i := 0 to List.Count - 1 do begin - if (TObject(List[i]) is TThreadItem) and (TThreadItem(List[i]).IsLogFile) then begin - FileSaveAs1.Dialog.FileName := TThreadItem(List[i]).FileName; - if FileSaveAs1.Dialog.Execute then begin - CopyFile(PChar(TThreadItem(List[i]).FilePath), - PChar(FileSaveAs1.Dialog.FileName), true); - end; - end; - end; - end; - finally - GikoForm.ScreenCursor := crDefault; - List.Free; - end; - + SelectThreadSaveToFile(true); end; // ************************************************************************* //! ƒ^ƒu‚̏‡”Ô‚ð•Û‘¶ // ************************************************************************* procedure TGikoDM.TabsSaveActionExecute(Sender: TObject); +const + Filename = 'tab.sav'; + bFilename = '~tab.sav'; +var + SaveStringList: TStringList; begin - if not GikoForm.SaveTabURLs then begin - if TabsSaveAction.Tag = 0 then - ShowMessage('•Û‘¶‚·‚éƒ^ƒu‚ª‚ ‚è‚Ü‚¹‚ñ') - else if TabsSaveAction.Tag = 1 then - GikoDM.TabsOpenAction.Tag := -1; + SaveStringList := TStringList.Create; + try + GetTabURLs(SaveStringList); + try + if FileExists( GikoSys.GetAppDir + Filename) then begin + CopyFile(PChar(GikoSys.GetAppDir + Filename), + PChar(GikoSys.GetAppDir + bFilename), False); + end; + except + end; + SaveStringList.SaveToFile(GikoSys.GetAppDir + Filename); + finally + SaveStringList.Free; end; end; // ************************************************************************* -//! ƒ^ƒu‚̏‡”Ԃ𕜌³ +//! ƒuƒ‰ƒEƒUƒ^ƒu‚ɐݒ肳‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚ÌURLŽæ“¾ // ************************************************************************* -procedure TGikoDM.TabsOpenActionExecute(Sender: TObject); +procedure TGikoDM.GetTabURLs(AStringList: TStringList); +var + rec : TBrowserRecord; + i : Integer; begin - if TabsOpenAction.Tag <> -1 then begin - if not GikoForm.LoadTabURLs then begin - if TabsOpenAction.Tag = 0 then - ShowMessage('•\Ž¦‚·‚éƒ^ƒu‚ª‚ ‚è‚Ü‚¹‚ñB'); - end; - end; + for i := 0 to GikoForm.BrowserTab.Tabs.Count -1 do begin + try + rec := TBrowserRecord( GikoForm.BrowserTab.Tabs.Objects[ i ] ); + if( rec <> nil) and (rec.Thread <> nil) then + AStringList.Add( rec.Thread.URL ); + except + end; + end; end; // ************************************************************************* -//! ƒ^ƒu‚̏‡”Ô‚ðŽ©“®•Û‘¶ +//! Žw’肳‚ꂽURL‚ðŠJ‚«Cæ“ª‚̃^ƒu‚ɃtƒH[ƒJƒX‚·‚é // ************************************************************************* -procedure TGikoDM.TabAutoSaveActionExecute(Sender: TObject); -begin - GikoForm.SaveTabURLs; +procedure TGikoDM.OpenURLs(AStringList: TStringList); +var + GikoTab : TGikoTabAppend; + i, bound : Integer; + item : TThreadItem; +begin + if (AStringList <> nil) then begin + GikoTab := GikoSys.Setting.BrowserTabAppend; + try + bound := AStringList.Count - 1; + if bound > -1 then begin + GikoSys.Setting.BrowserTabAppend := gtaLast; + for i := 0 to bound do begin + item := BBSsFindThreadFromURL( AStringList[ i ] ); + if item <> nil then + GikoForm.InsertBrowserTab( item, false ); + end; + //Å‰‚Ì‚P–‡‚ɐݒè + if (GikoSys.Setting.URLDisplay) and + (GikoForm.BrowserTab.Tabs.Count > 0) then begin + GikoForm.AddressComboBox.Text := + TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[0]).Thread.URL; + end; + end; + finally + GikoSys.Setting.BrowserTabAppend := GikoTab; + end; + end; end; // ************************************************************************* -//! ƒ^ƒu‚̏‡”Ô‚ðŽ©“®•œŒ³ +//! ƒ^ƒu‚̏‡”Ԃ𕜌³ // ************************************************************************* -procedure TGikoDM.TabAutoLoadActionExecute(Sender: TObject); +procedure TGikoDM.TabsOpenActionExecute(Sender: TObject); +const + TABFILE = 'tab.sav'; +var + URLs : TStringList; + fileName : string; begin - GikoForm.LoadTabURLs; + URLs := TStringList.Create(); + try + fileName := GikoSys.GetAppDir + TABFILE; + if FileExists(fileName) then begin + try + URLs.LoadFromFile(fileName); + if (URLs.Count = 0) then begin + // ‹ó‚̃tƒ@ƒCƒ‹‚̏ꍇCƒoƒbƒNƒAƒbƒv‚ðíœ‚µ‚È‚¢‚½‚߂ɍ폜 + SysUtils.DeleteFile(fileName); + end else begin + OpenURLs(URLs); + end; + except + on EFOpenError do ShowMessage('ƒ^ƒuƒtƒ@ƒCƒ‹‚ªŠJ‚¯‚Ü‚¹‚ñ'); + end; + end; + finally + URLs.Free; + end; + + if (GikoForm.BrowserTab.Tabs.Count = 0) and + (TabsOpenAction.Tag <> 1) then begin + ShowMessage('•\Ž¦‚·‚éƒ^ƒu‚ª‚ ‚è‚Ü‚¹‚ñB'); + end; end; // ************************************************************************* //! Be2ch‚ɃƒOƒCƒ“/ƒƒOƒAƒEƒg‚·‚é @@ -2274,12 +2363,13 @@ var ThreadItem: TThreadItem; begin No := GikoForm.KokoPopupMenu.Tag; - if No = 0 then Exit; - ThreadItem := GikoForm.GetActiveContent; - if ThreadItem = nil then Exit; + if No = 0 + then Exit; + ThreadItem := GikoForm.KokoPopupThreadItem; + if not Assigned(ThreadItem) then + Exit; ThreadItem.Kokomade := No; - GikoForm.ActiveContent.Thread.ScrollTop := - OleVariant(IHTMLDocument2(GikoForm.ActiveContent.Browser.Document)).Body.ScrollTop; + GikoForm.ActiveContent.Thread.ScrollTop := GikoForm.ActiveContent.Browser.OleObject.Document.Body.ScrollTop; GikoForm.ActiveContent.Repaint := true; GikoForm.InsertBrowserTab(GikoForm.ActiveContent.Thread, true); //INFO 2005/11/19 ˆê’U‰B•ÁA•K—v‚È‚çGikoForm‚Ì•û‚Ƀƒ\ƒbƒh‚ð’ljÁ‚·‚é @@ -2292,11 +2382,10 @@ procedure TGikoDM.ZenbuActionExecute(Sender: TObject); var ThreadItem: TThreadItem; begin - ThreadItem := GikoForm.GetActiveContent; + ThreadItem := GikoForm.GetActiveContent(True); if ThreadItem = nil then Exit; ThreadItem.Kokomade := -1; - GikoForm.ActiveContent.Thread.ScrollTop := - OleVariant(IHTMLDocument2(GikoForm.ActiveContent.Browser.Document)).Body.ScrollTop; + GikoForm.ActiveContent.Thread.ScrollTop := GikoForm.ActiveContent.Browser.OleObject.Document.Body.ScrollTop; GikoForm.ActiveContent.Repaint := true; GikoForm.InsertBrowserTab(GikoForm.ActiveContent.Thread, true); //INFO 2005/11/19 ˆê’U‰B•ÁA•K—v‚È‚çGikoForm‚Ì•û‚Ƀƒ\ƒbƒh‚ð’ljÁ‚·‚é @@ -2313,12 +2402,11 @@ var begin Number := GikoForm.KokoPopupMenu.Tag; if Number = 0 then Exit; - Item := GikoForm.GetActiveContent; + Item := GikoForm.KokoPopupThreadItem; if Item = nil then Exit; Editor := TEditorForm.Create(GikoForm); Editor.SetThreadItem(Item); - GikoSys.LoadEditorKeySetting(Editor.ActionList); Editor.BodyEdit.Text := '>>' + IntToStr(Number) + #13#10; Editor.Show; Editor.BodyEdit.SetFocus; @@ -2334,27 +2422,22 @@ end; //! ‘I‘ð‚µ‚½ƒŒƒX‚ðƒRƒs[‚·‚é // ************************************************************************* procedure TGikoDM.SameIDResAnchorActionExecute(Sender: TObject); +const + LIMIT = 20; var ThreadItem : TThreadItem; - No, count, rc : Integer; - body : string; - limited: boolean; + No : Integer; + AID: string; begin No := GikoForm.KokoPopupMenu.Tag; if No = 0 then Exit; - ThreadItem := GikoForm.GetActiveContent; + ThreadItem := GikoForm.KokoPopupThreadItem; if ThreadItem = nil then Exit; - count := GikoSys.GetSameIDResCount(No, GikoForm.ActiveContent.Thread); - limited := false; - if count > 20 then begin - rc := GikoUtil.MsgBox(GikoForm.Handle, - '20ŒÂˆÈã‚ ‚è‚Ü‚·‚ªA‚·‚ׂĕ\Ž¦‚µ‚Ü‚·‚©H', - 'IDƒ|ƒbƒvƒAƒbƒvŒx', - MB_YESNO or MB_ICONQUESTION); - limited := rc <> ID_YES; - end; - body := GikoSys.GetSameIDResAnchor(No, ThreadItem, limited); - GikoForm.IDAnchorPopup(body); + + AID := GikoSys.GetResID(No, ThreadItem); + if not IsNoValidID(AID) then begin + GikoForm.ShowSameIDAncher(AID); + end; end; // ************************************************************************* //! ‚±‚̃ŒƒX‚ ‚ځ`‚ñ@i’ʏíj @@ -2383,9 +2466,8 @@ var begin IndividualForm := TIndividualAbonForm.Create(GikoForm); try - ThreadItem := GikoForm.GetActiveContent; - ThreadItem.ScrollTop := - OleVariant(IHTMLDocument2(GikoForm.ActiveContent.Browser.Document)).Body.ScrollTop; + ThreadItem := GikoForm.GetActiveContent(True); + ThreadItem.ScrollTop := GikoForm.ActiveContent.Browser.OleObject.Document.Body.ScrollTop; if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin ReadList := TStringList.Create; @@ -2431,9 +2513,8 @@ var begin IndividualForm := TIndividualAbonForm.Create(GikoForm); try - ThreadItem := GikoForm.GetActiveContent; - ThreadItem.ScrollTop := - OleVariant(IHTMLDocument2(GikoForm.ActiveContent.Browser.Document)).Body.ScrollTop; + ThreadItem := GikoForm.GetActiveContent(True); + ThreadItem.ScrollTop := GikoForm.ActiveContent.Browser.OleObject.Document.Body.ScrollTop; if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin if (IndividualForm.ShowModal = mrOK) then begin @@ -2487,21 +2568,21 @@ end; // ************************************************************************* procedure TGikoDM.GikoNaviWebPageActionExecute(Sender: TObject); begin - GikoSys.OpenBrowser(URL_GIKONAVI, gbtAuto); + GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_GIKONAVI, gbtAuto); end; // ************************************************************************* //! ƒ‚ƒiƒWƒ‰‚̃EƒFƒuƒTƒCƒg‚ð•\Ž¦‚·‚é // ************************************************************************* procedure TGikoDM.MonazillaWebPageActionExecute(Sender: TObject); begin - GikoSys.OpenBrowser(URL_MONAZILLA, gbtAuto); + GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_MONAZILLA, gbtAuto); end; // ************************************************************************* //! ‚Q‚¿‚á‚ñ‚Ë‚éƒgƒbƒvƒy[ƒW‚ð•\Ž¦‚·‚é // ************************************************************************* procedure TGikoDM.BBS2chWebPageActionExecute(Sender: TObject); begin - GikoSys.OpenBrowser(URL_2ch, gbtAuto); + GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_2ch, gbtAuto); end; // ************************************************************************* //! ƒMƒRƒiƒr‚̃tƒHƒ‹ƒ_‚ðŠJ‚­ @@ -2538,7 +2619,7 @@ begin 'ƒwƒ‹ƒv‚ªŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½' + #13#10 + 'ƒwƒ‹ƒvƒtƒ@ƒCƒ‹‚ðƒMƒRƒiƒr‚̃tƒHƒ‹ƒ_‚É’u‚¢‚Ä‚­‚¾‚³‚¢' + #13#10 + 'ƒwƒ‹ƒv‚̓MƒRƒiƒr‚̃TƒCƒg‚É’u‚¢‚Ä‚ ‚è‚Ü‚·', - 'ƒGƒ‰[', + MSG_ERROR, MB_ICONSTOP); Exit; end; @@ -2549,7 +2630,7 @@ end; // ************************************************************************* procedure TGikoDM.WikiFAQWebPageActionExecute(Sender: TObject); begin - GikoSys.OpenBrowser(URL_Wiki, gbtAuto); + GikoSys.OpenBrowser(PROTOCOL_HTTP + URL_Wiki, gbtAuto); end; ////////////////////////////////ƒwƒ‹ƒv‚Ü‚Å‚¨‚µ‚Ü‚¢///////////////////// // ************************************************************************* @@ -2577,7 +2658,8 @@ end; // ************************************************************************* procedure TGikoDM.UpFolderActionUpdate(Sender: TObject); begin - UpFolderAction.Enabled := not (GikoForm.GetActiveList is TBBS); + UpFolderAction.Enabled := not (GikoForm.GetActiveList is TBBS) and + (GikoForm.GetActiveList <> BoardGroup.SpecialBoard); end; // ************************************************************************* //! •\Ž¦@•\Ž¦ƒŠƒXƒg‚̃‚[ƒh•ÏX @@ -2592,6 +2674,17 @@ begin end; end; // ************************************************************************* +//! SelectComboBox‚Ì’l‚ðƒNƒŠƒA‚·‚é +// ************************************************************************* +procedure TGikoDM.ClearSelectComboBox; +begin + if GikoForm.SelectComboBoxPanel.Visible then begin + GikoForm.SelectComboBox.Text := SELECTCOMBOBOX_NAME; + GikoForm.SelectComboBox.Color := SELECTCOMBOBOX_COLOR; + GikoForm.ListView.SetFocus; + end; +end; +// ************************************************************************* //! ƒXƒŒƒbƒh‚ð‚·‚×‚Ä•\Ž¦‚·‚é // ************************************************************************* procedure TGikoDM.AllItemActionExecute(Sender: TObject); @@ -2604,11 +2697,7 @@ begin // SelectComboBox ‚Ì—š—ð‚ðXV‚µ‚Ä‚¨‚­ GikoForm.ModifySelectList; // SelectComboBox ‚Ì’l‚ðƒNƒŠƒA - if GikoForm.SelectComboBoxPanel.Visible then begin - GikoForm.SelectComboBox.Text := SELECTCOMBOBOX_NAME; - GikoForm.SelectComboBox.Color := SELECTCOMBOBOX_COLOR; - GikoForm.ListView.SetFocus; - end; + ClearSelectComboBox; except end; end; @@ -2625,11 +2714,7 @@ begin // SelectComboBox ‚Ì—š—ð‚ðXV‚µ‚Ä‚¨‚­ GikoForm.ModifySelectList; // SelectComboBox ‚Ì’l‚ðƒNƒŠƒA - if GikoForm.SelectComboBoxPanel.Visible then begin - GikoForm.SelectComboBox.Text := SELECTCOMBOBOX_NAME; - GikoForm.SelectComboBox.Color := SELECTCOMBOBOX_COLOR; - GikoForm.ListView.SetFocus; - end; + ClearSelectComboBox; except end; end; @@ -2647,15 +2732,46 @@ begin // SelectComboBox ‚Ì—š—ð‚ðXV‚µ‚Ä‚¨‚­ GikoForm.ModifySelectList; // SelectComboBox ‚Ì’l‚ðƒNƒŠƒA - if GikoForm.SelectComboBoxPanel.Visible then begin - GikoForm.SelectComboBox.Text := SELECTCOMBOBOX_NAME; - GikoForm.SelectComboBox.Color := SELECTCOMBOBOX_COLOR; - GikoForm.ListView.SetFocus; - end; + ClearSelectComboBox; except end; end; // ************************************************************************* +//! DAT—Ž‚¿ƒXƒŒƒbƒh‚Ì‚Ý•\Ž¦‚·‚é +// ************************************************************************* +procedure TGikoDM.ArchiveItemActionExecute(Sender: TObject); +begin + try + if GikoForm.ViewType <> gvtArch then + GikoForm.SetListViewType(gvtArch); + GikoSys.Setting.ThreadRange := gtrArch; + ArchiveItemAction.Checked := True; + // SelectComboBox ‚Ì—š—ð‚ðXV‚µ‚Ä‚¨‚­ + GikoForm.ModifySelectList; + // SelectComboBox ‚Ì’l‚ðƒNƒŠƒA + ClearSelectComboBox; + except + end; +end; +// ************************************************************************* +//! ¶‘¶ƒXƒŒƒbƒh‚Ì‚Ý•\Ž¦‚·‚é +// ************************************************************************* +procedure TGikoDM.LiveItemActionExecute(Sender: TObject); +begin + try + if GikoForm.ViewType <> gvtLive then + GikoForm.SetListViewType(gvtLive); + GikoSys.Setting.ThreadRange := gtrLive; + LiveItemAction.Checked := True; + // SelectComboBox ‚Ì—š—ð‚ðXV‚µ‚Ä‚¨‚­ + GikoForm.ModifySelectList; + // SelectComboBox ‚Ì’l‚ðƒNƒŠƒA + ClearSelectComboBox; + except + end; +end; + +// ************************************************************************* //! ƒXƒŒƒbƒh‚Ì•\Ž¦”͈͂ðÝ’è // ************************************************************************* procedure TGikoDM.ThreadRangeActionExecute(Sender: TObject); @@ -2664,6 +2780,8 @@ begin gtrAll: AllItemAction.Execute; gtrLog: LogItemAction.Execute; gtrNew: NewItemAction.Execute; + gtrArch: ArchiveItemAction.Execute; + gtrLive: LiveItemAction.Execute; end; end; // ************************************************************************* @@ -2814,7 +2932,9 @@ begin try GikoForm.SelectListItem(List); for i := 0 to List.Count - 1 do begin - if TObject(List[i]) is TBoard then + if TObject(List[i]) is TCategory then + s := s + TCategory(List[i]).Title + #13#10 + else if TObject(List[i]) is TBoard then s := s + TBoard(List[i]).Title + #13#10 else if TObject(List[i]) is TThreadItem then s := s + TThreadItem(List[i]).Title + #13#10; @@ -2830,7 +2950,8 @@ end; // ************************************************************************* procedure TGikoDM.SelectItemNameCopyActionUpdate(Sender: TObject); begin - if ((GikoForm.GetActiveList is TBoard) or + if ((GikoForm.GetActiveList is TBBS) or + (GikoForm.GetActiveList is TBoard) or (GikoForm.GetActiveList is TCategory))and (GikoForm.ListView.SelCount > 0) then TAction(Sender).Enabled := True else @@ -2872,6 +2993,7 @@ var shiftDown: Boolean; begin shiftDown := GetAsyncKeyState(VK_SHIFT) = Smallint($8001); + GikoForm.ActiveListColumnSave; if GikoForm.GetActiveList is TCategory then begin List := TList.Create; try @@ -2900,9 +3022,10 @@ procedure TGikoDM.SelectListReloadActionUpdate(Sender: TObject); begin if (GikoForm.GetActiveList is TCategory) and (GikoForm.ListView.SelCount > 0) then TAction(Sender).Enabled := True - else if GikoForm.GetActiveList is TBoard then - TAction(Sender).Enabled := True - else + else if GikoForm.GetActiveList is TBoard then begin + TAction(Sender).Enabled := + (GikoForm.GetActiveList <> BoardGroup.SpecialBoard); + end else TAction(Sender).Enabled := False; end; // ************************************************************************* @@ -2996,7 +3119,7 @@ begin cnt := RoundList.Count[grtBoard]; cnt := cnt + RoundList.Count[grtItem]; if cnt > 500 then begin - MsgBox(GikoForm.Handle, '„‰ñ‚Í500ˆÈã“o˜^‚Å‚«‚Ü‚¹‚ñ', 'ƒGƒ‰[', MB_OK or MB_ICONSTOP); + MsgBox(GikoForm.Handle, '„‰ñ‚Í500ˆÈã“o˜^‚Å‚«‚Ü‚¹‚ñ', MSG_ERROR, MB_OK or MB_ICONSTOP); Exit; end; @@ -3100,8 +3223,10 @@ end; // ************************************************************************* procedure TGikoDM.LogFolderOpenActionUpdate(Sender: TObject); begin - if ((GikoForm.GetActiveList is TBoard) or (GikoForm.GetActiveList is TCategory)) - and (GikoForm.ListView.SelCount > 0) then + if (((GikoForm.GetActiveList is TBoard) and + (GikoForm.GetActiveList <> BoardGroup.SpecialBoard)) + or (GikoForm.GetActiveList is TCategory)) + and (GikoForm.ListView.SelCount > 0) then TAction(Sender).Enabled := True else TAction(Sender).Enabled := False; @@ -3139,26 +3264,44 @@ begin end; // ************************************************************************* +//! ƒXƒŒˆê——‚Ì•\Ž¦‚µ‚Ä‚¢‚é“à—e‚É‚µ‚½‚ª‚Á‚āAƒ\[ƒgƒJƒ‰ƒ€‚̈ʒu‚Æ•ûŒü‚ðŽæ“¾‚·‚é +// ************************************************************************* +function TGikoDM.GetSortProperties(List: TObject; + var vSortOrder: Boolean): Boolean; +begin + Result := True; + if (List <> nil) then begin + if (List is TBBS) then begin + vSortOrder := GikoSys.Setting.BBSSortOrder; + end else if (List is TCategory) then begin + vSortOrder := GikoSys.Setting.CategorySortOrder; + end else if (List is TBoard) then begin + vSortOrder := GikoSys.Setting.BoardSortOrder; + end else begin + Result := False; + end; + end else begin + Result := False; + end; +end; +// ************************************************************************* //! Œ»Ý‚̃Jƒ‰ƒ€‚ðƒ\[ƒg‚·‚é // ************************************************************************* procedure TGikoDM.SortActiveColumnActionExecute(Sender: TObject); var i : Integer; so : boolean; - si : Integer; begin - for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin - if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or - (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT2) then begin - GikoForm.SortOrder := not GikoForm.SortOrder; - so := GikoForm.SortOrder; - si := GikoForm.SortIndex; - TListViewUtils.ListViewSort(nil, GikoForm.ListView, - GikoForm.ListView.Column[ i ], ListNumberVisibleAction.Checked, - so, si ); - GikoForm.SortIndex := si; - GikoForm.SortOrder := so; - break; + if GetSortProperties(GikoForm.GetActiveList, so) then begin + for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin + if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or + (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT2) then begin + so := not so; + TListViewUtils.ListViewSort(nil, GikoForm.ListView, + GikoForm.ListView.Column[ i ], ListNumberVisibleAction.Checked, + so); + break; + end; end; end; end; @@ -3168,8 +3311,6 @@ end; procedure TGikoDM.SortNextColumnActionExecute(Sender: TObject); var i, id : Integer; - so : boolean; - si : Integer; begin for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or @@ -3177,14 +3318,9 @@ begin id := i + 1; if id > GikoForm.ListView.Columns.Count - 1 then id := 0; - GikoForm.SortOrder := id = 0; - so := GikoForm.SortOrder; - si := GikoForm.SortIndex; TListViewUtils.ListViewSort( nil, GikoForm.ListView, GikoForm.ListView.Column[ id ], ListNumberVisibleAction.Checked, - so, si ); - GikoForm.SortIndex := si; - GikoForm.SortOrder := so; + id = 0); break; end; end; @@ -3195,8 +3331,6 @@ end; procedure TGikoDM.SortPrevColumnActionExecute(Sender: TObject); var i, id : Integer; - so : boolean; - si : Integer; begin for i := 0 to GikoForm.ListView.Columns.Count - 1 do begin if (GikoForm.ListView.Column[ i ].ImageIndex = ITEM_ICON_SORT1) or @@ -3204,14 +3338,9 @@ begin id := i - 1; if id < 0 then id := GikoForm.ListView.Columns.Count - 1; - GikoForm.SortOrder := id = 0; - so := GikoForm.SortOrder; - si := GikoForm.SortIndex; TListViewUtils.ListViewSort( nil, GikoForm.ListView, GikoForm.ListView.Column[ id ], ListNumberVisibleAction.Checked, - so, si ); - GikoForm.SortIndex := si; - GikoForm.SortOrder := so; + id = 0); break; end; end; @@ -3651,7 +3780,7 @@ end; // ************************************************************************* procedure TGikoDM.SetFocusForBrowserActionExecute(Sender: TObject); begin - GikoForm.ActiveContent.Browser.SetFocus; + GikoForm.ActiveContent.Browser.SetFocus; end; // ************************************************************************* //! ƒuƒ‰ƒEƒU‚ɃtƒH[ƒJƒX‚ð“–‚Ä‚éUpdateƒCƒxƒ“ƒg @@ -3736,33 +3865,20 @@ end; //! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚ðŠù“Ç‚É‚·‚é // ************************************************************************* procedure TGikoDM.KidokuActionExecute(Sender: TObject); -var - List: TList; - i: Integer; begin - List := TList.Create; - try - GikoForm.SelectListItem(List); - for i := 0 to List.Count - 1 do begin - if TObject(List[i]) is TThreadItem then begin - if (TThreadItem(List[i]).UnRead) then begin - TThreadItem(List[i]).UnRead := false; - TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead - 1; - end; - end; - end; - if GikoForm.TreeView.Visible then - GikoForm.TreeView.Refresh; - if GikoForm.ListView.Visible then - GikoForm.ListView.Refresh; - finally - List.Free; - end; + SetThreadReadProperty(true); end; // ************************************************************************* //! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚𖢓ǂɂ·‚é // ************************************************************************* procedure TGikoDM.MidokuActionExecute(Sender: TObject); +begin + SetThreadReadProperty(false); +end; +// ************************************************************************* +//! ‘I‘ð‚³‚ê‚Ä‚¢‚éƒXƒŒƒbƒh‚Ì–¢“ǁEŠù“Ç‚ðÝ’è‚·‚é true : Šù“Ç false : –¢“Ç +// ************************************************************************* +procedure TGikoDM.SetThreadReadProperty(read: Boolean); var List: TList; i: Integer; @@ -3772,9 +3888,8 @@ begin GikoForm.SelectListItem(List); for i := 0 to List.Count - 1 do begin if TObject(List[i]) is TThreadItem then begin - if (TThreadItem(List[i]).IsLogFile) and (not TThreadItem(List[i]).UnRead) then begin - TThreadItem(List[i]).UnRead := true; - TThreadItem(List[i]).ParentBoard.UnRead := TThreadItem(List[i]).ParentBoard.UnRead + 1; + if (TThreadItem(List[i]).IsLogFile) then begin + TThreadItem(List[i]).UnRead := not read; end; end; end; @@ -3801,5 +3916,760 @@ begin AllSelectAction.Enabled := GikoForm.ListView.SelCount > 0; end; ////////////////////////////////•ÒW‚Ü‚Å‚¨‚µ‚Ü‚¢///////////////////// +//! ƒXƒŒƒbƒh‚̃TƒCƒY‚ðÄŒvŽZ‚·‚é +procedure TGikoDM.ThreadSizeCalcForFileActionExecute(Sender: TObject); +const + RECALC_MES : String = 'ƒXƒŒƒbƒh‚Ì—e—Ê‚ðƒtƒ@ƒCƒ‹‚©‚çÄŒvŽZ‚µ‚Ü‚·B'#13#10 + + '‚±‚Ì‘€ì’†AƒMƒRƒiƒr‚Ì‘¼‚Ì‘€ì‚ð‚·‚é‚ƃf[ƒ^‚ª”j‰ó‚³‚ê‚é‹°‚ꂪ‚ ‚è‚Ü‚·B' + + '‚Ü‚½‚±‚Ì‘€ì‚́A”ñí‚ÉŽžŠÔ‚ª‚©‚©‚éê‡‚ª‚ ‚è‚Ü‚·‚ªA‚æ‚낵‚¢‚Å‚·‚©H'; + RECALC_TITLE : String = 'ƒXƒŒƒbƒh‚Ì—e—Ê‚ðƒtƒ@ƒCƒ‹‚©‚çÄŒvŽZ'; + LIMIT_SIZE = 1024; +var + limitSize : Integer; + limitStr : String; +begin +{ ‚Ü‚¸AŽžŠÔ‚ª‚©‚©‚邱‚Æ‚ðŒx‚·‚郁ƒbƒZ[ƒW‚ðo—Í + ÄŒvŽZ‚·‚éƒXƒŒƒbƒh‚̃TƒCƒY‚Ì臒liƒfƒtƒHƒ‹ƒg1024B)‚ðŠm”F + ƒvƒ‰ƒOƒCƒ“‚ð—˜—p‚µ‚È‚¢‚Æ‚±‚ë‚Å‘S‚ẴƒO—L‚èƒXƒŒƒbƒh‚ðŒŸõ + 臒lˆÈ‰º‚̃TƒCƒY‚̏ꍇADAT‚̃tƒ@ƒCƒ‹ƒTƒCƒY‚Æ”äŠrA‚¸‚ê‚Ä‚¢‚ê‚΁A + DAT‚̃tƒ@ƒCƒ‹ƒTƒCƒY‚ōXV‚·‚é +} + if MsgBox(GikoForm.Handle, RECALC_MES, + RECALC_TITLE, MB_YESNO or MB_ICONWARNING) = ID_YES then begin + //臒l‚ÌŠm”F + limitSize := LIMIT_SIZE; + limitStr := IntToStr(limitSize); + if InputQuery('臒l“ü—Í', 'Žw’肵‚½”’l BˆÈ‰º‚Ì—e—ʂ̃XƒŒƒbƒh‚̂ݍČvŽZ‚µ‚Ü‚·', limitStr) then begin + limitSize := StrToInt(MojuUtils.ZenToHan(limitStr)); + if (limitSize < 0) then begin + ShowMessage('臒l‚É•‰‚ÍŽw’è‚Å‚«‚Ü‚¹‚ñI'); + ThreadSizeCalcForFileActionExecute(nil); + end else begin + RecalcThreadSize(limitSize); + end; + end; + end; +end; +//! limit‚æ‚è‚àƒTƒCƒY‚̏¬‚³‚¢ƒXƒŒƒbƒh‚Ì—e—Ê‚ðDATƒtƒ@ƒCƒ‹‚©‚çŒvŽZ +procedure TGikoDM.RecalcThreadSize(limit : Integer); +var + i, j, tmpSize : Integer; + Obj : TObject; + Board : TBoard; + Thread: TThreadItem; + dat : TStringList; +begin + // ÄŒvŽZƒXƒ^[ƒg@ƒvƒ‰ƒOƒCƒ“‚ð—˜—p‚µ‚È‚¢‚Æ‚±‚ë‚ð‘S•”Œ©‚éI + GikoForm.ScreenCursor := crHourGlass; + try + GikoForm.ProgressBar.Max := BoardGroups[0].Count; + for i := 0 to BoardGroups[0].Count - 1 do begin + Obj := BoardGroups[0].Objects[i]; + if (Obj <> nil) then begin + Board := TBoard(Obj); + if not Board.IsThreadDatRead then begin + GikoSys.ReadSubjectFile(Board); + end; + for j := 0 to Board.Count - 1 do begin + Thread := Board.Items[j]; + if (Thread <> nil) and (Thread.IsLogFile) + and (Thread.Size <= limit) then begin + dat := TStringList.Create; + try + tmpSize := Thread.Size; + try + dat.LoadFromFile(Thread.GetThreadFileName); + tmpSize := Length(dat.Text); + tmpSize := tmpSize - dat.Count; + except + end; + Thread.Size := tmpSize; + finally + dat.Free; + end; + end; + end; + end; + GikoForm.ProgressBar.StepBy(1); + end; + finally + GikoForm.ScreenCursor := crDefault; + end; + GikoForm.ProgressBar.Position := 0; + ShowMessage('ŒvŽZI—¹‚µ‚Ü‚µ‚½B'); +end; +// ************************************************************************* +//! “ü—̓AƒVƒXƒg‚̐ݒèƒtƒH[ƒ€‚ðŒÄ‚яo‚· +// ************************************************************************* +procedure TGikoDM.SetInputAssistActionExecute(Sender: TObject); +var + form : TInputAssistForm; +begin + form := TInputAssistForm.Create(GikoForm); + try + form.SetUpFromMain; + form.ShowModal; + finally + form.Release; + end; +end; +// ************************************************************************* +//! Œ»Ý•\Ž¦‚µ‚Ä‚¢‚éƒXƒŒƒbƒh‚ÌŒŸõƒ_ƒCƒAƒƒO‚ð•\Ž¦‚·‚é +// ************************************************************************* +procedure TGikoDM.OpenFindDialogActionExecute(Sender: TObject); +begin + if( GikoForm.ActiveContent <> nil) and (GikoForm.ActiveContent.Browser <> nil) then begin + GikoForm.ActiveContent.OpenFindDialog; + end; +end; + +// ************************************************************************* +//! ‘I‘ð‚³‚ê‚Ä‚¢‚邨‹C‚É“ü‚è‚Ì•\Ž¦–¼‚ðƒRƒs[‚·‚é +// ************************************************************************* +procedure TGikoDM.FavoriteTreeViewItemNameCopyActionExecute( + Sender: TObject); +begin + if GikoForm.ClickNode = nil then Exit; + + Clipboard.AsText := + GikoForm.ClickNode.Text + #13#10; +end; + +// ************************************************************************* +//! •\Ž¦‚³‚ê‚Ä‚¢‚é‚·‚ׂẴŒƒXƒGƒfƒBƒ^‚ð•Â‚¶‚é +// ************************************************************************* +procedure TGikoDM.CloseAllEditorActionExecute(Sender: TObject); +var + i : Integer; +begin + if ( EditorFormExists ) then begin + //ƒXƒNƒŠ[ƒ“ã‚Ì‘S‚ẴtƒH[ƒ€‚©‚çAEditorForm‚ð•Â‚¶‚é + for i := Screen.CustomFormCount - 1 downto 0 do begin + if TObject(Screen.CustomForms[i]) is TEditorForm then begin + TEditorForm(Screen.CustomForms[i]).Close; + end; + end; + end; +end; +// ************************************************************************* +//! ƒXƒNƒŠ[ƒ“ã‚ɃŒƒXƒGƒfƒBƒ^‚ª‚¢‚½ê‡C—LŒø‚É‚È‚é +// ************************************************************************* +procedure TGikoDM.CloseAllEditorActionUpdate(Sender: TObject); +begin + if (Sender is TAction) then begin + TAction(Sender).Enabled := EditorFormExists; + end; +end; +// ************************************************************************* +//! ƒXƒNƒŠ[ƒ“ã‚ÉEditorForm‚ª‚¢‚é‚© +// ************************************************************************* +function TGikoDM.EditorFormExists(): boolean; +var + i : Integer; +begin + Result := false; + //ƒXƒNƒŠ[ƒ“ã‚Ì‘S‚ẴtƒH[ƒ€‚©‚çAEditorForm‚ð’T‚· + for i := Screen.CustomFormCount - 1 downto 0 do begin + if (Screen.CustomForms[i] is TEditorForm) then begin + Result := true; + Break; + end; + end; +end; + +// ************************************************************************* +//! ƒXƒNƒŠ[ƒ“ã‚É‚¢‚é‚·‚ׂĂÌEditorForm‚©‚ç–¼‘O‚Ì—š—ð‚ðíœ‚·‚é +// ************************************************************************* +procedure TGikoDM.ClearNameTextAllEditor(); +var + i : Integer; +begin + for i := 0 to Screen.CustomFormCount - 1 do begin + if (Screen.CustomForms[i] is TEditorForm) then begin + TEditorForm(Screen.CustomForms[i]).NameComboBox.Items.Clear; + end; + end; +end; +// ************************************************************************* +//! ƒXƒNƒŠ[ƒ“ã‚É‚¢‚é‚·‚ׂĂÌEditorForm‚©‚烁[ƒ‹—š—ð‚ðíœ‚·‚é +// ************************************************************************* +procedure TGikoDM.ClearMailAllEditor(); +var + i : Integer; +begin + for i := 0 to Screen.CustomFormCount - 1 do begin + if TObject(Screen.CustomForms[i]) is TEditorForm then + TEditorForm(Screen.CustomForms[i]).MailComboBox.Items.Clear; + end; +end; + +// ************************************************************************* +//! ƒŠƒ“ƒN—š—ð‚ð–ß‚é‚̍XVˆ— +// ************************************************************************* +procedure TGikoDM.PrevMoveHistoryUpdate(Sender: TObject); +begin + PrevMoveHistory.Enabled := + (MoveHisotryManager.HisotryIndex > 0) +end; +// ************************************************************************* +//! ƒŠƒ“ƒN—š—ð‚ð–ß‚é +// ************************************************************************* +procedure TGikoDM.PrevMoveHistoryExecute(Sender: TObject); +begin + if ( GikoForm.BrowserTab.TabIndex >= 0 ) then begin + BackToHistory(MoveHisotryManager.getPrevItem + (TBrowserRecord(GikoForm.BrowserTab.Tabs + .Objects[GikoForm.BrowserTab.TabIndex]))); + end else begin + BackToHistory(MoveHisotryManager.getPrevItem( nil ) ); + end; +end; +//! ƒŠƒ“ƒN—š—ðˆ— +procedure TGikoDM.BackToHistory(item: TMoveHistoryItem); +var + browser : TWebBrowser; + doc : IHTMLDocument2; +begin + if ( item <> nil ) then begin + if ( GikoForm.GetActiveContent = item.ThreadItem ) then begin + browser := TBrowserRecord(GikoForm.BrowserTab.Tabs + .Objects[GikoForm.BrowserTab.TabIndex]).Browser; + if (browser <> nil) then begin + try + doc := browser.ControlInterface.Document as IHTMLDocument2; + (doc.body as IHTMLElement2).ScrollTop := item.ScrollTop; + except + end; + end; + end else begin + //URL‚Ɉړ® + MoveURLWithHistory(item.ThreadItem.URL, True); + end; + end; +end; +//! —š—ðˆ—‚‚«URLˆÚ“® +procedure TGikoDM.MoveURLWithHistory(URL : String; KeyMask: Boolean = False); +var + idx : Integer; +begin + //URL‚Ɉړ® + GikoForm.MoveToURL(URL, KeyMask); + //ˆÈ‰ºA—š—ð‚̏ˆ— + idx := GikoForm.AddressComboBox.Items.IndexOf(URL); + if idx = -1 then begin + GikoForm.AddressComboBox.Items.Insert(0, URL); + if GikoForm.AddressComboBox.Items.Count > GikoSys.Setting.AddressHistoryCount then + GikoForm.AddressComboBox.Items.Delete(GikoForm.AddressComboBox.Items.Count - 1); + end else begin + GikoForm.AddressComboBox.Items.Delete(idx); + GikoForm.AddressComboBox.Items.Insert(0, URL); + end; +end; +// ************************************************************************* +//! ƒŠƒ“ƒN—š—ð‚ði‚ނ̍XVˆ— +// ************************************************************************* +procedure TGikoDM.NextMoveHistoryUpdate(Sender: TObject); +begin + NextMoveHistory.Enabled := + (MoveHisotryManager.HisotryIndex < MoveHisotryManager.Count - 1); +end; +// ************************************************************************* +//! ƒŠƒ“ƒN—š—ð‚ði‚Þ +// ************************************************************************* +procedure TGikoDM.NextMoveHistoryExecute(Sender: TObject); +begin + BackToHistory(MoveHisotryManager.getNextItem); +end; +// ************************************************************************* +//! ƒAƒNƒeƒBƒu—v‘f‚̃NƒŠƒbƒN +// ************************************************************************* +procedure TGikoDM.ClickActiveElementActionExecute(Sender: TObject); +var + browser : TWebBrowser; + elem : IHTMLElement; + doc : IHTMLDocument2; +begin + if (GikoForm.GetActiveContent <> nil) then begin + if (GikoForm.BrowserTab.Tabs.Count > 0) and + (GikoForm.BrowserTab.TabIndex >= 0) then begin + browser := TBrowserRecord(GikoForm.BrowserTab.Tabs + .Objects[GikoForm.BrowserTab.TabIndex]).Browser; + if (browser <> nil) then begin + try + doc := browser.ControlInterface.Document as IHTMLDocument2; + if Assigned(doc) then begin + elem := doc.activeElement; + if Assigned(elem) then begin + elem.click; + end; + end; + except + end; + end; + + end; + end; +end; +//! «ƒL[‚̃Gƒ~ƒ…ƒŒ[ƒgƒAƒNƒVƒ‡ƒ“ +procedure TGikoDM.VKDownActionExecute(Sender: TObject); +begin + keybd_event(VK_DOWN, 0, KEYEVENTF_EXTENDEDKEY, 0); + keybd_event(VK_DOWN, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); +end; +//! ªƒL[‚̃Gƒ~ƒ…ƒŒ[ƒgƒAƒNƒVƒ‡ƒ“ +procedure TGikoDM.VKUpActionExecute(Sender: TObject); +begin + keybd_event(VK_UP, 0, KEYEVENTF_EXTENDEDKEY, 0); + keybd_event(VK_UP, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); +end; +//! ¨ƒL[‚̃Gƒ~ƒ…ƒŒ[ƒgƒAƒNƒVƒ‡ƒ“ +procedure TGikoDM.VKRightActionExecute(Sender: TObject); +begin + keybd_event(VK_RIGHT, 0, KEYEVENTF_EXTENDEDKEY, 0); + keybd_event(VK_RIGHT, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); +end; +//! ©ƒL[‚̃Gƒ~ƒ…ƒŒ[ƒgƒAƒNƒVƒ‡ƒ“ +procedure TGikoDM.VKLeftActionExecute(Sender: TObject); +begin + keybd_event(VK_LEFT, 0, KEYEVENTF_EXTENDEDKEY, 0); + keybd_event(VK_LEFT, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0); +end; +//! ƒ^ƒXƒNƒgƒŒƒC‚ÉŠi”[‚·‚é +procedure TGikoDM.StoredTaskTrayActionExecute(Sender: TObject); +begin + GikoForm.StoredTaskTray; + StoredTaskTrayAction.Tag := -1; +end; + +{ +\breif ƒŠƒ“ƒNƒCƒ[ƒWŽæ“¾ +ƒCƒ[ƒW‚́C*.jpg, *.jpeg, *.gif, *.png +} +procedure TGikoDM.AllImageLinkToClipbordActionExecute(Sender: TObject); +var + links : IHTMLElementCollection; + urls, exts : TStringList; +begin + links := GetActiveThreadLinks; + if (links <> nil) then begin + urls := TStringList.Create; + exts := TStringList.Create; + try + exts.CaseSensitive := False; + exts.Sorted := True; + exts.Delimiter := ';'; + exts.DelimitedText := '.gif;.jpg;.jpeg;.png'; + GetLinkURLs(links, urls, 0, exts); + Clipboard.SetTextBuf(urls.GetText); + finally + exts.Free; + urls.Free; + end; + end; +end; + +{ +\breif V’…ƒŒƒX‚̃Šƒ“ƒNƒCƒ[ƒWŽæ“¾ +ƒCƒ[ƒW‚́C*.jpg, *.jpeg, *.gif, *.png +} +procedure TGikoDM.NewImageLinkToClipBoardActionExecute(Sender: TObject); +var + links : IHTMLElementCollection; + urls, exts : TStringList; + ThreadItem : TThreadItem; +begin + ThreadItem := GikoForm.GetActiveContent; + links := GetActiveThreadLinks; + if (ThreadItem <> nil) and (links <> nil) then begin + urls := TStringList.Create; + exts := TStringList.Create; + try + exts.CaseSensitive := False; + exts.Sorted := True; + exts.Delimiter := ';'; + exts.DelimitedText := '.gif;.jpg;.jpeg;.png'; + + GetLinkURLs(links, urls, + (ThreadItem.Count - ThreadItem.NewResCount + 1), exts ); + Clipboard.SetTextBuf(urls.GetText); + finally + exts.Free; + urls.Free; + end; + end; +end; +{ +\breif ƒŠƒ“ƒNURLŽæ“¾ +‘Ώۊg’£Žq‚́AÚ×Ý’è‚Őݒ肳‚ê‚Ä‚¢‚é +} +procedure TGikoDM.AllLinkToClipboardActionExecute(Sender: TObject); +var + links : IHTMLElementCollection; + urls, exts : TStringList; +begin + links := GetActiveThreadLinks; + if (links <> nil) then begin + urls := TStringList.Create; + exts := TStringList.Create; + try + exts.CaseSensitive := False; + exts.Sorted := True; + exts.Delimiter := ';'; + exts.DelimitedText := + MojuUtils.CustomStringReplace(GikoSys.Setting.ExtList, '*', ''); + GetLinkURLs(links, urls, 0, exts); + Clipboard.SetTextBuf(urls.GetText); + finally + exts.Free; + urls.Free; + end; + end; +end; +{ +\breif V’…ƒŒƒXƒŠƒ“ƒNURLŽæ“¾ +‘Ώۊg’£Žq‚́AÚ×Ý’è‚Őݒ肳‚ê‚Ä‚¢‚é +} +procedure TGikoDM.NewLinkToClipboardActionExecute(Sender: TObject); +var + links : IHTMLElementCollection; + urls, exts : TStringList; + ThreadItem : TThreadItem; +begin + ThreadItem := GikoForm.GetActiveContent; + links := GetActiveThreadLinks; + if (ThreadItem <> nil) and (links <> nil) then begin + urls := TStringList.Create; + exts := TStringList.Create; + try + exts.CaseSensitive := False; + exts.Sorted := True; + exts.Delimiter := ';'; + exts.DelimitedText := + MojuUtils.CustomStringReplace(GikoSys.Setting.ExtList, '*', ''); + GetLinkURLs(links, urls, + (ThreadItem.Count - ThreadItem.NewResCount + 1), exts ); + Clipboard.SetTextBuf(urls.GetText); + finally + exts.Free; + urls.Free; + end; + end; +end; + +{ +\brief Œ»Ý•\Ž¦‚µ‚Ä‚¢‚éƒXƒŒƒbƒh‚Ì‚·‚ׂẴŠƒ“ƒN‚ðŽæ“¾‚·‚éB +\return IHTMLElementCollection ƒŠƒ“ƒN‚̃RƒŒƒNƒVƒ‡ƒ“ +} +function TGikoDM.GetActiveThreadLinks : IHTMLElementCollection; +var + browser : TWebBrowser; + doc : IHTMLDocument2; +begin + Result := nil; + if (GikoForm.GetActiveContent <> nil) then begin + if (GikoForm.BrowserTab.Tabs.Count > 0) and + (GikoForm.BrowserTab.TabIndex >= 0) then begin + browser := TBrowserRecord(GikoForm.BrowserTab.Tabs + .Objects[GikoForm.BrowserTab.TabIndex]).Browser; + if (browser <> nil) then begin + try + doc := browser.ControlInterface.Document as IHTMLDocument2; + if Assigned(doc) then begin + Result := doc.links; + end; + except + Result := nil; + end; + end; + + end; + end; +end; +{ +\brief ƒŠƒ“ƒN‚ÌURL‚ðŽæ“¾‚·‚é +\param links Žæ“¾‚·‚郊ƒ“ƒN‚Ì‘S‘̂̃RƒŒƒNƒVƒ‡ƒ“ +\param URLs Žæ“¾‚µ‚½URL‚Ì•Û‘¶æ +\param Start Ý’肵‚½ƒŒƒX”ԍ†ˆÈ~‚ðŽæ“¾( > 0) +\param Exts Žæ“¾‚·‚郊ƒ“ƒN‚ÌŠg’£Žq +} +procedure TGikoDM.GetLinkURLs(links : IHTMLElementCollection; + URLs : TStringList; const Start: Integer; Exts : TStringList); +var + index ,i, j : Integer; + item : IHTMLElement; + url, ext : string; +begin + if (links <> nil) then begin + index := 0; + for i := 0 to links.length - 1 do begin + item := links.item(i, 0) as IHTMLElement; + if (item <> nil) then begin + url := item.getAttribute('href', 0); + // ƒŒƒX‚̔ԍ†‚ðXV + if (Pos('menu:', url) > 0) then begin + index := StrToInt64Def( + Copy(url, 6, Length(url)), index + 1 + ); + end else begin + // ŠJŽnƒŒƒX”ԍ†ˆÈ~‚©ƒ`ƒFƒbƒN + if (index >= Start) then begin + ext := ExtractFileExt( AnsiLowerCase(url) ); + // Šg’£Žq‚ðƒ`ƒFƒbƒN + if Exts.Find(ext, j) then begin + urls.Add(url) + end; + end; + end; + end; + end; + end; +end; +{ +\brief ƒAƒhƒŒƒXƒo[‚ɃtƒH[ƒJƒX‚ð“–‚Ä‚é +\param Sender ƒCƒxƒ“ƒg‚Ì”­¶Œ³ +} +procedure TGikoDM.SetForcusForAddresBarActionExecute(Sender: TObject); +begin + if ( GikoForm.AddressToolBar.Visible ) then begin + GikoForm.AddressComboBox.SetFocus; + end +end; +{ +\brief ˆÚ“]‚µ‚½”‚ÌURL‚ðŽæ“¾‚·‚éƒ_ƒCƒAƒOƒ‰ƒ€‚ð•\Ž¦‚·‚é +} +procedure TGikoDM.NewBoardSearchActionExecute(Sender: TObject); +var + form : TNewBoardURLForm; + Msg: string; +begin + if (EditorFormExists) then begin + Msg := 'ƒŒƒXƒGƒfƒBƒ^‚ð‘S‚ĕ‚¶‚Ä‚­‚¾‚³‚¢'; + MsgBox(GikoForm.Handle, Msg, MSG_ERROR, MB_OK or MB_ICONSTOP); + Exit; + end; + form := TNewBoardURLForm.Create(Self); + try + form.ShowModal; + finally + form.Release; + end; +end; +//! ƒuƒ‰ƒEƒU‚ð1ƒy[ƒW•ªƒXƒNƒ[ƒ‹‚³‚¹‚é +procedure TGikoDM.ScrollPageDownActionExecute(Sender: TObject); +begin + GikoForm.BrowserMovement(GikoForm.BrowserPanel.Height); +end; +//! ƒuƒ‰ƒEƒU‚ð1ƒy[ƒW•ªƒXƒNƒ[ƒ‹‚³‚¹‚é +procedure TGikoDM.ScrollPageUpActionExecute(Sender: TObject); +begin + GikoForm.BrowserMovement(-GikoForm.BrowserPanel.Height); +end; + + +//! ‚±‚̃ŒƒX‚ÌID‚ðNGƒ[ƒh‚ɒljÁ‚·‚éi“§–¾) +procedure TGikoDM.AddIDtoNGWord0ActionExecute(Sender: TObject); +begin + GikoForm.AddIDtoNGWord(true); +end; +//! ‚±‚̃ŒƒX‚ÌID‚ðNGƒ[ƒh‚ɒljÁ‚·‚é +procedure TGikoDM.AddIDtoNGWord1ActionExecute(Sender: TObject); +begin + GikoForm.AddIDtoNGWord(false); +end; +//! ƒNƒŠƒbƒvƒ{[ƒh‚Ì•¶Žš—ñ‚ðID‚Æ‚µ‚Ä“¯ˆêIDƒŒƒXƒAƒ“ƒJ[•\Ž¦ +procedure TGikoDM.ExtractSameIDActionExecute(Sender: TObject); +var + ID: String; +begin + ID := Trim(Clipboard.AsText); + if (Length(ID) > 0) then begin + if not IsNoValidID(ID) then begin + GikoForm.ShowSameIDAncher(ID); + end; + end; +end; +//! ƒ^ƒu‚̃XƒŒƒbƒhˆê——‚ð•\Ž¦‚·‚é +procedure TGikoDM.ShowTabListActionExecute(Sender: TObject); +var + i : Integer; +begin + GikoForm.ListView.Items.BeginUpdate; + GikoForm.ListView.Items.Clear; + BoardGroup.SpecialBoard.Clear; + for i := GikoForm.BrowserTab.Tabs.Count - 1 downto 0 do begin + BoardGroup.SpecialBoard.Add( + TBrowserRecord(GikoForm.BrowserTab.Tabs.Objects[i]).Thread); + end; + GikoForm.ListView.Items.EndUpdate; + GikoForm.SetActiveList(BoardGroup.SpecialBoard); +end; +//! ‹tŽQÆ‚µ‚Ä‚¢‚郌ƒX‚ð’ljÁ‚·‚é +procedure TGikoDM.DereferenceResActionExecute(Sender: TObject); +var + i, currentNo, No : Integer; + links : IHTMLElementCollection; + threadItem : TThreadItem; + item : IHTMLElement; + url, url2 : string; + resNo : TStringList; + alreadyExist : Boolean; + PathRec: TPathRec; +begin + No := GikoForm.KokoPopupMenu.Tag; + if No = 0 then Exit; + + ThreadItem := GikoForm.KokoPopupThreadItem; + // ƒAƒNƒeƒBƒuƒ^ƒu‚©‚ç‘S‚ẴŠƒ“ƒN‚ðŽæ“¾‚·‚é + links := GetActiveThreadLinks; + if (ThreadItem <> nil) and (links <> nil) then begin + resNo := TStringList.Create; + try + currentNo := 0; + alreadyExist := False; + // ƒŠƒ“ƒN‚ð‘S‚Ä‘–¸‚·‚é + for i := 0 to links.length - 1 do begin + item := links.item(i, 0) as IHTMLElement; + if (item <> nil) then begin + url := item.getAttribute('href', 0); + // ƒŒƒX‚̔ԍ†‚ðXV + if (Pos('menu:', url) > 0) then begin + currentNo := StrToInt64Def( + Copy(url, 6, Length(url)), currentNo + 1 + ); + alreadyExist := False; + end else if (currentNo <> -1) and (not alreadyExist) then begin + // IE7‘Ήž + if Pos('about:..', url) = 1 then begin + url := 'about:blank..' + Copy( url, Length('about:..')+1, Length(url) ) + end; + // Ž©•ª‚ւ̃Šƒ“ƒN‚©‚烌ƒXƒ|ƒbƒv—p‚̔ԍ†Žæ“¾ + if Pos('about:blank..', url) = 1 then begin + // No ”Ԃւ̃Šƒ“ƒN‚ª‚ ‚ê‚ÎŽQÆ‚ ‚è + url2 := THTMLCreate.GetRespopupURL(url, ThreadItem.URL); + PathRec := Gikosys.Parse2chURL2(url2); + if (not PathRec.FNoParam) then begin + Gikosys.GetPopupResNumber(url2,PathRec.FSt,PathRec.FTo); + end; + // ‘ΏۃŒƒX‚à‚µ‚­‚Í‚»‚ê‚ðŠÜ‚Þ‚È‚çŽQÆ‚ ‚è‚Æ‚·‚é + if (PathRec.FSt = No) or + ((PathRec.FSt <= No) and (PathRec.FTo >= No)) then begin + alreadyExist := True; + resNo.Add(IntToStr(currentNo)); + end; + end; + end; + end; + end; + // –³§ŒÀ‚È‚Ì‚Å-1ŒÅ’è + GikoForm.ActiveContent.IDAnchorPopup( + GikoSys.CreateResAnchor(resNo, ThreadItem, -1)); + finally + resNo.Clear; + resNo.Free; + end; + end; +end; + +procedure TGikoDM.UpdateGikonaviActionExecute(Sender: TObject); +var + form : TUpdateCheckForm; + Msg: string; + shutdown: boolean; +begin + if (EditorFormExists) then begin + Msg := 'ƒŒƒXƒGƒfƒBƒ^‚ð‘S‚ĕ‚¶‚Ä‚­‚¾‚³‚¢'; + MsgBox(GikoForm.Handle, Msg, MSG_ERROR, MB_OK or MB_ICONSTOP); + Exit; + end; + GikoForm.UpdateExePath := ''; + GikoForm.UpdateExeArgs := ''; + form := TUpdateCheckForm.Create(Self); + try + form.ShowModal; + shutdown := form.Allowshutdown; + if shutdown then begin + GikoForm.UpdateExePath := form.ExecPath; + GikoForm.UpdateExeArgs := form.ExecArgs; + end; + finally + form.Release; + end; + if shutdown then begin + // ƒMƒRƒiƒrI—¹ + GikoForm.Close; + end; + +end; +//! ‚±‚̃ŒƒX‚ÌURLƒRƒs[iPATH_INFO) +procedure TGikoDM.konoURLPATHActionExecute(Sender: TObject); +var + No : Integer; + ThreadItem : TThreadItem; + URL, Protocol, Host, Path, Document, Port, Bookmark : String; +begin + No := GikoForm.KokoPopupMenu.Tag; + if No = 0 then Exit; + + ThreadItem := GikoForm.KokoPopupThreadItem; + if (ThreadItem.ParentBoard.Is2ch) or not (Pos('?', ThreadItem.URL) > 0) then begin + GikoSys.ParseURI(ThreadItem.URL,Protocol, Host, Path, Document, Port, Bookmark); + URL := Protocol + '://' + Host + Path + IntToStr(No); + end else begin + if Pos('?', ThreadItem.URL) > 0 then begin + URL := Copy(ThreadItem.URL, 1, Pos('?', ThreadItem.URL)-1); + // ‚Ü‚¿BBS—pˆ’u + URL := MojuUtils.CustomStringReplace(URL, 'read.pl', 'read.cgi'); + URL := URL + '/' + ThreadItem.ParentBoard.BBSID + '/' + ChangeFileExt(ThreadItem.FileName, '') + '/' + IntToStr(No); + end; + end; + Clipboard.SetTextBuf( PChar(URL) ); +end; +//! ‚±‚̃ŒƒX‚ÌURLƒRƒs[iQuery_STRING) +procedure TGikoDM.konoURLQueryActionExecute(Sender: TObject); +var + No : Integer; + ThreadItem : TThreadItem; + URL, Protocol, Host, Path, Document, Port, Bookmark : String; +begin + No := GikoForm.KokoPopupMenu.Tag; + if No = 0 then Exit; + + ThreadItem := GikoForm.KokoPopupThreadItem; + // 2ch‚Æ‚µ‚½‚ç‚΂́AƒŒƒX”ԍ†‚ð‚¤‚Ü‚­ˆ—‚µ‚Ä‚­‚ê‚È‚¢‚Ì‚Å—˜—p•s‰Â + if ThreadItem.ParentBoard.Is2ch or not (Pos('?', ThreadItem.URL) > 0) then begin + GikoSys.ParseURI(ThreadItem.URL, Protocol, Host, Path, Document, Port, Bookmark); + URL := Protocol + '://' + Host + '/test/read.cgi?bbs=' + ThreadItem.ParentBoard.BBSID + + '&key=' + ChangeFileExt(ThreadItem.FileName, '') + '&st=' + IntToStr(No) + '&to=' + IntToStr(No); + end else begin + URL := ThreadItem.URL; + // ‚Ü‚¿BBS + if Pos('&LAST=', URL) > 0 then begin + URL := Copy(URL, 1, Pos('&LAST=', URL) - 1); + URL := URL + '&START=' + IntToStr(No) + '&END=' + IntToStr(No); + end; + // ‚»‚Ì‘¼ŠO•”” + if Pos('&ls=', URL) > 0 then begin + URL := Copy(URL, 1, Pos('&ls=', URL) - 1); + URL := URL + '&st=' + IntToStr(No) + '&to=' + IntToStr(No); + end; + + end; + Clipboard.SetTextBuf( PChar(URL) ); +end; +//! ‚±‚̃ŒƒX‚ÌURLƒRƒs[iQuery_STRINGj‚Ì—˜—pƒ`ƒFƒbƒN +procedure TGikoDM.konoURLQueryActionUpdate(Sender: TObject); +const + LIVEDOOR_URL = 'http://jbbs.livedoor.jp/'; +begin + // 2ch‚Æ‚µ‚½‚ç‚΂͗˜—p‚Å‚«‚È‚¢‚悤‚É‚·‚éi‚¤‚Ü‚­ƒŒƒXŽw’è‚Å‚«‚È‚¢‚̂Łj + konoURLQueryAction.Enabled := false; + if (GikoForm.KokoPopupThreadItem <> nil) then begin + konoURLQueryAction.Enabled := not GikoForm.KokoPopupThreadItem.ParentBoard.Is2ch; + if konoURLQueryAction.Enabled then begin + konoURLQueryAction.Enabled := not (Pos(LIVEDOOR_URL, GikoForm.KokoPopupThreadItem.URL) = 1); + end; + end; +end; + end.