shapes.pas

来自「《Kylix程序设计》一书中附带的例程源代码」· PAS 代码 · 共 72 行

PAS
72
字号
unit Shapes;interfaceuses  SysUtils, Classes, Types, QGraphics;type  TGeoShape = class( TObject )
  public
    function Draw(): string;
  end;

  TGeoPoint = class( TGeoShape )
  protected
    FPoint: TPoint;
  public
    function Draw(): string; overload;
  end;

  TGeoLine = class( TGeoPoint )
  protected
    FToPoint: TPoint;
  public
    function Draw(): string; overload;
  end;

  TGeoRect = class( TGeoShape )
  protected
    FRect: TRect;
  public
    function Draw(): string; overload;
  end;
{var  Shape: TGeoShape;  Point: TGeoPoint;  Line: TGeoLine;  Rect: TGeoRect;}implementation{ TGeoShape }function TGeoShape.Draw: string;begin  Result := 'TGeoShape.Draw called.';end;{ TGeoPoint }function TGeoPoint.Draw: string;begin  Result := 'TGeoPoint.Draw called.';end;{ TGeoLine }function TGeoLine.Draw: string;begin  Result := 'TGeoLine.Draw called.';end;{ TGeoRect }function TGeoRect.Draw: string;begin  Result := 'TGeoLine.Draw called.';end;end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?