property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
property Caption: String read FCaption write SetCaption;
property Font: TFont read FFont write SetFont;
property Offset: Byte read FOffset write SetOffset;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
implementation
constructor TIDSLabel.Create;
begin
inherited Create(compOwn);
FFont:= TFont.Create;
with compOwn as TForm do FFont.Assign(Font);
Offset:= 4;
Height:= 15;
end;
destructor TIDSLabel.Destroy;
begin
FFont.Free;
inherited Destroy;
end;
procedure TIDSLabel.Paint;
var
wXPos, wYPos : Word;
begin
{Рисуем рамку}
inherited Paint;
{Назначаем шрифт}
Canvas.Font.Assign(Font);
{Вычисляем вертикальную позицию}
wYPos:= (Height – Canvas.TextHeight(Caption)) div 2;