OSDN Git Service

勢いのソート処理と計算処理の日付取得を省力化。
authorh677 <h677>
Mon, 23 Jan 2006 16:03:12 +0000 (16:03 +0000)
committerh677 <h677>
Mon, 23 Jan 2006 16:03:12 +0000 (16:03 +0000)
初回起動時に勢いカラムは非表示設定

Giko.pas
ListViewUtils.pas
Setting.pas
Sort.pas

index 759673a..bd4326a 100644 (file)
--- a/Giko.pas
+++ b/Giko.pas
@@ -593,7 +593,6 @@ type
                FOrigenCaption: String;                         //\82¨\8bC\82É\93ü\82è\83c\83\8a\81[\82Ì\83A\83C\83e\83\80\95Ò\8fW\8e\9e\82Ì\95Ò\8fW\91O\82Ì\95\8e\9a\97ñ
                FPreviewBrowserRect: TRect;                     ///< \83v\83\8c\83r\83\85\81[\82Ì\95\\8e¦\88Ê\92u\82ð\8bL\89¯\82·\82é
                FActionListGroupIndexes: array of Integer;      ///<GikoDM\8fã\82Ì\83A\83N\83V\83\87\83\93\83\8a\83X\83g\82Ì\8ae\83A\83N\83V\83\87\83\93\82É\90Ý\92è\82³\82ê\82½GroupIndex\82ð\95Û\91\82·\82é\94z\97ñ
-               FListDrawTime: TDateTime;  ///< ListView\82ð\95`\89æ\82µ\82æ\82¤\82Æ\82µ\82½\8e\9e\8d\8f(\90¨\82¢\82Ì\8cv\8eZ\97p)
                procedure DownloadEnd(Sender: TObject; Item: TDownloadItem);
                procedure DownloadMsg(Sender: TObject; Item: TDownloadItem; Msg: string; Icon: TGikoMessageIcon);
                procedure WorkBegin(Sender: TObject; AWorkMode: TWorkMode; const AWorkCountMax: Integer; Number: Integer; const AWorkTitle: string);
@@ -700,7 +699,6 @@ type
                property ScreenCursor : TCursor read GetScreenCursor write SetScreenCursor;
                property ActiveBBS : TBBS read FActiveBBS write FActiveBBS;
                property WorkCount: Integer read FWorkCount write FWorkCount;
-               property ListDrawTime: TDateTime read FListDrawTime;
                procedure SetContent(inThread: TBrowserRecord);
                function GetActiveContent: TThreadItem;
                function GetActiveList: TObject;
@@ -882,6 +880,8 @@ begin
        Writeln('============================================================');
 {$ENDIF}
 //try
+       Sort.SetSortDate(Now());
+       
        FTreeType := gttNone;
        // \8bN\93®\8e\9e\82É\95Û\91\82³\82ê\82Ä\82µ\82Ü\82¤\91Î\8dô
        FStartUp := true;
@@ -2303,6 +2303,7 @@ begin
                                                GikoSys.Setting.BoardSortIndex := 0;
                                                GikoSys.Setting.BoardSortOrder := True;
                                        end;
+                                       Sort.SetSortDate(Now());
                                        SetActiveList(Item.Board);
                                end;
                                Item.Board.Modified := True;
@@ -2905,7 +2906,6 @@ begin
                                                         (ListView.ClientHeight div 2) - (ListView.Canvas.TextHeight(s) div 2));
                ListView.Canvas.TextOut(p.X, p.Y, s);
        end else begin
-               FListDrawTime := Now();
                DefaultDraw := True;
        end;
 end;
@@ -3399,7 +3399,6 @@ begin
        end else begin
                if Item <> FActiveList then begin
                        ActiveListColumnSave;
-
                        if (Item is TBBS) or (Item is TCategory) then begin
                                ListView.Columns.Clear;
                                SetActiveList( Item );
@@ -3413,6 +3412,7 @@ begin
                                                Screen.Cursor := crDefault;
                                        end;
                                end;
+                               Sort.SetSortDate(Now());
                                SetActiveList( Item );
                        end;
                end;
@@ -6665,6 +6665,7 @@ begin
                                Screen.Cursor := crDefault;
                        end;
                end;
+               Sort.SetSortDate(Now());
                SetActiveList(Node.data);
        end;
 
index 5f018bd..7d50a53 100644 (file)
@@ -658,9 +658,9 @@ begin
                                Item.SubItems[ idx ] := FormatDateTime('yyyy/mm/dd hh:mm:ss', Thread.LastModified);
                gbcVigor:
                        begin
-                               spanday := DaySpan(GikoForm.ListDrawTime, Thread.CreateDate);
+                               spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
                                if (spanday > 0) then begin
-                                       Item.SubItems[ idx ] := Format('%5.2f', [Thread.AllResCount / spanday]);
+                                       Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
                                end else begin
                                        Item.SubItems[ idx ] := '';
                                end;
@@ -700,9 +700,9 @@ begin
                        Item.SubItems[ idx ] := '';
                gbcVigor:
                        begin
-                               spanday := DaySpan(GikoForm.ListDrawTime, Thread.CreateDate);
+                               spanday := DaySpan(Sort.GetSortDate, Thread.CreateDate);
                                if (spanday > 0) then begin
-                                       Item.SubItems[ idx ] := Format('%5.2f', [Thread.AllResCount / spanday]);
+                                       Item.SubItems[ idx ] := Format('%f', [Thread.AllResCount / spanday]);
                                end else begin
                                        Item.SubItems[ idx ] := '';
                                end;
index 1f8be7e..048cd4b 100644 (file)
@@ -1165,8 +1165,12 @@ begin
                        end;
                        if FBoardColumnOrder.Count = 0 then begin
                                // \90Ý\92è\82ª\96³\82¢\82Ì\82Å\8dì\90¬
-                               for i := 0 to Integer( High( TGikoBoardColumnID ) ) do
-                                       FBoardColumnOrder.Add( TGikoBoardColumnID( i ) );
+                               for i := 0 to Integer( High( TGikoBoardColumnID ) ) do begin
+                                       // \90¨\82¢\82Ì\83J\83\89\83\80\82Í\83f\83t\83H\83\8b\83g\82Å\94ñ\95\\8e¦\82É\82·\82é
+                                       if ( i <> Ord(gbcVigor) ) then begin
+                                               FBoardColumnOrder.Add( TGikoBoardColumnID( i ) );
+                                       end;
+                               end;
                        end;
                finally
                        wkList.Free;
index a319a80..6bc85c1 100644 (file)
--- a/Sort.pas
+++ b/Sort.pas
@@ -12,13 +12,16 @@ uses
        function CompareBool(Item1, Item2: Boolean): integer;
        function CompareInt(Item1, Item2: Integer): Integer;
        function CompareDate(Item1, Item2: TDateTime): Integer;
-
+       procedure SetSortDate(Date: TDateTime);
+       function GetSortDate(): TDateTime;
 var
        SortOrder: Boolean;
        SortIndex: Integer;
        SortNoFlag: Boolean;
 
 implementation
+var
+       FSortDate: TDateTime;
 
 function CategorySortProc(Item1, Item2: Pointer): integer;
 var
@@ -109,9 +112,8 @@ begin
                gbcLastModified:        Result := CompareDateTime(ThreadItem1.LastModified, ThreadItem2.LastModified); {gbcLastModified:}
                gbcVigor:
                        begin
-                               NowDateTime := Now();
-                               SpanDay1 := DaySpan(NowDateTime, ThreadItem1.CreateDate);
-                               SpanDay2 := DaySpan(NowDateTime, ThreadItem2.CreateDate);
+                               SpanDay1 := DaySpan(FSortDate, ThreadItem1.CreateDate);
+                               SpanDay2 := DaySpan(FSortDate, ThreadItem2.CreateDate);
                                if (SpanDay1 > 0) and (SpanDay2 > 0) then begin
                                        Result := CompareValue(
                                                                ThreadItem1.AllResCount / SpanDay1,
@@ -182,5 +184,12 @@ begin
        else
                Result := 0;
 end;
-
+procedure SetSortDate(Date: TDateTime);
+begin
+       FSortDate := Date;
+end;
+function GetSortDate(): TDateTime;
+begin
+       Result := FSortDate;
+end;
 end.