if visible = false then
exit;
if width = 0 then
exit;
with Controldo
begin
LBorder:= Rect(0,0,self.width,ClientHeight);
RBorder:= Rect(ClientWidth-Self.Width,0,ClientWidth,ClientHeight);
TBorder:= Rect(0,0,ClientWidth,Self.Width);
BBorder:= Rect(0,ClientHeight-Self.Width,ClientWidth,ClientHeight);
end;
if GradientFill then
begin
DrawGradRect(Canvas,LBorder,GradientStartColor,GradientEndColor,jgtHorz);
DrawGradRect(Canvas,TBorder,GradientStartColor,GradientEndColor,jgtVert);
DrawGradRect(Canvas,RBorder,GradientStartColor,GradientEndColor,jgtHorz);
DrawGradRect(Canvas,BBorder,GradientStartColor,GradientEndColor,jgtVert);
end
else
begin
SavedColor:= Canvas.Brush.Color;
Canvas.brush.color:= Color;
DrawRect(Canvas,LBorder);
DrawRect(Canvas,TBorder);
DrawRect(Canvas,RBorder);
DrawRect(Canvas,BBorder);
Canvas.Brush.Color:= SavedColor;
end;
{draw the corners}
if CornerVisible then
begin
Canvas.Brush.Color:= SavedColor;
Canvas.brush.color:= CornerColor;
CornerLength:= 20;
RBorder.Right:= RBorder.Right-1;
BBorder.Bottom:= BBorder.Bottom-1;
with LBorderdo
begin
Canvas.Polygon([Point(0,0),Point(right,width),Point(width,CornerLength),Point(0,CornerLength)]);
Canvas.Polygon([Point(0,bottom),Point(0,bottom-CornerLength),Point(width,bottom-CornerLength),Point(width,Bottom-width)]);
end;
with TBorderdo
begin
Canvas.Polygon([Point(0,0),Point(CornerLength,0),Point(CornerLength,width),Point(width,width)]);
Canvas.Polygon([Point(right,0),Point(right-width,width),Point(right-CornerLength,width),Point(right-CornerLength,0)]);
end;
with RBorderdo
begin
Canvas.Polygon([Point(right,0),Point(right,CornerLength),Point(right-width,CornerLength),Point(right-width,width)]);
Canvas.Polygon([Point(right,bottom),Point(right-width,bottom-width),Point(right-width,bottom-CornerLength),Point(right,bottom-CornerLength)]);
end;
with BBorderdo
begin
Canvas.Polygon([Point(right,bottom),Point(right-CornerLength,bottom),Point(right-CornerLength,bottom-width),Point(right-width,bottom-width)]);
Canvas.Polygon([Point(0,bottom),Point(width,bottom-width),Point(CornerLength,bottom-width),Point(CornerLength,bottom)]);
end;
end;