5 Windows, Messages, SysUtils, Classes, Controls, Forms,
8 function CategorySortProc(Item1, Item2: Pointer): integer;
9 function BoardSortProc(Item1, Item2: Pointer): integer;
10 function ThreadItemSortProc(Item1, Item2: Pointer): 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(Item1, Item2: Pointer): integer;
44 BoardItem1 := TBoard(Item1);
45 BoardItem2 := TBoard(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(Item1, Item2: Pointer): integer;
62 ThreadItem1: TThreadItem;
63 ThreadItem2: TThreadItem;
65 ThreadItem1 := TThreadItem(Item1);
66 ThreadItem2 := TThreadItem(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 := CompareDate(ThreadItem1.LastModified, ThreadItem2.LastModified);
85 { if SortIndex = 0 then
87 Result := CompareInt(ThreadItem1.No, ThreadItem2.No)
89 Result := CompareText(ThreadItem1.Title, ThreadItem2.Title)
90 else if SortIndex = 1 then
91 Result := CompareInt(ThreadItem1.Count, ThreadItem2.Count)
92 else if SortIndex = 2 then
93 // Result := CompareInt(ThreadItem1.RoundNo, ThreadItem2.RoundNo)
94 Result := CompareText(ThreadItem1.RoundName, ThreadItem2.RoundName)
96 Result := CompareDate(ThreadItem1.LastModified, ThreadItem2.LastModified);
99 Result := Result * -1;
102 function CompareBool(Item1, Item2: Boolean): Integer;
104 if (Item1 = True) and (Item2 = False) then
106 else if (Item2 = False) and (Item2 = True) then
112 function CompareInt(Item1, Item2: Integer): Integer;
114 if Item1 > Item2 then
116 else if Item1 < Item2 then
122 function CompareDate(Item1, Item2: TDateTime): Integer;
124 if Item1 > Item2 then
126 else if Item1 < Item2 then