1
0

Fix polymorphic drawing example

This commit is contained in:
Timothy Warren 2021-10-07 17:15:42 -04:00
parent 18f01a9ebc
commit a8c63d1f5a
3 changed files with 6 additions and 5 deletions

View File

@ -5,7 +5,7 @@ unit drawing;
interface
uses
Classes, SysUtils, Controls, ExtCtrls, Graphics;
Classes, Controls, Graphics;
type TDrawing = class(TGraphicControl)
private

View File

@ -39,6 +39,7 @@
<Filename Value="drawingdisplay.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
<Unit2>

View File

@ -5,14 +5,14 @@ unit drawingdisplay;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, drawing;
Forms, ExtCtrls, drawing;
type
{ TForm1 }
TForm1 = class(TForm)
rgShape: TRadioGroup;
procedure FormCreate(Sender: TObject);
procedure rgShapeClick(Sender: TObject);
private
rgShape: TRadioGroup;
FDrawing: TDrawing;
procedure CreateANewDrawing;
public
@ -25,6 +25,8 @@ var
implementation
{$R *.lfm}
procedure TForm1.CreateANewDrawing;
begin
if (rgShape.ItemIndex < 0) then Exit;
@ -56,7 +58,5 @@ begin
CreateANewDrawing;
end;
{$R *.lfm}
end.