lcl: formatting

git-svn-id: trunk@18815 -
This commit is contained in:
paul 2009-02-24 04:41:24 +00:00
parent b95e622129
commit a4a728b2a4

View File

@ -45,7 +45,8 @@ begin
PaintRect := Rect(0, 0, Self.Width - 1, Self.Height - 1); PaintRect := Rect(0, 0, Self.Width - 1, Self.Height - 1);
InflateRect(PaintRect, -(Pen.Width div 2), -(Pen.Width div 2)); InflateRect(PaintRect, -(Pen.Width div 2), -(Pen.Width div 2));
With PaintRect do begin with PaintRect do
begin
MinSize := Min(Right - Left, Bottom - Top); MinSize := Min(Right - Left, Bottom - Top);
if FShape in [stSquare, stRoundSquare, stCircle, stSquaredDiamond] then if FShape in [stSquare, stRoundSquare, stCircle, stSquaredDiamond] then
begin begin
@ -64,36 +65,42 @@ begin
stCircle, stEllipse: stCircle, stEllipse:
Ellipse(PaintRect); Ellipse(PaintRect);
stSquaredDiamond, stDiamond: stSquaredDiamond, stDiamond:
with PaintRect do begin begin
P[0].x:=Left; P[0].y:=Top + (Bottom - Top) div 2; with PaintRect do
P[1].x:=Left+ (Right - Left) div 2; P[1].y:=Bottom; begin
P[2].x:=Right; P[2].y:= P[0].y; P[0].x := Left;
P[3].x:=P[1].x; P[3].y:=Top; P[0].y := Top + (Bottom - Top) div 2;
P[1].x := Left + (Right - Left) div 2;
P[1].y := Bottom;
P[2].x := Right;
P[2].y := P[0].y;
P[3].x := P[1].x;
P[3].y := Top;
Polygon(P); Polygon(P);
end; end;
end; end;
end; end;
end;
// to fire OnPaint event // to fire OnPaint event
inherited Paint; inherited Paint;
end; end;
procedure TShape.StyleChanged(Sender: TObject); procedure TShape.StyleChanged(Sender: TObject);
begin begin
If (Parent <> nil) and (Visible or (csDesigning in ComponentState)) if (Parent <> nil) and (Visible or (csDesigning in ComponentState)) and
and Parent.HandleAllocated Parent.HandleAllocated then
then
Invalidate; Invalidate;
end; end;
procedure TShape.SetBrush(Value: TBrush); procedure TShape.SetBrush(Value: TBrush);
begin begin
If Value <> Brush then if Value <> Brush then
FBrush.Assign(Value); FBrush.Assign(Value);
end; end;
procedure TShape.SetPen(Value: TPen); procedure TShape.SetPen(Value: TPen);
begin begin
If Value <> Pen then if Value <> Pen then
FPen.Assign(Value); FPen.Assign(Value);
end; end;