PopupMenu: IPopupMenu;
The PopupMenu property determines context menu in the drop-down list of the MetaAttributesBreadcrumb component.
As a context menu, use the PopupMenu development environment component.
Executing the example requires that the repository contains:
A form containing the components:
MetaAttributesBreadcrumb with the mab identifier.
PopupMenu with the pm identifier. Add manually menu elements for this component.
A time series database with the FC identifier.
Add a link to the Metabase system assembly.
// Form open event
Sub POPUPMENUFormOnShow(Sender: Object; Args: IEventArgs);
Begin
mab.Rubricator := MetabaseClass.Active.ItemById("FC").Open(Null) As IRubricatorInstance;
mab.ApplyDefaultAttributesOrder;
End Sub POPUPMENUFormOnShow;
// Event on opening context menu in the drop-down list of the component
Sub mabOnDimTreePopup(Sender: Object; Args: IMetaAttributesBreadcrumbDimTreePopupEventArgs);
Begin
Args.PopupMenu := pm;
Debug.WriteLine("Dictionary key - " + Args.DimSelection.Dimension.Key.ToString);
End Sub mabOnDimTreePopup;
After executing the example in the MetaAttributesBreadcrumb component in the drop-down list on the right mouse button click:
The specified custom context menu is displayed.
The console window displays dictionary key.
See also: