unit Ctrl_ListItem;
interface
uses
SysUtils, Classes, Controls, ExtCtrls, StdCtrls, Graphics,dialogs;
type
TCtrl_ListItem =
class(TWinControl)
private
FUrl:
string;
FDescription:
string;
procedure SetLabel_Url(
const Value:
string);
procedure SetLabel_Description(
const Value:
string);
function ReadLabel_Url:
string;
function ReadLabel_Description:
string;
protected
Label_Url: TLabel;
Label_Description: TLabel;
public
constructor Create(AOwner: TComponent);
//override;
published
property Url:
string read FUrl
write SetLabel_Url;
property Description:
string read FDescription
write SetLabel_Description;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Standard', [TCtrl_ListItem]);
end;
{ TCtrl_ListItem }
constructor TCtrl_ListItem.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
// csAcceptsControls ist gesetzt
//ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
// csSetCaption, csOpaque, csDoubleClicks, csReplicatable];
self.Label_Url := TLabel.Create(self.Owner);
//NOTWENDIG???????????
self.Label_Description := TLabel.Create(self);
Self.Align := alTop;
self.Color := clCream;
self.Font.Color := clCream;
self.Label_Url.ParentColor := false;
self.Label_Url.ParentFont := false;
self.Label_Url.Top := 8;
self.Label_Url.Left := 8;
self.Label_Url.Font.Color := clBlue;
self.Label_Url.Font.Style := [fsBold];
self.Label_Url.Font.Size := 10;
self.Label_Url.Cursor := crHandPoint;
self.Label_Description.ParentColor := false;
self.Label_Description.ParentFont := false;
self.Label_Description.Top := 24;
self.Label_Description.Left := 8;
self.Label_Description.Font.Color := clblack;
self.Label_Description.Font.Style := [fsBold];
self.Label_Description.Font.Size := 8;
self.Label_Description.Height := 33;
self.Label_Description.Width := self.Width - 8;
self.Label_Description.Anchors := [akLeft, akTop, akRight];
self.Label_Url.BringToFront;
self.Label_Description.BringToFront;
Invalidate;
end;
function TCtrl_ListItem.ReadLabel_Description:
string;
begin
result := FDescription;
end;
function TCtrl_ListItem.ReadLabel_Url:
string;
begin
result := FUrl;
end;
procedure TCtrl_ListItem.SetLabel_Description(
const Value:
string);
begin
self.FDescription := Value;
self.Label_Description.Caption := Self.FDescription;
Invalidate;
end;
procedure TCtrl_ListItem.SetLabel_Url(
const Value:
string);
begin
self.FUrl := Value;
self.Label_Url.Caption := Self.FUrl;
Invalidate;
end;
end.