unit DescendantForm;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms;
type
TCustomNewDescendantForm =
class(TForm)
private
fContentWindow : Boolean ;
procedure SetContentWindow(
const Value: Boolean);
procedure WMPaint(
var msg: TWMPaint);
message WM_PAINT;
protected
procedure Paint;
override;
procedure Resizing(State: TWindowState);
override;
property ContentWindow : Boolean
read fContentWindow
write SetContentWindow;
public
constructor Create(aOwner: TComponent);
override;
destructor Destroy;
override ;
end;
TNewDescendantForm =
class(TCustomNewDescendantForm)
published
property ContentWindow : Boolean
read fContentWindow
write SetContentWindow;
property OnPaint;
property OnResize;
end;
implementation
{ TCustomNewDescendantForm }
constructor TCustomNewDescendantForm.Create(aOwner: TComponent);
begin
Inherited;
end;
destructor TCustomNewDescendantForm.Destroy;
begin
Inherited;
end;
procedure TCustomNewDescendantForm.Paint;
var xPoint1 : TPoint ;
xRect1 : TRect ;
begin
Color := clWhite ;
aRect1.Left := 0 ;
aRect1.Top := 0 ;
aRect1.Bottom := ClientHeight ;
aRect1.Right := ClientWidth ;
Canvas.Brush.Color:= clWhite ;
Canvas.FillRect( aRect1 ) ;
Canvas.Pen.Color := clBlack ;
Canvas.RoundRect(2, 2, ClientWidth - 2, ClientHeight - 2, 20, 20);
aPoint1.X := 2 ;
aPoint1.Y := 100 ;
Canvas.Pen.Color := clBlack ; ;
Canvas.PenPos := aPoint1 ;
Canvas.LineTo(ClientWidth - 2 , 100) ;
Canvas.Brush.Color:= clRed ; ;
Canvas.FloodFill(10,10,clWhite,fsSurface) ;
end;
procedure TCustomNewDescendantForm.Resizing(State: TWindowState);
begin
Refresh;
Inherited;
end;
procedure TCustomNewDescendantForm.SetContentWindow(
const Value: Boolean);
begin
fContentWindow := Value ;
end;
procedure TCustomNewDescendantForm.WMPaint(
var msg: TWMPaint);
begin
Inherited ;
Paint;
end;
end.