在网页中如何右键弹出菜单?
MxDraw网页开发|黄洪辉|2018-05-29 16:19
-
回答:
function MouseEvent(dX, dY, lType) { if(lType == 3) { // 鼠标右键按下 var filter = mxOcx.NewResbuf(); // 5020 = RTDXF0,只选择直线实体,设置过滤条件 //filter.AddStringEx("LINE",5020); var ent = mxOcx.FindEntAtPoint(dX, dY, filter); var sPopMenu; if(ent != null) { mxOcx.ClearCurrentSelect(); mxOcx.AddCurrentSelect(ent.ObjectID,true,true); sPopMenu = mxOcx.GetOcxAppPath() + "\\MxPopMenuEnt.mnu" } else { sPopMenu = mxOcx.GetOcxAppPath() + "\\MxPopMenu.mnu" } mxOcx.TrackPopupMenu(dX, dY, sPopMenu); // 设置1,表示鼠标事件,不再往下传递. mxOcx.SetEventRet(1); } }