Every event type has an associated EventID singleton instance. In all cases, the handling of this instance is done automatically for you by making your event class derive from ObserverableEventType (there is no choice, this is enforced by the access restrictions of ObservableEvent). The only other thing you then need to do is to use the DECLARE_WORKSPACE_EVENT_INSTANCE and DEFINE_WORKSPACE_EVENT_INSTANCE macros for your event, with the DECLARE_... macro typically appearing at the bottom of your event class' header file and the DEFINE_... macro at the top of the file that contains your plugin's setup() function.
For a detailed example of how to define your own event, see the ProgressEvent class.
- See also
- ObservableEvent, ObservableEventType, ObserverSet