如何将应用程序窗口子类化?
你已经看到了另一个类层次的实例,它很好的阐明了子类化的概念。
You've actually seen one instance of another class hierarchy that also serves as a good illustration of the idea of extension by subclassing.
更干净的Web过滤机制,无需子类化就可支持更多的插件式过滤器。
Cleaner Web filter mechanism that allows more pluggable filtering support without subclassing.
我只需要子类化出来一个超文本对象,然后加上互联网相关代码就行了。
I just had to subclass it to make a hypertext object, and add the Internet code.
这样的代码编写起来很无趣,很容易被意外省略,也无法阻止攻击者子类化该方法。
This kind of coding is tiresome to write, is easy to omit by accident, and does not stop an attacker from subclassing the method.
子类化函数然后把该消息传递给原始窗口过程。
The subclass function then passes the message to the original window procedure.
使用该方法动态子类化时对话框必须先被至少描绘一次。
Note that for subclassing to occur, the dialog box must be painted at least once.
这是一个子类化公共对话框控件的类,因此你可定制它。
This is a class that subclasses the common dialog control, thereby allowing you to customize it.
在这一课中,我们将学习什么是窗口子类化,以及如何使用它才能对你有利。
In this tutorial, we will learn about window subclassing, what it is and how to use it to your advantage.
Swing适配器允许您子类化适配器,并且可以仅重写处理事件所需的方法。
The Swing adaptors allow you to subclass the adaptor and just override the methods you need to handle for the event.
事实上,我的示例使Monitor子类化,以提供某些(稍微)增强的能力。
In fact, my example subclasses Monitor to provide some (slight) enhanced capabilities.
在构造函数内部开始一个新线程也是危险的,特别是这个类可能被子类化时。
It can also be risky to start new threads inside a constructor, especially in a class that may be subclassed.
随着微软Win32API的到来,进程间子类化不再被鼓励使用并愈发变得困难起来。
With the advent of the Microsoft Win32 API, interprocess subclassing was discouraged and made a bit harder to code.
如果可以重写类的话,则可以重写它的方法的行为,因此您最安全的选择就是不允许将类子类化。
If the class can be overridden, its methods' behaviors can be overridden as well, so your safest bet is to disallow subclassing.
为了做到这一点,JFace提供可使用的对象,或提供可将其子类化的类(有时它两者都提供)。
To do this, JFace either provides an object that you use or a class you can subclass — and sometimes it provides both.
现在我们把注意力放在如何子类化一个窗口上。注意,子类化并不是仅限制于控件,它能被用于任何窗口。
Now we put our attention on how to subclass a window. Note that subclassing is not limited to controls, it can be used with any window.
Class的抽象可由子类化和一种灵活的基于mixin的组合机制(它可作为多重继承的简单替代方案)来扩展。
Class abstractions are extended by subclassing and a flexible mixin-based composition mechanism as a clean replacement for multiple inheritance.
也可以覆盖一个Dojo小部件方法、针对特定行为子类化一个现有的Dojo小部件或创建您自己的小部件。
You can also override a Dojo widget method, subclass an existing Dojo widget for special behavior, or create your own widget.
正如上面所提到的,嵌套的语法通常被错误地认为有子类化的关系——尤其是对那些还不熟悉扩展的用户来说。
As mentioned above, the nested syntax is often mistaken for subclassing by users who are not already familiar with extensions.
尽管我们仅仅直接使用了一个ApplicationWindow,但实际上它们被设计为可以子类化也可以加入特定行为。
Although we just used an ApplicationWindow directly, they are actually designed for you to subclass and fill in your specific behavior.
注意,这是一个正在运行的示例,与子类化相对,它涉及如何通过聚合对象—将BrowserExtension添加到ReadOnlyPart—来扩展功能。
Note that this is a working example of how to extend the functionality by aggregating objects — adding a BrowserExtension to a ReadOnlyPart — as opposed to subclassing.
注意,这是一个正在运行的示例,与子类化相对,它涉及如何通过聚合对象—将BrowserExtension添加到ReadOnlyPart—来扩展功能。
Note that this is a working example of how to extend the functionality by aggregating objects — adding a BrowserExtension to a ReadOnlyPart — as opposed to subclassing.
应用推荐