IHYMenuItem Interface

This is a Library topic for Hydra for Delphi
This page is generated from external data, please do not update
Interfaces — Classes — Enums — Aliases — Implements
Contents |
Overview
IHYMenuItem is an interface that represents menu items for the Hydra framework. Inside the Hydra framework, this interface is used to provide support for menu merging between host and plugins.
You can read about menu and toolbar merging in this article.
Use Case
You may use this interface to manipulate menu items, as an example, the following code demonstrates how you can manually add menu items into your host application menu:
procedure TTextEditor.HYPluginControlsRepository1AfterMergeMenuItems( Sender: THYPluginControlsRepository; const aHost: IHYHost; const anUpdateID: TGUID); var filemenu : IHYMenuItem; begin // Here, we customize manually, 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.Insert(0, actOpen); filemenu.Insert(1, actSave); filemenu.InsertSeparator(2); end;
Note: Take a look at the Actions sample shipped with Hydra to see menu and toolbar merging in action.
Location
uHYIntf.pas
- Ancestry: IHYObjectReference | IHYControl | IHYMenuItem
Implemented in
Properties
| Action (declared in IHYControl) |
|---|
|
Gets or sets the reference to the action associated with the control.
|
| Caption (declared in IHYControl) |
|
Gets or sets the caption associated with the control.
|
| Count |
|
Gets the number of subitems of the menu item.
|
| Index (declared in IHYControl) |
|
Gets the index associated with the control.
|
| Items |
|
Gets reference to a menu item with specified index.
|
| Properties (declared in IHYObjectReference) |
|
Gets or sets the value of the published properties of the referenced object with specified name.
|
| RefObject (declared in IHYObjectReference) |
|
Gets a pointer to the referenced object.
|
Required Methods
| Add (string): IHYMenuItem overload |
|---|
|
Adds a new item with specified caption.
|
| Add (TBasicAction): IHYMenuItem overload |
|
Adds a new item and fills it with information from the action object.
|
| AddMenu |
|
Adds a new menu with the specified caption.
|
| AddSeparator |
|
Adds a separator line.
|
| Delete |
|
Deletes the menu item with the given index.
|
| DestroyObject (declared in IHYObjectReference) |
|
Destroys referenced object.
|
| FindMenuItem |
|
Searches for the menu item with the given caption, if this menu item does not exist, nil is returned.
|
| Insert (integer, string): IHYMenuItem overload |
|
Inserts a new item with the given caption into the position specified by the anIndex parameter.
|
| Insert (integer, TBasicAction): IHYMenuItem overload |
|
Inserts a new item into the position specified by the anIndex parameter and fills it with information from the given action object.
|
| InsertMenu |
|
Inserts a new menu with the given caption into the position specified by the anIndex parameter.
|
| InsertSeparator |
|
Inserts a separator line into the position specified by the anIndex parameter.
|
| MenuItemByCaption |
|
Searches for the menu item with the given caption, if this menu item does not exists, an EHYException is raised.
|
See Also
- Hydra support for Menus and Toolbars (Delphi)
- THYBaseMenuItem
- Lists
- Hydra for Delphi: Interfaces — Classes — Enums — Aliases — Implements
- Hydra for .NET: Namespaces — Interfaces — Classes — Enums — Implements
Glossary — Architecture — Articles — Library — Samples
