mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 19:58:25 +02:00
48 lines
1.6 KiB
PHP
48 lines
1.6 KiB
PHP
// included by extctrls.pp
|
|
|
|
{ TPaintBox
|
|
|
|
*****************************************************************************
|
|
* *
|
|
* This file is part of the Lazarus Component Library (LCL) *
|
|
* *
|
|
* See the file COPYING.LCL, included in this distribution, *
|
|
* for details about the copyright. *
|
|
* *
|
|
* This program is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
* *
|
|
*****************************************************************************
|
|
}
|
|
|
|
constructor TPaintBox.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
ControlStyle := ControlStyle + [csReplicatable];
|
|
SetInitialBounds(0,0,105,105);
|
|
end;
|
|
|
|
procedure TPaintBox.Paint;
|
|
begin
|
|
if csDesigning in ComponentState then begin
|
|
Canvas.Font := Font;
|
|
Canvas.Brush.Color := Color;
|
|
with Canvas do
|
|
begin
|
|
Pen.Style := psDash;
|
|
Brush.Style := bsClear;
|
|
Rectangle(0, 0, Width - 1, Height - 1);
|
|
end;
|
|
exit;
|
|
end;
|
|
if Assigned(FOnPaint) then begin
|
|
Canvas.Font := Font;
|
|
Canvas.Brush.Color := Color;
|
|
FOnPaint(Self);
|
|
end;
|
|
end;
|
|
|
|
// included by extctrls.pp
|
|
|