|
www.mxdraw.com
|
移动自定义实体夹点事件回调函数指针
[id(245) , helpstring("property ImpMoveGripPointsAtFun"), hidden, nonbrowsable]
IDispatch* ImpMoveGripPointsAtFun;例如: JS
function MoveGripPointsFun(pCustomEntity, lGridIndex, dOffsetX, dOffsetY) {
var sGuid = pCustomEntity.Guid;
if (sGuid == "TestMxCustomEntity") {
if (!pCustomEntity.IsHave("ept"))
return;
var stp = pCustomEntity.GetPoint("spt");
if (stp == null)
return;
var ept = pCustomEntity.GetPoint("ept");
if (ept == null)
return;
if (lGridIndex == 0) {
stp.x = stp.x + dOffsetX;
stp.y = stp.y + dOffsetY;
pCustomEntity.SetPoint("spt", stp);
}
else {
ept.x = ept.x + dOffsetX;
ept.y = ept.y + dOffsetY;
pCustomEntity.SetPoint("ept", ept);
}
mxOcx.SetEventRet(1);
}
}