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

对象被编辑完成后,会调用该事件,需要设置ObjectModifyEvent属性为Y,才会启用该事件

IDL
static void objectModifyed(LONG lId, LONG lErase);
参数 
说明 
LONG lId 
对象的id 
LONG lErase 
对象是否被删除,1为删除。 

例如: VB

    If sEventName = "objectModifyed" Then
        Dim param3 As MxDrawXLib.MxDrawResbuf
        ' 得到事件参数
        Set param3 = MxDrawX1.CustomEventParam

        Dim lId3 As Long
        ' 得到编辑的对象id
        lId3 = param3.AtLong(0)

        Dim lErase As Long
        lErase = param3.AtLong(1)


        Dim database As MxDrawDatabase

        Set database = MxDrawX1.GetDatabase()

        Dim obj As MxDrawMcDbObject


        Set obj = database.ObjectIdToObject(lId3)

        If lErase = 0 Then

            MsgBox "编辑了" + obj.ObjectName
        Else
             MsgBox "删除了" + obj.ObjectName
        End If

    End If

 

例如: JS

            function DoCustomEventEventFun(sEventName) {

                    if (sEventName == "objectModifyed") {
                         var param3 = mxOcx.CustomEventParam();

                         // 得到编辑的对象id
                        var lId = param3.AtLong(0);
                        var lErase = param3.AtLong(1);
                        // var obj = database.ObjectIdToObject(lId)

                        if(lErase == 1)
                        {
                            alert("对象被删除了");
                        }
 

                    }
    
                }

            document.getElementById("MxDrawXCtrl").ImplementCustomEvent = DoCustomEventEventFun;

            《param name="Iniset" value="ObjectModifyEvent=Y"》
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!