Class ContextualMenuPopulateEvent
The event sent when a contextual menu requires menu items.
Inheritance
ContextualMenuPopulateEvent
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class ContextualMenuPopulateEvent : MouseEventBase<ContextualMenuPopulateEvent>, IMouseEvent, IMouseEventInternal
Constructors
ContextualMenuPopulateEvent()
Constructor.
Declaration
public ContextualMenuPopulateEvent()
Properties
menu
The menu to populate.
Declaration
public DropdownMenu menu { get; }
Property Value
Type | Description |
---|---|
DropdownMenu |
triggerEvent
The event that triggered the ContextualMenuPopulateEvent.
Declaration
public EventBase triggerEvent { get; }
Property Value
Type | Description |
---|---|
EventBase |
Methods
GetPooled(EventBase, DropdownMenu, IEventHandler, ContextualMenuManager)
Gets an event from the event pool and initializes it with the given values. Use this function instead of creating new events. Events obtained using this method need to be released back to the pool. You can use Dispose()
to release them.
Declaration
public static ContextualMenuPopulateEvent GetPooled(EventBase triggerEvent, DropdownMenu menu, IEventHandler target, ContextualMenuManager menuManager)
Parameters
Type | Name | Description |
---|---|---|
EventBase | triggerEvent | The event that triggered the display of the contextual menu. |
DropdownMenu | menu | The menu to populate. |
IEventHandler | target | The element that triggered the display of the contextual menu. |
ContextualMenuManager | menuManager | The menu manager that displays the menu. |
Returns
Type | Description |
---|---|
ContextualMenuPopulateEvent | An initialized event. |
Init()
Resets the event members to their initial values.
Declaration
protected override void Init()
Overrides
UnityEngine.UIElements.MouseEventBase<UnityEngine.UIElements.ContextualMenuPopulateEvent>.Init()
PostDispatch(IPanel)
Declaration
protected override void PostDispatch(IPanel panel)
Parameters
Type | Name | Description |
---|---|---|
IPanel | panel |
Overrides
UnityEngine.UIElements.MouseEventBase<UnityEngine.UIElements.ContextualMenuPopulateEvent>.PostDispatch(UnityEngine.UIElements.IPanel)