www.mxdraw.com
内容索引主面
前一个向上下一个
_DMxDrawXEvents::CustomEntity_moveGripPointsAt 方法

移动自定义实体夹点

IDL
[id(10)]
void CustomEntity_moveGripPointsAt(IDispatch* pCustomEntity, LONG lGridIndex, DOUBLE dOffsetX, DOUBLE dOffsetY, LONG* pRet);
参数 
说明 
IDispatch* pCustomEntity 
IMxDrawCustomEntity对象 
LONG lGridIndex 
夹点索引 
DOUBLE dOffsetX 
夹点X方向偏移 
DOUBLE dOffsetY 
夹点Y方向偏移 
LONG* pRet 
返回值,成功回 1. 

例如: VC COM

                        void CTestVc2005Dlg::CustomEntity_moveGripPointsAtMxdrawxctrl1(LPDISPATCH pCustomEntity, long lGridIndex, double dOffsetX, double dOffsetY, long* pRet)
                        {
                            // TODO: 在此处添加消息处理程序代码
                            *pRet = 1;
                            IMxDrawCustomEntityPtr spDrawData;
                            pCustomEntity->QueryInterface(&spDrawData);

                            CString sGuid = spDrawData->Guid;
                            if(sGuid == MX_CUSTOM_ENTITY_ID)
                            {
                                if(spDrawData->IsHave(_T("ept") )  != VARIANT_TRUE)
                                    return;

                                IMxDrawPointPtr stp =  spDrawData->GetPoint(_T("spt"));
                                if(stp == NULL)
                                    return;

                                IMxDrawPointPtr ept =  spDrawData->GetPoint(_T("ept"));
                                if(ept == NULL)
                                    return;



                                if(lGridIndex == 0)
                                {
                                    stp->put_x(stp->x + dOffsetX);
                                    stp->put_y(stp->y + dOffsetY);
                                    spDrawData->SetPoint(_T("spt"),stp);
                                }
                                else
                                {
                                    ept->put_x(ept->x + dOffsetX);
                                    ept->put_y(ept->y + dOffsetY);
                                    spDrawData->SetPoint(_T("ept"),ept);
                                }
                            }
                        }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!