Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Stingray Foundation Library User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

6.6 Custom Event Types

The term "custom event types" is a misnomer. The Events package makes no distinction between its own event types and other derived event types. In fact, events do not even need to correspond to Windows messages. The first step in creating your own event type is to derive a class from the base IEvent interface. If you are implementing a Windows message, then derive the class from IWinEvent. The class can be either a pure virtual class (for example, an interface) or a concrete class. Next, derive an event listener interface from the IEventListener base interface and add your callback functions to it. Implement the Dispatch() function in your concrete event class by querying for the event listener interface and then invoking the appropriate callback function.

If you are implementing a Windows message (for example, WM_XXX) as an event class, the mouse event and mouse listener classes in the Events package are a good model to follow. If your custom event is not a Windows message, then do not derive your event from IWinEvent.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.