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
- Unit: Hydra.VCL.PluginControlsRepository.pas
- Ancestry: TComponent | THYPluginControlsRepository
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
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
Merge
Merges repository items into the specified host.
procedure Merge(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
MergeMenuItems protected virtual
Merges menu items into the specified host.
procedure MergeMenuItems(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
MergeOptions
Gets or sets value that idicates what items should be merged.
property MergeOptions: THYMergeControlOptions read write
MergeToolbars protected virtual
Merges toolbars into the specified host.
procedure MergeToolbars(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
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
UnMerge
Unmerges repository items from the the specified host.
procedure UnMerge(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
UnMergeMenuItems protected virtual
Unmerges menu items into the specified host.
procedure UnMergeMenuItems(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
UnMergeToolbars protected virtual
Unmerges toolbars into the specified host.
procedure UnMergeToolbars(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
ActionListImages
Gets reference to the image list that is used for actions.
property ActionListImages: TCustomImageList read
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
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
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
Merges repository items into the specified host.
procedure Merge(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
MergeMenuItems protected virtual
Merges menu items into the specified host.
procedure MergeMenuItems(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
MergeToolbars protected virtual
Merges toolbars into the specified host.
procedure MergeToolbars(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
SaveToStream
Saves controls definition into the specified stream.
procedure SaveToStream(aStream: TStream)
Parameters:
- aStream: Reference to the stream.
UnMerge
Unmerges repository items from the the specified host.
procedure UnMerge(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
UnMergeMenuItems protected virtual
Unmerges menu items into the specified host.
procedure UnMergeMenuItems(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
UnMergeToolbars protected virtual
Unmerges toolbars into the specified host.
procedure UnMergeToolbars(const aHost: IHYVCLHost)
Parameters:
- aHost: Reference to a host instance.
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)