Menu

[r1]: / ChannelList_Window.pas  Maximize  Restore  History

Download this file

60 lines (50 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
unit ChannelList_Window;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, ComCtrls, Menus;
type
TCList = class(TForm)
ChanList: TListBox;
Hash: TImage;
Status: TStatusBar;
Kludge: TEdit;
procedure ChanListDrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
CList: TCList;
implementation
{$R *.DFM}
procedure TCList.ChanListDrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
Var Offset: Integer;
Txt,T1,T2,T3:String;
begin
with (Control as TListBox).Canvas do
begin
FillRect(Rect);
Offset:=hash.width+6;
Font.Style:=[fsBold,fsUnderline];
If Index<>0 then
begin
BrushCopy(Bounds(Rect.Left+2,Rect.Top,hash.Width,hash.Height),hash.picture.bitmap,
Bounds(0,0,hash.Width,hash.Height),clWhite);
Font.Style:=[];
end;
Txt:=ChanList.Items[Index];
T1:=Copy(Txt,1,Pos(#9,Txt)-1);
Delete(Txt,1,Pos(#9,Txt));
T2:=Copy(Txt,1,Pos(#9,Txt)-1);
Delete(Txt,1,Pos(#9,Txt));
T3:=Txt;
TextOut(Rect.Left+Offset,Rect.Top,T1);
TextOut(Rect.Left+Offset+80,Rect.Top,T2);
TextOut(Rect.Left+Offset+130,Rect.Top,T3);
end;
end;
end.