TListViewUtils = class(TObject)
private
{Private \90é\8c¾}
+
class procedure DrawCategoryItem(BBS: TBBS; Item: TListItem; ListView: TListView);
class procedure DrawBoardItem(Category: TCategory; Item: TListItem; ListView: TListView);
class procedure DrawThreadItem(Board: TBoard; Item: TListItem; ListView: TListView);
class procedure ListViewData(Sender: TObject; Item: TListItem);
end;
-
implementation
uses
- GikoSystem, Sort, Setting, Giko, MojuUtils, GikoDataModule;
+ GikoSystem, Sort, Setting, Giko, MojuUtils, GikoDataModule, DateUtils, Math;
const
//\83c\83\8a\81[\81E\83\8a\83X\83g\83A\83C\83R\83\93
// \83L\83\83\83r\83l\83b\83g\95\\8e¦\91O\82É\8dÄ\83\\81[\83g
if ( GikoSys.Setting.BBSSortIndex <> 0 ) or ( GikoSys.Setting.BBSSortOrder <> true ) then begin
- Sort.SortOrder := true;
- Sort.SortIndex := 0;
- Sort.SortNoFlag := true;
+ Sort.SetSortOrder(true);
+ Sort.SetSortIndex(0);
+ Sort.SetSortNoFlag(true);
inBBS.Sort(CategorySortProc);
end;
// \83L\83\83\83r\83l\83b\83g\95\\8e¦\91O\82É\8dÄ\83\\81[\83g
if ( GikoSys.Setting.CategorySortIndex <> 0 ) or ( GikoSys.Setting.CategorySortOrder <> true ) then begin
- Sort.SortOrder := true;
- Sort.SortIndex := 0;
- Sort.SortNoFlag := true;
+ Sort.SetSortOrder(true);
+ Sort.SetSortIndex(0);
+ Sort.SetSortNoFlag(true);
Category.CustomSort(BoardSortProc);
end;
ListView.Column[ idx ].ImageIndex := ITEM_ICON_SORT2;
- Sort.SortNoFlag := NumberVisible;
+ Sort.SetSortNoFlag(NumberVisible);
if TObject( GikoForm.ActiveList ) is TBBS then begin
wkBBS := TBBS( GikoForm.ActiveList );
orderList := GikoSys.Setting.BBSColumnOrder;
- Sort.SortOrder := vSortOrder;
- Sort.SortIndex := Integer( orderList[ idx ] );
- GikoSys.Setting.BBSSortIndex := Sort.SortIndex;
- GikoSys.Setting.BBSSortOrder := Sort.SortOrder;
+ Sort.SetSortOrder(vSortOrder);
+ Sort.SetSortIndex(Integer( orderList[ idx ] ));
+ GikoSys.Setting.BBSSortIndex := Sort.GetSortIndex;
+ GikoSys.Setting.BBSSortOrder := Sort.GetSortOrder;
wkBBS.Sort(Sort.CategorySortProc);
end else if TObject( GikoForm.ActiveList ) is TCategory then begin
wkCategory := TCategory( GikoForm.ActiveList );
orderList := GikoSys.Setting.CategoryColumnOrder;
- Sort.SortOrder := vSortOrder;
- Sort.SortIndex := Integer( orderList[ idx ] );
- GikoSys.Setting.CategorySortIndex := Sort.SortIndex;
- GikoSys.Setting.CategorySortOrder := Sort.SortOrder;
+ Sort.SetSortOrder(vSortOrder);
+ Sort.SetSortIndex(Integer( orderList[ idx ] ));
+ GikoSys.Setting.CategorySortIndex := Sort.GetSortIndex;
+ GikoSys.Setting.CategorySortOrder := Sort.GetSortOrder;
wkCategory.CustomSort(BoardSortProc);
end else if TObject( GikoForm.ActiveList ) is TBoard then begin
wkBoard := TBoard( GikoForm.ActiveList );
orderList := GikoSys.Setting.BoardColumnOrder;
- Sort.SortOrder := vSortOrder;
- Sort.SortIndex := Integer( orderList[ idx ] );
- GikoSys.Setting.BoardSortIndex := Sort.SortIndex;
- GikoSys.Setting.BoardSortOrder := Sort.SortOrder;
+ Sort.SetSortOrder(vSortOrder);
+ Sort.SetSortIndex(Integer( orderList[ idx ] ));
+ GikoSys.Setting.BoardSortIndex := Sort.GetSortIndex;
+ GikoSys.Setting.BoardSortOrder := Sort.GetSortOrder;
wkBoard.CustomSort(ThreadItemSortProc);
end;
Board.NewThreadCount := Board.GetNewThreadCount;
ListView.Items.Count := Board.NewThreadCount;
end;
+ gvtArch:
+ begin
+ Board.ArchiveThreadCount := Board.GetArchiveThreadCount;
+ ListView.Items.Count := Board.ArchiveThreadCount;
+ end;
+ gvtLive:
+ begin
+ Board.LiveThreadCount := Board.GetLiveThreadCount;
+ ListView.Items.Count := Board.LiveThreadCount;
+ end;
gvtUser:
begin
Board.UserThreadCount:= Board.GetUserThreadCount;
gvtAll: BoardCnt := Board.Count;
gvtLog: BoardCnt := Board.LogThreadCount;
gvtNew: BoardCnt := Board.NewThreadCount;
+ gvtArch: BoardCnt := Board.ArchiveThreadCount;
+ gvtLive: BoardCnt := Board.LiveThreadCount;
gvtUser: BoardCnt := Board.UserThreadCount;
else
BoardCnt := 0;
end;
- if (BoardCnt <= 0) or (Item = nil) or (Item.Index > BoardCnt)
+ if (BoardCnt <= 0) or (Item = nil) or (Item.Index >= BoardCnt)
or (ListView.Items.Count = 0) or (not (Board.Items[Item.Index] is TThreadItem)) then Exit;
//\89ü\91P\82·\82×\82«\83u\83\8d\83b\83N/////////////////////////////////////////////////////
ThreadItem := TThreadItem(Board.Items[Item.Index]);
gvtLog: ThreadItem := Board.GetLogThread(Item.Index);
gvtNew: ThreadItem := Board.GetNewThread(Item.Index);
+ gvtArch: ThreadItem := Board.GetArchiveThread(Item.Index);
+ gvtLive: ThreadItem := Board.GetLiveThread(Item.Index);
gvtUser: ThreadItem := Board.GetUserThread(Item.Index);
end;
//////////////////////////////////////////////////////////////////////////
gasNew: Item.StateIndex := 0;
gasAge: Item.StateIndex := 1;
gasSage: Item.StateIndex := 2;
+ gasArch: Item.StateIndex := 3;
end;
if ThreadItem.IsLogFile then begin
class procedure TListViewUtils.DrawItemLogThread(Thread: TThreadItem; Item: TListItem; ColumnCount: Integer);
var
i, idx : Integer;
+ spanday: Double;
begin
idx := 0;
for i := 0 to ColumnCount - 1 do begin
Item.SubItems[ idx ] := '';
end else
Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.LastModified);
+ gbcVigor:
+ begin
+ if (Thread.CreateDate <> ZERO_DATE) then begin
+ if (Thread.AgeSage <> gasArch) then begin
+ spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
+ end else begin
+ spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
+ end;
+ if (spanday > 0) then begin
+ Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
+ end else begin
+ Item.SubItems[ idx ] := '';
+ end;
+ end else begin
+ Item.SubItems[ idx ] := '';
+ end;
+ end;
end;
Inc( idx );
end;
class procedure TListViewUtils.DrawItemNoLogThread(Thread: TThreadItem; Item: TListItem; ColumnCount: Integer);
var
i, idx: Integer;
+ spanday: Double;
begin
idx := 0;
for i := 0 to ColumnCount - 1do begin
Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.CreateDate);
gbcLastModified:
Item.SubItems[ idx ] := '';
+ gbcVigor:
+ begin
+ if (Thread.CreateDate <> ZERO_DATE) then begin
+ if (Thread.AgeSage <> gasArch) then begin
+ spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
+ end else begin
+ spanday := DaySpan(Thread.LastModified, Thread.CreateDate);
+ end;
+
+ if (spanday > 0) then begin
+ Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
+ end else begin
+ Item.SubItems[ idx ] := '';
+ end;
+ end else begin
+ Item.SubItems[ idx ] := '';
+ end;
+ end;
else
Item.SubItems[ idx ] := '';
end;
+
Inc( idx );
end;
if Thread.NewArrival then