6 SysUtils, Classes, BoardGroup, BrowserRecord,
17 TMoveHistoryItem = class(TObject)
19 FThreadItem : TThreadItem;
22 property ThreadItem : TThreadItem read FThreadItem write FThreadItem;
23 property ScrollTop : Integer read FScrollTop write FScrollTop;
26 TMoveHistory = class(TList)
28 FHistoryMax : Integer;
31 \brief
\83\8a\83\93\83N
\88Ú
\93®
\97\9a\97ð
\8dÅ
\91å
\95Û
\8e\9d\90\94\82ð
\90Ý
\92è
\82·
\82é
\81B
32 \param AVal
\95Û
\8e\9d\90\94
34 procedure SetHistoryMax(AVal: Integer);
36 \brief
\83\8a\83\93\83N
\88Ú
\93®
\97\9a\97ð
\8dÅ
\91å
\95Û
\8e\9d\90\94\82ð
\8eæ
\93¾
\82·
\82é
\81B
37 \return
\95Û
\8e\9d\90\94( > 0 )
39 function GetHistoryMax: Integer;
41 constructor Create( max : Integer ); overload;
42 function pushItem( item: TMoveHistoryItem): Integer; overload;
43 function pushItem( item: TBrowserRecord): Integer; overload;
44 function getPrevItem( item: TBrowserRecord): TMoveHistoryItem;
45 function getNextItem: TMoveHistoryItem;
46 procedure clear; override;
47 property HistoryMax : Integer read GetHistoryMax write SetHistoryMax;
48 property HisotryIndex: Integer read FIndex;
52 MoveHisotryManager : TMoveHistory;
59 //!
\83R
\83\93\83X
\83g
\83\89\83N
\83^
60 constructor TMoveHistory.Create( max : Integer );
65 //
\82È
\82º
\82ª
\83f
\83o
\83b
\83O
\92\86\82ÉGikoSys
\82ªnil
\82Ì
\8e\9e\82ª
\82 \82Á
\82½???
66 if (GikoSys = nil) then begin
69 SetHistoryMax( GikoSys.Setting.MoveHistorySize );
72 //!
\88Ú
\93®
\97\9a\97ð
\82Ì
\83A
\83C
\83e
\83\80\92Ç
\89Á
73 function TMoveHistory.pushItem( item: TMoveHistoryItem): Integer;
76 top: TMoveHistoryItem;
79 if (Self.Count > 0) then begin
80 top := TMoveHistoryItem( Self.Items[Self.Count - 1] );
81 if (top.FThreadItem = item.FThreadItem) and
82 (top.FScrollTop = item.FScrollTop) then begin
86 //
\95Û
\8e\9d\90\94\82Ì
\8dÅ
\91å
\92l
\82ð
\92´
\82¦
\82é
\8fê
\8d\87\90æ
\93ª
\82ð
\8dí
\8f\9c
87 if (FIndex + 1 > FHistoryMax) then begin
88 if ( Self.Items[0] <> nil ) then begin
89 TMoveHistoryItem( Self.Items[0] ).Free;
94 // FIndex
\82æ
\82è
\8cã
\82ë
\82Ì
\83A
\83C
\83e
\83\80\82ð
\8dí
\8f\9c\82·
\82é
95 for i := Self.Count - 1 downto Findex do begin
96 if (Self.Items [i] <> nil) then begin
97 TMoveHistoryItem( Self.Items[i] ).Free;
102 Result := Self.Add( item );
104 //!
\88Ú
\93®
\97\9a\97ð
\82Ì
\83A
\83C
\83e
\83\80\92Ç
\89Á
105 function TMoveHistory.pushItem( item: TBrowserRecord): Integer;
107 history : TMoveHistoryItem;
108 doc : IHTMLDocument2;
111 if not Assigned(item) then
113 if not Assigned(item.Thread) then
115 if not Assigned(item.Browser) then
118 doc := item.Browser.ControlInterface.Document as IHTMLDocument2;
119 if not Assigned(doc) then
122 history := TMoveHistoryItem.Create;
123 history.FThreadItem := item.Thread;
125 history.ScrollTop := (doc.body as IHTMLElement2).ScrollTop;
127 Result := pushItem( history );
129 //!
\88ê
\82Â
\91O
\82Ì
\97\9a\97ð
\83A
\83C
\83e
\83\80\8eæ
\93¾
130 function TMoveHistory.getPrevItem(item: TBrowserRecord): TMoveHistoryItem;
133 if (FIndex = Self.Count) and (item <> nil) then begin
137 if ( FIndex > 0 ) then begin
139 Result := TMoveHistoryItem( Self.items[ FIndex ] );
142 //!
\88ê
\82Â
\8cã
\82ë
\82Ì
\97\9a\97ð
\83A
\83C
\83e
\83\80\8eæ
\93¾
143 function TMoveHistory.getNextItem: TMoveHistoryItem;
146 if ( FIndex < Self.Count - 1 ) then begin
148 Result := TMoveHistoryItem( Self.items[ FIndex ] );
151 //!
\97\9a\97ð
\82Ì
\91S
\8fÁ
\8b\8e
152 procedure TMoveHistory.clear;
156 //
\83A
\83C
\83e
\83\80\82ð
\8dí
\8f\9c\82·
\82é
157 for i := Self.Count - 1 downto 0 do begin
158 if (Self.Items [i] <> nil) then begin
159 TMoveHistoryItem( Self.Items[i] ).Free;
168 procedure TMoveHistory.SetHistoryMax(AVal: Integer);
170 //
\97\9a\97ð
\82Ì
\83T
\83C
\83Y
\82Í0
\82æ
\82è
\91å
\82«
\82
\82È
\82¢
\82Æ
\82¢
\82¯
\82È
\82¢
171 if ( AVal > 0 ) then begin
172 if ((AVal + 1) <> FHistoryMax) then begin
174 //
\88Ú
\93®
\82µ
\82½
\8dÛ
\82É
\81A
\96ß
\82é
\83\8a\83\93\83N
\82ð1
\82Â
\91«
\82·
\82Ì
\82Å
175 FHistoryMax := AVal + 1;
179 function TMoveHistory.GetHistoryMax: Integer;
181 //
\88Ú
\93®
\82µ
\82½
\8dÛ
\82É
\81A
\96ß
\82é
\83\8a\83\93\83N
\82ð1
\82Â
\91«
\82·
\82Ì
\82Å
182 Result := FHistoryMax - 1;
185 MoveHisotryManager := TMoveHistory.Create( 20 );
188 if MoveHisotryManager <> nil then begin
189 MoveHisotryManager.clear;
190 FreeAndNil(MoveHisotryManager);