intfunit.pas

来自「《Delphi COM深入编程》原书光盘」· PAS 代码 · 共 46 行

PAS
46
字号
unit IntfUnit;

interface

uses
  Windows, graphics;

type
  IColor = interface
    ['{EAE054E1-EB94-11D2-9086-0040F6741DE2}']
    function GetColor: TColor;
    procedure SetColor(AColor: TColor);
    property Color: TColor read GetColor write SetColor;
  end;

  IPosition = interface
    ['{162EDFE1-EB8C-11D2-9086-0040F6741DE2}']
    function GetXY: TPoint;
    procedure SetXY(APoint: TPoint);
    procedure NudgeUp;
    procedure NudgeDown;
    procedure NudgeLeft;
    procedure NudgeRight;
    property Point: TPoint read GetXY write SetXY;
  end;

  ISize = interface
    ['{162EDFE0-EB8C-11D2-9086-0040F6741DE2}']
    function GetWidth: Integer;
    function GetHeight: Integer;
    procedure SetWidth(AWidth: Integer);
    procedure SetHeight(AHeight: Integer);
    property Height: Integer read GetHeight write SetHeight;
    property Width: Integer read GetWidth write SetWidth;
  end;

  IDraw = interface
    ['{FFCD24F3-4FE8-11D3-B84D-0040F67455FE}']
    procedure Draw(ACanvas: TCanvas);
  end;

implementation

end.

⌨️ 快捷键说明

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