mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 01:59:10 +02:00
lcl: formatting
git-svn-id: trunk@18815 -
This commit is contained in:
parent
b95e622129
commit
a4a728b2a4
@ -45,7 +45,8 @@ begin
|
||||
|
||||
PaintRect := Rect(0, 0, Self.Width - 1, Self.Height - 1);
|
||||
InflateRect(PaintRect, -(Pen.Width div 2), -(Pen.Width div 2));
|
||||
With PaintRect do begin
|
||||
with PaintRect do
|
||||
begin
|
||||
MinSize := Min(Right - Left, Bottom - Top);
|
||||
if FShape in [stSquare, stRoundSquare, stCircle, stSquaredDiamond] then
|
||||
begin
|
||||
@ -64,36 +65,42 @@ begin
|
||||
stCircle, stEllipse:
|
||||
Ellipse(PaintRect);
|
||||
stSquaredDiamond, stDiamond:
|
||||
with PaintRect do begin
|
||||
P[0].x:=Left; 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;
|
||||
begin
|
||||
with PaintRect do
|
||||
begin
|
||||
P[0].x := Left;
|
||||
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);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// to fire OnPaint event
|
||||
inherited Paint;
|
||||
end;
|
||||
|
||||
procedure TShape.StyleChanged(Sender: TObject);
|
||||
begin
|
||||
If (Parent <> nil) and (Visible or (csDesigning in ComponentState))
|
||||
and Parent.HandleAllocated
|
||||
then
|
||||
if (Parent <> nil) and (Visible or (csDesigning in ComponentState)) and
|
||||
Parent.HandleAllocated then
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TShape.SetBrush(Value: TBrush);
|
||||
begin
|
||||
If Value <> Brush then
|
||||
if Value <> Brush then
|
||||
FBrush.Assign(Value);
|
||||
end;
|
||||
|
||||
procedure TShape.SetPen(Value: TPen);
|
||||
begin
|
||||
If Value <> Pen then
|
||||
if Value <> Pen then
|
||||
FPen.Assign(Value);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user