如何避免事件被一般事件覆盖?
How to avoid an event being overwritten by a general one?
我有一个主应用程序,有以下事件:
ON ESCAPE ANYWHERE
我刚刚在 window 中创建了一个框架,我想在其中添加一个事件:
ON ESCAPE ...
然而,这似乎不起作用,因为主应用程序已经有一个 ON ESCAPE ANYWHERE
。是否有类似 ON ESCAPE OVERWRITES DEFAULT
的东西可以为我的子 window 创建事件?
提前致谢
来自 documentation 注释:
A trigger defined with the ON statement remains in effect until one of
the following occurs:
- Another ON statement defines another trigger (or REVERT) for the same event and widget
- For a non-persistent trigger, the procedure or trigger block in which the ON statement appears terminates
所以我认为您的主应用程序触发器定义在之后您自己的触发器,覆盖它。如果你能足够具体,你应该没问题:
on escape anywhere do:
message 'escaping from anywhere' view-as alert-box.
end.
define frame fr1
cc1 as char
cc2 as char
with side-labels
.
do with frame fr1:
enable all.
on escape of cc1 do:
message "escaping from cc1 in frame 1" view-as alert-box.
end.
end.
view frame fr1.
wait-for close of frame fr1.
我有一个主应用程序,有以下事件:
ON ESCAPE ANYWHERE
我刚刚在 window 中创建了一个框架,我想在其中添加一个事件:
ON ESCAPE ...
然而,这似乎不起作用,因为主应用程序已经有一个 ON ESCAPE ANYWHERE
。是否有类似 ON ESCAPE OVERWRITES DEFAULT
的东西可以为我的子 window 创建事件?
提前致谢
来自 documentation 注释:
A trigger defined with the ON statement remains in effect until one of the following occurs:
- Another ON statement defines another trigger (or REVERT) for the same event and widget
- For a non-persistent trigger, the procedure or trigger block in which the ON statement appears terminates
所以我认为您的主应用程序触发器定义在之后您自己的触发器,覆盖它。如果你能足够具体,你应该没问题:
on escape anywhere do:
message 'escaping from anywhere' view-as alert-box.
end.
define frame fr1
cc1 as char
cc2 as char
with side-labels
.
do with frame fr1:
enable all.
on escape of cc1 do:
message "escaping from cc1 in frame 1" view-as alert-box.
end.
end.
view frame fr1.
wait-for close of frame fr1.