| Line | |
|---|
| 1 | unit Area;
|
|---|
| 2 |
|
|---|
| 3 | interface
|
|---|
| 4 |
|
|---|
| 5 | uses
|
|---|
| 6 | WinProcs, Classes, Graphics, Controls;
|
|---|
| 7 |
|
|---|
| 8 | type
|
|---|
| 9 | TArea = class(TGraphicControl)
|
|---|
| 10 | constructor Create(aOwner: TComponent); override;
|
|---|
| 11 | protected
|
|---|
| 12 | procedure Paint; override;
|
|---|
| 13 | end;
|
|---|
| 14 |
|
|---|
| 15 | procedure Register;
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | implementation
|
|---|
| 19 |
|
|---|
| 20 | procedure Register;
|
|---|
| 21 | begin
|
|---|
| 22 | RegisterComponents('Samples', [TArea]);
|
|---|
| 23 | end;
|
|---|
| 24 |
|
|---|
| 25 | constructor TArea.Create;
|
|---|
| 26 | begin
|
|---|
| 27 | inherited Create(aOwner);
|
|---|
| 28 | Enabled:=false;
|
|---|
| 29 | ShowHint:=true;
|
|---|
| 30 | end;
|
|---|
| 31 |
|
|---|
| 32 | procedure TArea.Paint;
|
|---|
| 33 | begin
|
|---|
| 34 | if csDesigning in ComponentState then
|
|---|
| 35 | with Canvas do
|
|---|
| 36 | begin Brush.Color:=$FF0000; FrameRect(Rect(0,0,width,height)) end
|
|---|
| 37 | end;
|
|---|
| 38 |
|
|---|
| 39 | end.
|
|---|
| 40 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.