怎么获得FormList鼠标选中的是哪一项?
如图,我怎么知道鼠标点的是哪一项?我要获取项数,就是选中的是第几个,然后根据这个项数进行相应操作
本帖最后由 leilei4908 于 2015-9-8 17:17 编辑
@vivienluo @XYX365 我记得选中List的时候,formID->curValue会返回选中条目的index。 formID->curValue获取到的是LIST中所选中的行的值,是没办法返回INDEX的。不知道你要进行什么操作? 本帖最后由 leilei4908 于 2015-9-9 17:56 编辑
vivienluo 发表于 2015-9-8 18:25
formID->curValue获取到的是LIST中所选中的行的值,是没办法返回INDEX的。不知道你要进行什么操作?
关于这个,我已经解决了
viadbid = outfile("ViaDbid.log")
fprintf(viadbid "%L" wrongvias)
close(viadbid)
)
procedure( dpcFormAction(dpcForm)
p = infile("ViaDbid.log")
gets(wrongvias p)
close(p)
case( dpcForm->curField
("WrongList"
if(dpcForm->curValue then
curValue = dpcForm->curValue
print(curValue)
num = length(wrongDP) - length(member(curValue wrongDP)) + 1
axlZoomToDbid(nthelem(num wrongvias) t)
)
)
)
)
但是还有个问题,dbid参数怎么传递?在打开dpcForm之后,dbid都removed,我现在的方法是
viadbid = outfile("ViaDbid.log")
fprintf(viadbid "%L" wrongvias)
然后
p = infile("ViaDbid.log")
gets(wrongvias p)
close(p)
但是这样的话,首尾会自动加上",list转变成了string,导致后面不能识别
罗老师有什么好的建议么?
我现在把dbid换成xy了,现在可以通过axlShell(sprintf(nil "zoom center %n %n" viaX viaY))指向对应的vias了
本来被axlZoomToDbid限定死了。。。
页:
[1]