Chapter 6 Events Package
Introduction to SFL Events
Windows applications and components generate and handle numerous events. Because C++ is an object-oriented language, you should treat events as objects within an application or component. The Events package provides an object-oriented event model similar to the Java event model. Events are treated as instances of C++ classes so you can invent new types of events through sub-classing. Objects interested in receiving event notifications are called event listeners. Event listeners can subscribe to event routers, which are objects that either generate or route events through the system. A publisher-subscriber relationship exists between event routers and event listeners. This object-oriented approach to event handling is flexible and is ideal for handling Windows messages, as well as custom events, in C++ applications and components.