《Delphi COM深入编程》原书光盘
源代码在线查看: intfunit.pas
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.