请教:关于事件调用。

jky 2004-03-21 10:43:26
我写了一个窗口函数,其中有一个参数是datawindow类型,而我要调用的这个数据窗口类型参数是从一个userobject中继承过来的,现在我想在此窗口函数中调用该数据窗口的父类(即userobject)的一个函数(带参数),不知道怎么写,谢谢!
...全文
78 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
mittee 2004-03-21
  • 打赏
  • 举报
回复
直接调用
jky 2004-03-21
  • 打赏
  • 举报
回复
如果是用户对象该怎么办呢?
thelazyman 2004-03-21
  • 打赏
  • 举报
回复
这样:
w_ancestor::EVENT ue_process( )
其中w_ancestor是祖先窗口,ue_process是祖先窗口的一个函数
jky 2004-03-21
  • 打赏
  • 举报
回复
而且我调用的地方是要写在窗口函数里面的。
jky 2004-03-21
  • 打赏
  • 举报
回复
如果父类是一个用户对象的话也可以这样调用吗?
dotnba 2004-03-21
  • 打赏
  • 举报
回复
Example 1 Suppose a window w_ancestor has an event ue_process. A descendent window has a script for the same event.
This statement in a script in the descendant searches the event chain and calls all appropriate events. If the descendant extends the ancestor script, it calls a script for each ancestor in turn followed by the descendent script. If the descendant overrides the ancestor, it calls the descendent script only:

EVENT ue_process( )

This statement calls the ancestor event only (this script works if the calling script belongs to another object or the descendent window):

w_ancestor::EVENT ue_process( )

Example 2 You can use the pronoun Super to refer to the ancestor. This statement in a descendent window script or in a script for a control on that window calls the Clicked script in the immediate ancestor of that window.

Super::EVENT Clicked(0, x, y)

Example 3 These statements call a function wf_myfunc in the ancestor window (presumably, the descendant also has a function called wf_myfunc):

Super::wf_myfunc( )

Super::POST wf_myfunc( )

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧