Class TTestOle (unit TestObjects)

Inherits from

TDelphiOle

result in HIMETRIC

Constructors


constructor Create;

////////////////////////////////////////////////////////////////////////////// TTestOle //////////////////////////////////////////////////////////////////////////////


Functions

destructor destroy;


function DoVerb(iVerb: Longint): HResult;

showAsIcon

procedure Draw(dwDrawAspect: Longint;const bounds:TRect;Canvas:TCanvas);

we use the same font as our Delphi container uses.

class function GetCLSID:TCLSID;


function GetExtent(dwDrawAspect: Longint):TPoint;

str.

class function GetProgID:string;


class function GetUserType:string;


procedure Load(str:TStream);

write icon data only if not empty

procedure Save(str:TStream);

use same font as container

procedure SetIcon(newIcon:TIcon);


procedure SetShowAsIcon(asIcon:boolean);

data v property, on change klici viewChanged

property acces methods


procedure AssignToContainerFont(DestFont:TFont);


Properties

property Icon : TIcon


property showAsIcon : boolean


Events

Variables

data : string;


fIcon : TIcon;


fShowAsIcon : boolean;

we could use DVASPECT_ICON but using VCL is much easier


Constructors


constructor Create;

////////////////////////////////////////////////////////////////////////////// TTestOle //////////////////////////////////////////////////////////////////////////////


Functions


destructor destroy;


function DoVerb(iVerb: Longint): HResult;

showAsIcon


procedure Draw(dwDrawAspect: Longint;const bounds:TRect;Canvas:TCanvas);

we use the same font as our Delphi container uses. BTW: font property is declared in TWinControl, but is inaccessible, because it is protected


class function GetCLSID:TCLSID;


function GetExtent(dwDrawAspect: Longint):TPoint;

str.ReadBuffer(l,sizeof(l));


class function GetProgID:string;


class function GetUserType:string;


procedure Load(str:TStream);

write icon data only if not empty


procedure Save(str:TStream);

use same font as container


procedure SetIcon(newIcon:TIcon);


procedure SetShowAsIcon(asIcon:boolean);

data v property, on change klici viewChanged

property acces methods


procedure AssignToContainerFont(DestFont:TFont);


Properties


property Icon : TIcon


property showAsIcon : boolean


Events


Variables


data : string;


fIcon : TIcon;


fShowAsIcon : boolean;

we could use DVASPECT_ICON but using VCL is much easier