THYPluginControlsRepository

Overview

The THYPluginControlsRepository class is a component that stores the definition of menu items and toolbars inside a plugin, and provides an ability to merge those items into the host application.

Use Case

Place this component inside a plugin (both visual and non visual supported), and define an items with the associated editor.

For more information about menus and toolbars support, please refere to this article.

Location

 

constructor Create  override

Creates a new instance of the class.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Reference to the owner class.

ActionListImages

Gets reference to the image list that is used for actions.

property ActionListImages: TCustomImageList read write

Actions

Gets or sets reference to the action list.

property Actions: TActionList read write

LoadFromStream

Loads controls definition from the specified stream.

procedure LoadFromStream(aStream: TStream)

Parameters:

  • aStream: Reference to the stream.

LoadFromString

Loads controls definition from XML formated string.

procedure LoadFromString(aString: string)

Parameters:

  • aString: String that holds controls definitions.

MenuItems

Gets or sets reference to the collection of menu items.

property MenuItems: THYMenuItemDefList read write

MenuUpdateID

Gets an identifier for menu updates.

property MenuUpdateID: TGUID read write

Merge

procedure Merge(const aHost: IHYVCLHost)

Parameters:

  • aHost:

MergeMenuItems  protected virtual

procedure MergeMenuItems(const aHost: IHYVCLHost)

Parameters:

  • aHost:

MergeOptions

Gets or sets value that idicates what items should be merged.

property MergeOptions: THYMergeControlOptions read write

MergeToolbars  protected virtual

procedure MergeToolbars(const aHost: IHYVCLHost)

Parameters:

  • aHost:

OnAfterMergeMenuItems

Gets or sets event handler that is trigger after menu items were merged.

property OnAfterMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnAfterMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnAfterMergeToolbars

Gets or sets event handler that is trigger after toolbars were merged.

property OnAfterMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnAfterMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnAfterUnMergeMenuItems

Gets or sets event handler that is trigger after menu items were unmerged.

property OnAfterUnMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnAfterUnMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnAfterUnMergeToolbars

Gets or sets event handler that is trigger after toolbar were unmerged.

property OnAfterUnMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnAfterUnMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeMergeMenuItems

Gets or sets event handler that is trigger before menu items is merged.

property OnBeforeMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnBeforeMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeMergeToolbars

Gets or sets event handler that is trigger before toolbars is merged.

property OnBeforeMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnBeforeMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeUnMergeMenuItems

Gets or sets event handler that is trigger before menu items is unmerged.

property OnBeforeUnMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnBeforeUnMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeUnMergeToolbars

Gets or sets event handler that is trigger before toolbars is unmerged.

property OnBeforeUnMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnBeforeUnMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

SaveToStream

Saves controls definition into the specified stream.

procedure SaveToStream(aStream: TStream)

Parameters:

  • aStream: Reference to the stream.

Toolbars

Gets or sets reference to the collection of toolbars.

property Toolbars: THYToolbarDefList read write

ToolbarUpdateID

Gets an identifier for toolbar updates.

property ToolbarUpdateID: TGUID read write

UnMerge

procedure UnMerge(const aHost: IHYVCLHost)

Parameters:

  • aHost:

UnMergeMenuItems  protected virtual

procedure UnMergeMenuItems(const aHost: IHYVCLHost)

Parameters:

  • aHost:

UnMergeToolbars  protected virtual

procedure UnMergeToolbars(const aHost: IHYVCLHost)

Parameters:

  • aHost:

 

ActionListImages

Gets reference to the image list that is used for actions.

property ActionListImages: TCustomImageList read write

Actions

Gets or sets reference to the action list.

property Actions: TActionList read write

MenuItems

Gets or sets reference to the collection of menu items.

property MenuItems: THYMenuItemDefList read write

MenuUpdateID

Gets an identifier for menu updates.

property MenuUpdateID: TGUID read write

MergeOptions

Gets or sets value that idicates what items should be merged.

property MergeOptions: THYMergeControlOptions read write

Toolbars

Gets or sets reference to the collection of toolbars.

property Toolbars: THYToolbarDefList read write

ToolbarUpdateID

Gets an identifier for toolbar updates.

property ToolbarUpdateID: TGUID read write

 

constructor Create  override

Creates a new instance of the class.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Reference to the owner class.

LoadFromStream

Loads controls definition from the specified stream.

procedure LoadFromStream(aStream: TStream)

Parameters:

  • aStream: Reference to the stream.

LoadFromString

Loads controls definition from XML formated string.

procedure LoadFromString(aString: string)

Parameters:

  • aString: String that holds controls definitions.

Merge

procedure Merge(const aHost: IHYVCLHost)

Parameters:

  • aHost:

MergeMenuItems  protected virtual

procedure MergeMenuItems(const aHost: IHYVCLHost)

Parameters:

  • aHost:

MergeToolbars  protected virtual

procedure MergeToolbars(const aHost: IHYVCLHost)

Parameters:

  • aHost:

SaveToStream

Saves controls definition into the specified stream.

procedure SaveToStream(aStream: TStream)

Parameters:

  • aStream: Reference to the stream.

UnMerge

procedure UnMerge(const aHost: IHYVCLHost)

Parameters:

  • aHost:

UnMergeMenuItems  protected virtual

procedure UnMergeMenuItems(const aHost: IHYVCLHost)

Parameters:

  • aHost:

UnMergeToolbars  protected virtual

procedure UnMergeToolbars(const aHost: IHYVCLHost)

Parameters:

  • aHost:

 

OnAfterMergeMenuItems

Gets or sets event handler that is trigger after menu items were merged.

property OnAfterMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnAfterMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnAfterMergeToolbars

Gets or sets event handler that is trigger after toolbars were merged.

property OnAfterMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnAfterMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnAfterUnMergeMenuItems

Gets or sets event handler that is trigger after menu items were unmerged.

property OnAfterUnMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnAfterUnMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnAfterUnMergeToolbars

Gets or sets event handler that is trigger after toolbar were unmerged.

property OnAfterUnMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnAfterUnMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeMergeMenuItems

Gets or sets event handler that is trigger before menu items is merged.

property OnBeforeMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnBeforeMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeMergeToolbars

Gets or sets event handler that is trigger before toolbars is merged.

property OnBeforeMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnBeforeMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeUnMergeMenuItems

Gets or sets event handler that is trigger before menu items is unmerged.

property OnBeforeUnMergeMenuItems: THYOnMergeEvent read write
delegate: procedure OnBeforeUnMergeMenuItems(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)

OnBeforeUnMergeToolbars

Gets or sets event handler that is trigger before toolbars is unmerged.

property OnBeforeUnMergeToolbars: THYOnMergeEvent read write
delegate: procedure OnBeforeUnMergeToolbars(Sender: THYPluginControlsRepository; const aHost: IHYVCLHost; const anUpdateID: TGUID)