我平时用的是PFC,位置不对是因为取的是上层的dragobject 的相对位置,以下代码是根据PFC代码改写的应该可以,你再试一下
window lw_parent
powerobject lpo_parent
lpo_parent = this.GetParent()
// Loop getting the parent of the object until it is of type window!
do while IsValid (lpo_parent)
if lpo_parent.TypeOf() <> window! then
lpo_parent = lpo_parent.GetParent()
else
exit
end if
loop
if IsNull(lpo_parent) or not IsValid (lpo_parent) then
lm_rbutton.m_rbutton.PopMenu(PointerX(),PointerY())
return
end if
if isvlid(this.GetParent()) then
lm_rbutton.m_rbutton.PopMenu(this.GetParent().x + PointerX(),this.GetParent().y + PointerY())
else
lm_rbutton.m_rbutton.PopMenu(PointerX(),PointerY())
end if
有点错误,改一下
dragobject ldo_object
ldo_object=this.GetParent()
if isvlid(ldo_object) then
lm_rbutton.m_rbutton.PopMenu(ldo_object.x + PointerX(),ldo_object.y + PointerY())
else
lm_rbutton.m_rbutton.PopMenu(PointerX(),PointerY())
end if
有点错误,改一下
dragobject ldo_object
ldo_object=this.GetParent()
if isvlid(ldo_object) then
lm_rbutton.m_rbutton.PopMenu(ldo_object.x + PointerX(),ldo_objecty + PointerY())
else
lm_rbutton.m_rbutton.PopMenu(PointerX(),PointerY())
end if
to tuliplangel(酷儿) :PopMenu(this.GetParent().x + PointerX(),this.GetParent().y + PointerY()) 这里提示出错,incompatible property x for type powerobject,怎么回事呢 ?谢谢