Application.ShowPopupMenu

number Application.ShowPopupMenu (

number  X,

number  Y,

table   Menu,

number  HAlign = TPM_LEFTALIGN,

number  VAlign = TPM_TOPALIGN,

boolean WaitForReturn = true,

boolean ClientCoordinates = true )

Example 1

if(e_Type == RIGHT_BUTTON_DOWN)then
  tblMenu = {};
  tblMenu[1] ={};
  tblMenu[1].Text = "&New Menu";
  tblMenu[1].ID = 100;
  tblMenu[1].IconID = 0;
  tblMenu[1].Checked = false;
  tblMenu[1].Enabled = true;
  tblMenu[1].SubMenu = {};
  tblMenu[1].SubMenu[1] = {};
  tblMenu[1].SubMenu[1].Text = "&SubItem 1";
  tblMenu[1].SubMenu[1].ID = 101;
  tblMenu[1].SubMenu[1].IconID = 1;
  tblMenu[1].SubMenu[1].Checked = false;
  tblMenu[1].SubMenu[1].Enabled = true;
  tblMenu[1].SubMenu[2] = {};
  tblMenu[1].SubMenu[2].Text = "S&ubItem 2";
  tblMenu[1].SubMenu[2].ID = 102;
  tblMenu[1].SubMenu[2].Checked = false;
  tblMenu[1].SubMenu[2].Enabled = true;
  
  nRes = Application.ShowPopupMenu(e_X, e_Y, tblMenu, TPM_LEFTALIGN, TPM_TOPALIGN, true, true);

  if(nRes == 0)then
      Dialog.Message("Menu Result","Cancelled");
  else
      Dialog.Message("Menu Result","Menu ID selected = "..nRes);
  end
end

Dynamically creates a popup menu and displays it when the user right-clicks anywhere on the application's page surface.

See also:  Related Actions