禁用右键单击wx.iehtmlWindow [英] Disabling right click over wx.iehtmlWindow

查看:69
本文介绍了禁用右键单击wx.iehtmlWindow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Python Card创建的窗口,其中包含一个wx.iehtmlWindow对象。有谁知道如何禁用右键单击和/或导致在新窗口中打开的链接在同一窗口中打开?


我正在运行Windows XP Home。


我正在运行ActiveState Python 2.4。


我尝试的任何东西都没有做任何事情,因为我无法从wx.iehtmlWindow获取事件过滤它们以获得正确的点击。

I have a window that I have created using Python Card that contains an wx.iehtmlWindow opject inside of it. Does anyone know how to disable right click and/or cause links that would open in new windows to open in the same window?

I am running Windows XP Home.

I am running ActiveState Python 2.4.

Anything that I have tried has done absolutely nothing, because I can''t get the events from the wx.iehtmlWindow to filter them for right clicks.

推荐答案


我有一个使用Python Card创建的窗口,其中包含一个wx.iehtmlWindow在其中对话。有谁知道如何禁用右键单击和/或导致在新窗口中打开的链接在同一窗口中打开?


我正在运行Windows XP Home。


我正在运行ActiveState Python 2.4。


我尝试的任何东西都没有做任何事情,因为我无法从wx.iehtmlWindow获取事件过滤它们以获得正确的点击。
I have a window that I have created using Python Card that contains an wx.iehtmlWindow opject inside of it. Does anyone know how to disable right click and/or cause links that would open in new windows to open in the same window?

I am running Windows XP Home.

I am running ActiveState Python 2.4.

Anything that I have tried has done absolutely nothing, because I can''t get the events from the wx.iehtmlWindow to filter them for right clicks.



这应该是一种坚持的想法。为了阻止事件,在层次结构中绑定非常高并且不要调用event.Skip()。您可以在希望事件传播时测试条件,然后调用event.Skip()

This should be the kind of idea to persue. In order to block an event, bind very high in the hierachy and don''t call event.Skip(). You can test for conditions when you DO want the event to propagate and then call event.Skip()

展开 | 选择 | Wrap | 行号


我想我的代码会有所不同,因为我使用的是PythonCard,而不是BoaConstructor。我的所有子对象(窗口除外)都是使用资源文件创建的,并存储在self.components中。


我的课可能看起来更像:
I suppose that my code will be a little different, seeing as I am using PythonCard, not BoaConstructor. All my child objects (except windows) are created using a resource file, and are stored in self.components.

My class would probably look more like:

展开 | 选择 | Wrap | 行号


现在我已经测试了它,它不起作用。没有例外或任何事情。我用wx.EVT_RIGHT_DOWN切换了wx.EVT_LEFT_DOWN,并将我绑定的函数打印为blah。我没有得到任何blah的打印,上下文菜单仍然在wx.iehtmlWindow中工作。我的猜测是wx.iehtmlWindow正在捕获事件(因为它是IE的activex控件),并且在评估它们之前没有通过我的程序放置事件。有什么想法?
Now that I''ve tested it, it doesn''t work. There are no exceptions or anything. I switched the wx.EVT_LEFT_DOWN with wx.EVT_RIGHT_DOWN, and had the function that I bound print "blah". I didn''t get any "blah"''s printed, and the context menu still worked in wx.iehtmlWindow. My guess is that wx.iehtmlWindow is catching the events (since it is an activex control of IE), and not putting the events through my program before evaluating them. Any ideas?


这篇关于禁用右键单击wx.iehtmlWindow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆