home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 January
/
Pcwk0198.iso
/
Dcomplib
/
BORDERLB.LZH
/
BLABEL.PAS
next >
Wrap
Pascal/Delphi Source File
|
1996-07-05
|
3KB
|
128 lines
(*
DESCRIPTION : A very simple component: a label with a border
AUTHOR : Harm v. Zoest, email : 4923559@hsu1.fnt.hvu.nl
VERSION : 1.0 07-05-1996
REMARKS : If you have comments, found bugs, ore you have added some
nice features, please mail me!
*)
unit BLabel;
interface
uses
Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TBorderLabel = class(TCustomLabel)
private
{ Private declarations }
FBColor : Tcolor;
FBWidth : integer;
FBStyle : TPenStyle;
FShow : boolean;
procedure SetColor(Value : Tcolor);
procedure SetStyle(Value : TpenStyle);
procedure SetWidth(Value : integer);
procedure Show(Value : boolean);
protected
{ Protected declarations }
procedure Paint; override;
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
published
{ Published declarations }
{ own properties}
property BorderColor : Tcolor read FBColor write SetColor;
property Borderpenstyle : TPenStyle read FBStyle write SetStyle;
property BorderWidth : integer read FBWidth write SetWidth default 1;
property ShowBorder : boolean read Fshow write Show ;
{ inherited properties }
property Align;
property Alignment;
property Autosize;
property Caption;
property Color;
property Cursor;
property DragCursor;
property DragMode;
property Enabled;
property FocusControl;
property Font;
property ParentColor;
property ParentFont;
property ParentShowHint;
property ShowAccelChar;
property ShowHint;
property Transparent;
property Visible;
property WordWrap;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
end;
procedure Register;
implementation
constructor TBorderlabel.Create;
begin
inherited Create(AOwner);
FBWidth := 1;
FShow := true;
canvas.pen.width := FBWidth;
canvas.pen.color := clBlack ;
end;
procedure TBorderLabel.Paint;
begin
inherited paint;
if Fshow then
Canvas.Rectangle(0,0,Width,Height);
end;
procedure Tborderlabel.SetColor(value : Tcolor);
begin
FBColor := value;
canvas.pen.color := value;
paint;
end;
procedure Tborderlabel.SetWidth(value : integer);
begin
FBWidth := value;
Canvas.Pen.Width := Value;
paint;
end;
procedure Tborderlabel.Show(value : boolean);
begin
Fshow := value;
paint;
end;
procedure Tborderlabel.SetStyle(value : TPenStyle);
begin
Canvas.Pen.Style := value;
paint;
end;
procedure Register;
begin
RegisterComponents('Standard', [TBorderLabel]);
end;
end.