[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Menus' (#lcl)

# TPopupMenu.PopUp

Displays the pop-up menu.

## Declaration

Source position: menus.pp line 484

`public procedure TPopupMenu.PopUp; procedure TPopupMenu.PopUp(`
`X: Integer;`
`Y: Integer`
`); virtual;`

## Arguments

`X` |  | Horizontal coordinate where the pop-up menu is displayed.
`Y` |  | Vertical coordinate where the pop-up menu is displayed.

## Description

PopUp is an overloaded method used to display the pop-up menu. An overloaded variant is provided which includes X and Y coordinates where the pop-up menu is displayed. The parameter-less variant calls the overloaded variant using the current position for the mouse pointer in the X and Y arguments.

No actions are performed in the method if a pop-up menu has already been assigned to the ActivePopupMenu variable.

PopUp updates the PopupPoint property with the coordinates specified in X and Y and releases the current mouse capture in the widgetset. DoPopUp is called to signal the OnPopup event handler (when assigned).

No additional actions are performed in the method if menu items have not been defined in the Items property.

PopUp sets the value in ActivePopupMenu to the current class instance. The InitiateActions method is called for the menu Items to ensure that the ActionLink for the component is updated. The handles for the menu and its sub-items are recreated, and the OnMenuPopupHandler event handler is signalled (when assigned).

PopUpMenu calls the corresponding method in the widgetset class prior to exiting from the method.

## Version info

Modified in LCL version 4.0 to use the protected SetPopupPoint method to update the location for the pop-up menu.

## See also

TPopUpMenu.DoPopUp |  | Performs actions needed to display the pop-up menu.
TPopUpMenu.OnPopup |  | Event handler signalled to display the pop-up menu.
TPopUpMenu.PopupPoint |  | TPoint instance with the coordinates where the pop-up menu is displayed.
TPopUpMenu.SetPopupPoint |  | Sets the value for the PopupPoint property.
TMenu.Items |  | Contains the menu items displayed on the menu.
TMenuItem.InitiateActions |  | Updates Actions in child menu items.
TMenuItem.ActionLink |  | Contains the link to the Action for the menu item.
OnMenuPopupHandler |  | Unit global variable with the event handler signalled when a pop-up menu is displayed.