IHYVCLObjectReference

Overview

IHYVCLObjectReference is a base interface that provides access to an object wrapped by objects such as user interface items.

If you want to access the TMenuItem created using a VCL menu controller, you would have to write code such as:

procedure TTextEditor.HYPluginControlsRepository1AfterMergeMenuItems(

  Sender: THYPluginControlsRepository; const aHost: IHYVCLHost;

  const anUpdateID: TGUID);

var filemenu: IHYVCLMenuItem;

begin

  // Here we do a little bit of manual customization since the Open and Save

  // items need to go under the File menu

  if (aHost.MenuController=NIL) then Exit;

  filemenu := aHost.MenuController.Items.MenuItemByCaption('File');

  ((filemenu as IHYVCLObjectReference).RefObject as TMenuItem).Caption := 'This is a new caption!';

end;

Alternatively, you could set such properties using Properties, with code such as:

(filemenu as IHYVCLObjectReference).Properties['Caption'] := 'This is a new caption!';

Location


 

DestroyObject

Destroys referenced object.

procedure DestroyObject

GetProperty

function GetProperty(const aName: string): Variant

Parameters:

  • aName:

GetRefObject

function GetRefObject: TObject

Properties

Gets or sets the value of the published properties of the referenced object with specified name.

property Properties[aName: string]: Variant read write

RefObject

Gets a pointer to the referenced object.

property RefObject: TObject read

SetProperty

procedure SetProperty(const aName: string; const aPropertyValue: Variant)

Parameters:

  • aName:
  • aPropertyValue:

 

Properties

Gets or sets the value of the published properties of the referenced object with specified name.

property Properties[aName: string]: Variant read write

RefObject

Gets a pointer to the referenced object.

property RefObject: TObject read

 

DestroyObject

Destroys referenced object.

procedure DestroyObject

GetProperty

function GetProperty(const aName: string): Variant

Parameters:

  • aName:

GetRefObject

function GetRefObject: TObject

SetProperty

procedure SetProperty(const aName: string; const aPropertyValue: Variant)

Parameters:

  • aName:
  • aPropertyValue: