Develop and Download Open Source Software

Browse CVS Repository

Diff of /gikonavigoeson/gikonavi/Sort.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3 by h677, Thu Sep 4 08:22:07 2003 UTC revision 1.3.2.1 by yoffy, Mon Apr 19 22:46:49 2004 UTC
# Line 3  unit Sort; Line 3  unit Sort;
3  interface  interface
4  uses  uses
5          Windows, Messages, SysUtils, Classes, Controls, Forms,          Windows, Messages, SysUtils, Classes, Controls, Forms,
6          BoardGroup;          BoardGroup,DateUtils;
7    
8          function CategorySortProc(Item1, Item2: Pointer): integer;          function CategorySortProc(Item1, Item2: Pointer): integer;
9          function BoardSortProc(Item1, Item2: Pointer): integer;          function BoardSortProc(List: TStringList; Item1, Item2: Integer): integer;
10          function ThreadItemSortProc(Item1, Item2: Pointer): integer;          function ThreadItemSortProc(List: TStringList; Item1, Item2: Integer): integer;
11          function CompareBool(Item1, Item2: Boolean): integer;          function CompareBool(Item1, Item2: Boolean): integer;
12          function CompareInt(Item1, Item2: Integer): Integer;          function CompareInt(Item1, Item2: Integer): Integer;
13          function CompareDate(Item1, Item2: TDateTime): Integer;          function CompareDate(Item1, Item2: TDateTime): Integer;
# Line 36  begin Line 36  begin
36                  Result := Result * -1;                  Result := Result * -1;
37  end;  end;
38    
39  function BoardSortProc(Item1, Item2: Pointer): integer;  function BoardSortProc(List: TStringList; Item1, Item2: Integer): integer;
40  var  var
41          BoardItem1: TBoard;          BoardItem1: TBoard;
42          BoardItem2: TBoard;          BoardItem2: TBoard;
43  begin  begin
44          BoardItem1 := TBoard(Item1);          BoardItem1 := TBoard(List.Objects[Item1]);
45          BoardItem2 := TBoard(Item2);          BoardItem2 := TBoard(List.Objects[Item2]);
46          if SortIndex = 0 then          if SortIndex = 0 then
47                  if SortNoFlag then                  if SortNoFlag then
48                          Result := CompareInt(BoardItem1.No, BoardItem2.No)                          Result := CompareInt(BoardItem1.No, BoardItem2.No)
# Line 57  begin Line 57  begin
57                  Result := Result * -1;                  Result := Result * -1;
58  end;  end;
59    
60  function ThreadItemSortProc(Item1, Item2: Pointer): integer;  function ThreadItemSortProc(List: TStringList; Item1, Item2: Integer): integer;
61  var  var
62          ThreadItem1: TThreadItem;          ThreadItem1: TThreadItem;
63          ThreadItem2: TThreadItem;          ThreadItem2: TThreadItem;
64  begin  begin
65          ThreadItem1 := TThreadItem(Item1);          ThreadItem1 := TThreadItem(List.Objects[ Item1 ]);
66          ThreadItem2 := TThreadItem(Item2);          ThreadItem2 := TThreadItem(List.Objects[ Item2 ]);
67          case SortIndex of          case SortIndex of
68                  0:                  0:
69                          begin                          begin
# Line 77  begin Line 77  begin
77                  3: Result := CompareInt(ThreadItem1.NewResCount, ThreadItem2.NewResCount);                  3: Result := CompareInt(ThreadItem1.NewResCount, ThreadItem2.NewResCount);
78                  4: Result := 0;                  4: Result := 0;
79                  5: Result := AnsiCompareText(ThreadItem1.RoundName, ThreadItem2.RoundName);                  5: Result := AnsiCompareText(ThreadItem1.RoundName, ThreadItem2.RoundName);
80                  6: Result := CompareDate(ThreadItem1.LastModified, ThreadItem2.LastModified);                  6: Result := CompareDateTime(ThreadItem1.RoundDate, ThreadItem2.RoundDate);
81            7: Result := CompareDateTime(ThreadItem1.CreateDate, ThreadItem2.CreateDate);
82      else      else
83          Result := 0;          Result := 0;
84          end;          end;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.2.1

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26