Control.ContextMenu

Syntax

ContextMenu: PP.Ui.Menu;

Description

The ContextMenu property sets the context menu for component.

Example

To execute the example, connect the PP.js library and the table of the PP.css visual styles. Seebelow the Javascript code which is used to locate a button on the HTML page.

<script type="text/javascript">

var CMenu = new PP.Ui.Menu();//Create a menu of two items

      CMenu.addItem(Open);

      CMenu.addItem(Close);

var b1 = new PP.Ui.Button({//Create an instance of the Button class

      ParentNode: document.getElementById("b1"),

      Content: Select,

      ContextMenu: CMenu })//Sets the context menu for the button

</script>

After executing the example the button with the Select inscription is located on the HTML page. When pressing the button with the right mouse button the context menu that has the following view is invoked:

See also:

Control