Last change
on this file since 761 was 453, checked in by Kevin Toppenberg, 16 years ago |
Initial upload of TMG-CPRS 1.0.26.69
|
File size:
1.9 KB
|
Line | |
---|
1 | //kt -- Modified with SourceScanner on 8/28/2007
|
---|
2 | unit fRemCoverPreview;
|
---|
3 |
|
---|
4 | interface
|
---|
5 |
|
---|
6 | uses
|
---|
7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
8 | ComCtrls, StdCtrls, ExtCtrls, DKLang;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TfrmRemCoverPreview = class(TForm)
|
---|
12 | pnlBtns: TPanel;
|
---|
13 | btnOK: TButton;
|
---|
14 | lvMain: TListView;
|
---|
15 | DKLanguageController1: TDKLanguageController;
|
---|
16 | procedure FormCreate(Sender: TObject);
|
---|
17 | procedure lvMainColumnClick(Sender: TObject; Column: TListColumn);
|
---|
18 | procedure lvMainCompare(Sender: TObject; Item1, Item2: TListItem;
|
---|
19 | Data: Integer; var Compare: Integer);
|
---|
20 | private
|
---|
21 | FSortCol: integer;
|
---|
22 | FSortUp: boolean;
|
---|
23 | public
|
---|
24 | { Public declarations }
|
---|
25 | end;
|
---|
26 |
|
---|
27 | implementation
|
---|
28 |
|
---|
29 | {$R *.DFM}
|
---|
30 |
|
---|
31 | procedure TfrmRemCoverPreview.FormCreate(Sender: TObject);
|
---|
32 | begin
|
---|
33 | FSortCol := 2;
|
---|
34 | FSortUp := TRUE;
|
---|
35 | end;
|
---|
36 |
|
---|
37 | procedure TfrmRemCoverPreview.lvMainColumnClick(Sender: TObject;
|
---|
38 | Column: TListColumn);
|
---|
39 | begin
|
---|
40 | if FSortCol <> Column.Tag then
|
---|
41 | FSortCol := Column.Tag
|
---|
42 | else
|
---|
43 | FSortUp := not FSortUp;
|
---|
44 | lvMain.CustomSort(nil, 0);
|
---|
45 | end;
|
---|
46 |
|
---|
47 | procedure TfrmRemCoverPreview.lvMainCompare(Sender: TObject; Item1,
|
---|
48 | Item2: TListItem; Data: Integer; var Compare: Integer);
|
---|
49 | var
|
---|
50 | i: integer;
|
---|
51 | odr: array[1..2] of integer;
|
---|
52 | s1, s2: string;
|
---|
53 |
|
---|
54 | begin
|
---|
55 | case FSortCol of
|
---|
56 | 1: begin
|
---|
57 | odr[1] := 1;
|
---|
58 | odr[2] := 2;
|
---|
59 | end;
|
---|
60 |
|
---|
61 | 2: begin
|
---|
62 | odr[1] := 2;
|
---|
63 | odr[2] := 1;
|
---|
64 | end;
|
---|
65 | end;
|
---|
66 | Compare := 0;
|
---|
67 | for i := 1 to 2 do
|
---|
68 | begin
|
---|
69 | case odr[i] of
|
---|
70 | 1: begin
|
---|
71 | s1 := Item1.Caption;
|
---|
72 | s2 := Item2.Caption;
|
---|
73 | end;
|
---|
74 |
|
---|
75 | 2: begin
|
---|
76 | s1 := Item1.SubItems[1];
|
---|
77 | s2 := Item2.SubItems[1];
|
---|
78 | end;
|
---|
79 | end;
|
---|
80 | Compare := CompareText(s1, s2);
|
---|
81 | if Compare <> 0 then break;
|
---|
82 | end;
|
---|
83 | if not FSortUp then
|
---|
84 | Compare := -Compare;
|
---|
85 | end;
|
---|
86 |
|
---|
87 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.