source: cprs/branches/tmg-cprs/CPRS-Chart/fRemCoverPreview.pas@ 731

Last change on this file since 731 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
2unit fRemCoverPreview;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 ComCtrls, StdCtrls, ExtCtrls, DKLang;
9
10type
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
27implementation
28
29{$R *.DFM}
30
31procedure TfrmRemCoverPreview.FormCreate(Sender: TObject);
32begin
33 FSortCol := 2;
34 FSortUp := TRUE;
35end;
36
37procedure TfrmRemCoverPreview.lvMainColumnClick(Sender: TObject;
38 Column: TListColumn);
39begin
40 if FSortCol <> Column.Tag then
41 FSortCol := Column.Tag
42 else
43 FSortUp := not FSortUp;
44 lvMain.CustomSort(nil, 0);
45end;
46
47procedure TfrmRemCoverPreview.lvMainCompare(Sender: TObject; Item1,
48 Item2: TListItem; Data: Integer; var Compare: Integer);
49var
50 i: integer;
51 odr: array[1..2] of integer;
52 s1, s2: string;
53
54begin
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;
85end;
86
87end.
Note: See TracBrowser for help on using the repository browser.