result = Application.ShowPopupMenu(0, 0, tbMenuData, TPM_LEFTALIGN, TPM_TOPALIGN, true, true); 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 |