{Вычисляем горизонтальную позицию}
wXPos:= Offset;
case alignment of
taRightJustify: wXPos:= Width – Canvas.TextWidth(Caption) – Offset;
taCenter: wXPos := (Width – Canvas.TextWidth(Caption)) div 2;
end;
Canvas.Brush:= Parent.Brush;
Canvas.TextOut(wXPos,wYPos,Caption);
end;
procedure TIDSLabel.SetAlignment;
begin
FAlignment:= taIn;
Invalidate;
end;
procedure TIDSLabel.SetCaption;
begin
FCaption:= strIn;
if Assigned(FOnChange) then FOnChange(Self);
Invalidate;
end;
procedure TIDSLabel.SetFont;
begin
FFont.Assign(fntNew);
Invalidate;
end;
procedure TIDSLabel.SetOffset;
begin
FOffset:= bOffNew;
Invalidate;
end;