5 Windows, Messages, SysUtils, Classes, Controls, Forms,
8 function CategorySortProc(Item1, Item2: Pointer): integer;
9 function BoardSortProc(List: TStringList; Item1, Item2: Integer): integer;
10 function ThreadItemSortProc(List: TStringList; Item1, Item2: Integer): integer;
11 function CompareBool(Item1, Item2: Boolean): integer;
12 function CompareInt(Item1, Item2: Integer): Integer;
13 function CompareDate(Item1, Item2: TDateTime): Integer;
22 function CategorySortProc(Item1, Item2: Pointer): integer;
24 CategoryItem1: TCategory;
25 CategoryItem2: TCategory;
27 CategoryItem1 := TCategory(Item1);
28 CategoryItem2 := TCategory(Item2);
31 Result := CompareInt(CategoryItem1.No, CategoryItem2.No)
33 Result := AnsiCompareText(CategoryItem1.Title, CategoryItem2.Title);
36 Result := Result * -1;
39 function BoardSortProc(List: TStringList; Item1, Item2: Integer): integer;
44 BoardItem1 := TBoard(List.Objects[Item1]);
45 BoardItem2 := TBoard(List.Objects[Item2]);
48 Result := CompareInt(BoardItem1.No, BoardItem2.No)
50 Result := AnsiCompareText(BoardItem1.Title, BoardItem2.Title)
51 else if SortIndex = 1 then
52 Result := CompareInt(BoardItem1.Count, BoardItem2.Count)
54 Result := CompareDate(BoardItem1.RoundDate, BoardItem2.RoundDate);
57 Result := Result * -1;
60 function ThreadItemSortProc(List: TStringList; Item1, Item2: Integer): integer;
62 ThreadItem1: TThreadItem;
63 ThreadItem2: TThreadItem;
65 ThreadItem1 := TThreadItem(List.Objects[ Item1 ]);
66 ThreadItem2 := TThreadItem(List.Objects[ Item2 ]);
71 Result := CompareInt(ThreadItem1.No, ThreadItem2.No)
73 Result := AnsiCompareText(ThreadItem1.Title, ThreadItem2.Title)
75 1: Result := CompareInt(ThreadItem1.AllResCount, ThreadItem2.AllResCount);
76 2: Result := CompareInt(ThreadItem1.Count, ThreadItem2.Count);
77 3: Result := CompareInt(ThreadItem1.NewResCount, ThreadItem2.NewResCount);
79 5: Result := AnsiCompareText(ThreadItem1.RoundName, ThreadItem2.RoundName);
80 6: Result := CompareDateTime(ThreadItem1.RoundDate, ThreadItem2.RoundDate);
81 7: Result := CompareDateTime(ThreadItem1.CreateDate, ThreadItem2.CreateDate);
86 { if SortIndex = 0 then
88 Result := CompareInt(ThreadItem1.No, ThreadItem2.No)
90 Result := CompareText(ThreadItem1.Title, ThreadItem2.Title)
91 else if SortIndex = 1 then
92 Result := CompareInt(ThreadItem1.Count, ThreadItem2.Count)
93 else if SortIndex = 2 then
94 // Result := CompareInt(ThreadItem1.RoundNo, ThreadItem2.RoundNo)
95 Result := CompareText(ThreadItem1.RoundName, ThreadItem2.RoundName)
97 Result := CompareDate(ThreadItem1.LastModified, ThreadItem2.LastModified);
100 Result := Result * -1;
103 function CompareBool(Item1, Item2: Boolean): Integer;
105 if (Item1 = True) and (Item2 = False) then
107 else if (Item2 = False) and (Item2 = True) then
113 function CompareInt(Item1, Item2: Integer): Integer;
115 if Item1 > Item2 then
117 else if Item1 < Item2 then
123 function CompareDate(Item1, Item2: TDateTime): Integer;
125 if Item1 > Item2 then
127 else if Item1 < Item2 then