5 Windows, Messages, SysUtils, Classes, Controls, Forms,
9 function CategorySortProc(Item1, Item2: Pointer): integer;
10 function BoardSortProc(List: TStringList; Item1, Item2: Integer): integer;
11 function ThreadItemSortProc(List: TStringList; Item1, Item2: Integer): integer;
12 function CompareBool(Item1, Item2: Boolean): integer;
13 function CompareInt(Item1, Item2: Integer): Integer;
14 function CompareDate(Item1, Item2: TDateTime): Integer;
23 function CategorySortProc(Item1, Item2: Pointer): integer;
25 CategoryItem1: TCategory;
26 CategoryItem2: TCategory;
28 CategoryItem1 := TCategory(Item1);
29 CategoryItem2 := TCategory(Item2);
31 case TGikoBBSColumnID( SortIndex ) of
34 Result := CompareInt(CategoryItem1.No, CategoryItem2.No)
36 Result := AnsiCompareText(CategoryItem1.Title, CategoryItem2.Title);
38 Result := CompareInt(CategoryItem1.No, CategoryItem2.No)
42 Result := Result * -1;
45 function BoardSortProc(List: TStringList; Item1, Item2: Integer): integer;
50 BoardItem1 := TBoard(List.Objects[Item1]);
51 BoardItem2 := TBoard(List.Objects[Item2]);
52 case TGikoCategoryColumnID( SortIndex ) of
55 Result := CompareInt(BoardItem1.No, BoardItem2.No)
57 Result := AnsiCompareText(BoardItem1.Title, BoardItem2.Title);
60 Result := CompareInt(BoardItem1.Count, BoardItem2.Count);
63 Result := CompareDate(BoardItem1.RoundDate, BoardItem2.RoundDate);
65 Result := CompareInt(BoardItem1.No, BoardItem2.No)
69 Result := Result * -1;
72 function ThreadItemSortProc(List: TStringList; Item1, Item2: Integer): integer;
74 ThreadItem1: TThreadItem;
75 ThreadItem2: TThreadItem;
77 ThreadItem1 := TThreadItem(List.Objects[ Item1 ]);
78 ThreadItem2 := TThreadItem(List.Objects[ Item2 ]);
79 case TGikoBoardColumnID( SortIndex ) of
83 Result := CompareInt(ThreadItem1.No, ThreadItem2.No)
85 Result := AnsiCompareText(ThreadItem1.Title, ThreadItem2.Title)
88 gbcAllCount: Result := CompareInt(ThreadItem1.AllResCount, ThreadItem2.AllResCount);
89 gbcLocalCount: Result := CompareInt(ThreadItem1.Count, ThreadItem2.Count);
92 if ThreadItem1.IsLogFile and ThreadItem2.IsLogFile then
93 Result := CompareInt(ThreadItem1.AllResCount - ThreadItem1.Count, ThreadItem2.AllResCount - ThreadItem2.Count)
94 else if ThreadItem1.IsLogFile then
96 else if ThreadItem2.IsLogFile then
102 gbcNewCount: Result := CompareInt(ThreadItem1.NewResCount, ThreadItem2.NewResCount);
103 gbcUnReadCount: Result := 0;
104 gbcRoundName: Result := AnsiCompareText(ThreadItem1.RoundName, ThreadItem2.RoundName);
105 gbcRoundDate: Result := CompareDateTime(ThreadItem1.RoundDate, ThreadItem2.RoundDate); {gbcLastModified:}
106 gbcCreated: Result := CompareDateTime(ThreadItem1.CreateDate, ThreadItem2.CreateDate);
107 gbcLastModified: Result := CompareDateTime(ThreadItem1.LastModified, ThreadItem2.LastModified); {gbcLastModified:}
112 { if SortIndex = 0 then
114 Result := CompareInt(ThreadItem1.No, ThreadItem2.No)
116 Result := CompareText(ThreadItem1.Title, ThreadItem2.Title)
117 else if SortIndex = 1 then
118 Result := CompareInt(ThreadItem1.Count, ThreadItem2.Count)
119 else if SortIndex = 2 then
120 // Result := CompareInt(ThreadItem1.RoundNo, ThreadItem2.RoundNo)
121 Result := CompareText(ThreadItem1.RoundName, ThreadItem2.RoundName)
123 Result := CompareDate(ThreadItem1.LastModified, ThreadItem2.LastModified);
125 if not SortOrder then
126 Result := Result * -1;
128 //
\83\
\81[
\83g
\95]
\89¿
\82ª
\93¯
\82¶
\8fê
\8d\87\82Í
\81A
\91æ1
\83J
\83\89\83\80\82Ì
\8f¸
\8f\87\82É
\83\
\81[
\83g
129 if Result = 0 then begin
131 Result := CompareInt(ThreadItem1.No, ThreadItem2.No)
133 Result := AnsiCompareText(ThreadItem1.Title, ThreadItem2.Title)
137 function CompareBool(Item1, Item2: Boolean): Integer;
139 if (Item1 = True) and (Item2 = False) then
141 else if (Item2 = False) and (Item2 = True) then
147 function CompareInt(Item1, Item2: Integer): Integer;
149 if Item1 > Item2 then
151 else if Item1 < Item2 then
157 function CompareDate(Item1, Item2: TDateTime): Integer;
159 if Item1 > Item2 then
161 else if Item1 < Item2 then