-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
-
-BEGIN_DECLARE_EVENT_TYPES()
-
-#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEVT_NULL = 0,
- wxEVT_FIRST = 10000,
- wxEVT_USER_FIRST = wxEVT_FIRST + 2000,
-#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- // it is important to still have these as constants to avoid
- // initialization order related problems
- DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_NULL, 0)
- DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_FIRST, 10000)
- DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_USER_FIRST, wxEVT_FIRST + 2000)
-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
-
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED, 1)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHECKBOX_CLICKED, 2)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED, 3)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED, 4)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 5)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 6)
- // now they are in wx/textctrl.h
-#if WXWIN_COMPATIBILITY_EVENT_TYPES
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN, 14)
-#endif // WXWIN_COMPATIBILITY_EVENT_TYPES
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED, 9)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED, 10)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED, 11)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_RADIOBUTTON_SELECTED, 12)
-
- // wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use
- // wxEVT_SCROLL... events
-
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_SCROLLBAR_UPDATED, 13)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_VLBOX_SELECTED, 14)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_COMBOBOX_SELECTED, 15)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOOL_RCLICKED, 16)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOOL_ENTER, 17)
- DECLARE_EVENT_TYPE(wxEVT_COMMAND_SPINCTRL_UPDATED, 18)
-
- // Sockets and timers send events, too
- DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_SOCKET, 50)
- DECLARE_EVENT_TYPE(wxEVT_TIMER , 80)
-
- // Mouse event types
- DECLARE_EVENT_TYPE(wxEVT_LEFT_DOWN, 100)
- DECLARE_EVENT_TYPE(wxEVT_LEFT_UP, 101)
- DECLARE_EVENT_TYPE(wxEVT_MIDDLE_DOWN, 102)
- DECLARE_EVENT_TYPE(wxEVT_MIDDLE_UP, 103)
- DECLARE_EVENT_TYPE(wxEVT_RIGHT_DOWN, 104)
- DECLARE_EVENT_TYPE(wxEVT_RIGHT_UP, 105)
- DECLARE_EVENT_TYPE(wxEVT_MOTION, 106)
- DECLARE_EVENT_TYPE(wxEVT_ENTER_WINDOW, 107)
- DECLARE_EVENT_TYPE(wxEVT_LEAVE_WINDOW, 108)
- DECLARE_EVENT_TYPE(wxEVT_LEFT_DCLICK, 109)
- DECLARE_EVENT_TYPE(wxEVT_MIDDLE_DCLICK, 110)
- DECLARE_EVENT_TYPE(wxEVT_RIGHT_DCLICK, 111)
- DECLARE_EVENT_TYPE(wxEVT_SET_FOCUS, 112)
- DECLARE_EVENT_TYPE(wxEVT_KILL_FOCUS, 113)
- DECLARE_EVENT_TYPE(wxEVT_CHILD_FOCUS, 114)
- DECLARE_EVENT_TYPE(wxEVT_MOUSEWHEEL, 115)
-
- // Non-client mouse events
- DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_DOWN, 200)
- DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_UP, 201)
- DECLARE_EVENT_TYPE(wxEVT_NC_MIDDLE_DOWN, 202)
- DECLARE_EVENT_TYPE(wxEVT_NC_MIDDLE_UP, 203)
- DECLARE_EVENT_TYPE(wxEVT_NC_RIGHT_DOWN, 204)
- DECLARE_EVENT_TYPE(wxEVT_NC_RIGHT_UP, 205)
- DECLARE_EVENT_TYPE(wxEVT_NC_MOTION, 206)
- DECLARE_EVENT_TYPE(wxEVT_NC_ENTER_WINDOW, 207)
- DECLARE_EVENT_TYPE(wxEVT_NC_LEAVE_WINDOW, 208)
- DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_DCLICK, 209)
- DECLARE_EVENT_TYPE(wxEVT_NC_MIDDLE_DCLICK, 210)
- DECLARE_EVENT_TYPE(wxEVT_NC_RIGHT_DCLICK, 211)
-
- // Character input event type
- DECLARE_EVENT_TYPE(wxEVT_CHAR, 212)
- DECLARE_EVENT_TYPE(wxEVT_CHAR_HOOK, 213)
- DECLARE_EVENT_TYPE(wxEVT_NAVIGATION_KEY, 214)
- DECLARE_EVENT_TYPE(wxEVT_KEY_DOWN, 215)
- DECLARE_EVENT_TYPE(wxEVT_KEY_UP, 216)
+// New macros to create templatized event types:
+
+#if wxEVENTS_COMPATIBILITY_2_8
+
+ // Define/Declare a wxEventType-based event type:
+
+ #define wxDEFINE_EVENT( name, type ) \
+ const wxEventType name( wxNewEventType() )
+
+ #define wxDECLARE_EXPORTED_EVENT( expdecl, name, type ) \
+ extern const expdecl wxEventType name
+
+ // Define/Declare a wxEventType-based event type and initialize it with a
+ // predefined event type. (Only used for wxEVT_SPIN_XXX for backward
+ // compatibility)
+
+ #define wxDEFINE_EVENT_ALIAS( name, type, value ) \
+ const wxEventType name = value
+
+ #define wxDECLARE_EXPORTED_EVENT_ALIAS( expdecl, name, type ) \
+ extern const expdecl wxEventType name
+
+ // Declare a local (not exported) wxEventType-based event type:
+
+ #define wxDECLARE_EVENT( name, type ) \
+ wxDECLARE_EXPORTED_EVENT( wxEMPTY_PARAMETER_VALUE, name, type );
+
+ // Try to cast the given event handler to the correct handler type:
+
+ #define wxEVENT_HANDLER_CAST( functype, func ) \
+ ( wxObjectEventFunction )( wxEventFunction )wxStaticCastEvent( functype, &func )
+#else
+ // Define/Declare a templatized event type with the corresponding event as
+ // a nested typedef:
+
+ #define wxDEFINE_EVENT( name, type ) \
+ const wxEventTypeTag< type > name( wxNewEventType() )
+
+ #define wxDECLARE_EXPORTED_EVENT( expdecl, name, type ) \
+ extern const expdecl wxEventTypeTag< type > name
+
+ // Define/Declare a templatized event type and initialize it with a
+ // predefined event type. (Only used for wxEVT_SPIN_XXX for backward
+ // compatibility)
+
+ #define wxDEFINE_EVENT_ALIAS( name, type, value ) \
+ const wxEventTypeTag< type > name( value )
+
+ #define wxDECLARE_EXPORTED_EVENT_ALIAS( expdecl, name, type ) \
+ extern const expdecl wxEventTypeTag< type > name
+
+ // Declare a local (not exported) templatized event type:
+
+ #define wxDECLARE_EVENT( name, type ) \
+ wxDECLARE_EXPORTED_EVENT( wxEMPTY_PARAMETER_VALUE, name, type );
+
+ // Don't cast the given event handler so that wxEvtHandler::Connect() sees
+ // the actual type:
+
+ #define wxEVENT_HANDLER_CAST( functype, func ) \
+ ( &func )
+#endif
+
+// Template which associates the correct event object with the event type
+
+#if !wxEVENTS_COMPATIBILITY_2_8
+
+// The tag is a type associated to the event type (which is an integer itself,
+// in spite of its name) value. It exists in order to be used as a template
+// parameter and provide a mapping between the event type values and their
+// corresponding wxEvent-derived classes.
+template <typename T>
+class wxEventTypeTag
+{
+public:
+ // The class of wxEvent-derived class carried by the events of this type.
+ typedef T EventClass;
+
+ wxEventTypeTag(wxEventType type) { m_type = type; }
+
+ // Return a wxEventType reference for the initialization of the static
+ // event tables. See wxEventTableEntry::m_eventType for a more thorough
+ // explanation.
+ operator const wxEventType&() const { return m_type; }
+
+private:
+ wxEventType m_type;
+};
+
+#endif // !wxEVENTS_COMPATIBILITY_2_8
+
+// These are needed for the functor definitions
+typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
+
+// We had some trouble (specifically with eVC for ARM WinCE build) with using
+// wxEventFunction in the past so we had introduced wxObjectEventFunction which
+// used to be a typedef for a member of wxObject and not wxEvtHandler to work
+// around this but as eVC is not really supported any longer we now only keep
+// this for backwards compatibility and, despite its name, this is a typedef
+// for wxEvtHandler member now -- but if we have the same problem with another
+// compiler we can restore its old definition for it.
+typedef wxEventFunction wxObjectEventFunction;
+
+
+// The event functor which is stored in the static and dynamic event tables:
+class WXDLLIMPEXP_BASE wxEventFunctor
+{
+public:
+ virtual ~wxEventFunctor();
+
+ // Invoke the actual event handler:
+ virtual void operator()(wxEvtHandler *, wxEvent&) = 0;
+
+ // this function tests whether this functor is matched, for the purpose of
+ // finding it in an event table in Disconnect(), by the given func
+ virtual bool Matches(const wxEventFunctor& func) const = 0;
+
+ // these functions are used for functors comparison in Matches()
+ virtual void *GetHandler() const { return GetEvtHandler(); }
+ virtual wxEventFunction GetMethod() const { return NULL; }
+
+ // this one is also used elsewhere in the code and should be overridden to
+ // return non-NULL if we are indeed associated with an wxEvtHandler
+ virtual wxEvtHandler *GetEvtHandler() const { return NULL; }
+};
+
+// A plain method functor: notice that it is used even with the new events as
+// it is reused as a specialization of wxEventFunctorMethod for legacy untyped
+// event types
+class WXDLLIMPEXP_BASE wxObjectEventFunctor : public wxEventFunctor
+{
+public:
+ wxObjectEventFunctor(wxObjectEventFunction method, wxEvtHandler *handler)
+ {
+ m_handler = handler;
+ m_method = method;
+ }
+
+ virtual void operator()(wxEvtHandler *handler, wxEvent& event)
+ {
+ wxEvtHandler * const realHandler = m_handler ? m_handler : handler;
+
+ (realHandler->*m_method)(event);
+ }
+
+ virtual bool Matches(const wxEventFunctor& func) const
+ {
+ void * const handler = func.GetHandler();
+ if ( handler && GetHandler() != handler )
+ return false;
+
+ const wxEventFunction method = GetMethod();
+
+ // FIXME-VC6: amazing but true: replacing "method == NULL" here with
+ // "!method" makes VC6 crash with an ICE in DLL build (only!)
+ return method == NULL || GetMethod() == method;
+ }
+
+ virtual wxEvtHandler *GetEvtHandler() const { return m_handler; }
+ virtual wxEventFunction GetMethod() const { return m_method; }
+
+private:
+ wxEvtHandler *m_handler;
+ wxEventFunction m_method;
+};
+
+#if wxEVENTS_COMPATIBILITY_2_8
+
+// Create a functor for the legacy events: handler can be NULL and its default
+// value is used by the event table macros
+
+inline wxObjectEventFunctor *
+wxNewEventFunctor(const wxEventType& WXUNUSED(evtType),
+ wxObjectEventFunction method,
+ wxEvtHandler *handler = NULL)
+{
+ return new wxObjectEventFunctor(method, handler);
+}
+
+inline wxObjectEventFunctor
+wxMakeEventFunctor(const wxEventType& WXUNUSED(evtType),
+ wxObjectEventFunction method,
+ wxEvtHandler *handler)
+{
+ return wxObjectEventFunctor(method, handler);
+}
+
+#else // !wxEVENTS_COMPATIBILITY_2_8
+
+// functor forwarding the event to anything callable (function, static method,
+// generalized functor...)
+template <typename EventTag, typename Functor>
+class wxEventFunctorFunction : public wxEventFunctor
+{
+public:
+ typedef typename EventTag::EventClass EventArg;
+
+ wxEventFunctorFunction(Functor handler)
+ {
+ m_handler = handler;
+ }
+
+ virtual void operator()(wxEvtHandler *WXUNUSED(handler), wxEvent& event)
+ {
+ m_handler(static_cast<EventArg&>(event));
+ }
+
+ virtual bool Matches(const wxEventFunctor& WXUNUSED(func)) const
+ {
+ // we have no way to compare arbitrary functors so just consider them
+ // to be equal: this means that disconnecting a functor will always
+ // find the last functor connected which in turn implies that it's
+ // probably a bad idea to connect more than one functor if you plan to
+ // disconnect them but this limitation doesn't seem very important in
+ // practice
+ return true;
+ }
+
+private:
+ Functor m_handler;
+};
+
+namespace wxPrivate
+{
+
+// helper template defining nested "type" typedef as the event class
+// corresponding to the given event type
+template <typename T> struct EventClassOf;
+
+// the typed events provide the information about the class of the events they
+// carry themselves:
+template <typename T>
+struct EventClassOf< wxEventTypeTag<T> >
+{
+ typedef typename wxEventTypeTag<T>::EventClass type;
+};
+
+// for the old untyped events we don't have information about the exact event
+// class carried by them
+template <>
+struct EventClassOf<wxEventType>
+{
+ typedef wxEvent type;
+};
+
+
+// helper class defining operations different for method functors using an
+// object of wxEvtHandler-derived class as handler and the others
+template <typename T, typename A, bool> struct HandlerImpl;
+
+// specialization for handlers deriving from wxEvtHandler
+template <typename T, typename A>
+struct HandlerImpl<T, A, true>
+{
+ static bool IsEvtHandler()
+ { return true; }
+ static T *ConvertFromEvtHandler(wxEvtHandler *p)
+ { return static_cast<T *>(p); }
+ static wxEvtHandler *ConvertToEvtHandler(T *p)
+ { return p; }
+ static wxEventFunction ConvertToEvtFunction(void (T::*f)(A&))
+ { return static_cast<wxEventFunction>(
+ reinterpret_cast<void (T::*)(wxEvent&)>(f)); }
+};
+
+// specialization for handlers not deriving from wxEvtHandler
+template <typename T, typename A>
+struct HandlerImpl<T, A, false>
+{
+ static bool IsEvtHandler()
+ { return false; }
+ static T *ConvertFromEvtHandler(wxEvtHandler *)
+ { return NULL; }
+ static wxEvtHandler *ConvertToEvtHandler(T *)
+ { return NULL; }
+ static wxEventFunction ConvertToEvtFunction(void (T::*)(A&))
+ { return NULL; }
+};
+
+} // namespace wxPrivate
+
+// functor forwarding the event to a method of the given object
+//
+// notice that the object class may be different from the class in which the
+// method is defined but it must be convertible to this class
+//
+// also, the type of the handler parameter doesn't need to be exactly the same
+// as EventTag::EventClass but it must be its base class -- this is explicitly
+// allowed to handle different events in the same handler taking wxEvent&, for
+// example
+template
+ <typename EventTag, typename Class, typename EventArg, typename ObjClass>
+class wxEventFunctorMethod
+ : public wxEventFunctor,
+ private wxPrivate::HandlerImpl
+ <
+ Class,
+ EventArg,
+ wxConvertibleTo<Class, wxEvtHandler>::value
+ >
+{
+private:
+ static void CheckHandlerArgument(EventArg *) { }
+
+public:
+ // the event class associated with the given event tag
+ typedef typename wxPrivate::EventClassOf<EventTag>::type EventClass;
+
+
+ wxEventFunctorMethod(void (Class::*method)(EventArg&), ObjClass *handler)
+ {
+ wxASSERT_MSG( handler || this->IsEvtHandler(),
+ "handlers defined in non-wxEvtHandler-derived classes "
+ "must be connected with a valid sink object" );
+
+ // if you get an error here it means that the signature of the handler
+ // you're trying to use is not compatible with (i.e. is not the same as
+ // or a base class of) the real event class used for this event type
+ CheckHandlerArgument(static_cast<EventClass *>(NULL));
+
+ m_handler = handler;
+ m_method = method;
+ }
+
+ virtual void operator()(wxEvtHandler *handler, wxEvent& event)
+ {
+ Class * realHandler = m_handler;
+ if ( !realHandler )
+ {
+ realHandler = this->ConvertFromEvtHandler(handler);
+
+ // this is not supposed to happen but check for it nevertheless
+ wxCHECK_RET( realHandler, "invalid event handler" );
+ }
+
+ // the real (run-time) type of event is EventClass and we checked in
+ // the ctor that EventClass can be converted to EventArg, so this cast
+ // is always valid
+ (realHandler->*m_method)(static_cast<EventArg&>(event));
+ }
+
+ virtual bool Matches(const wxEventFunctor& func) const
+ {
+ void * const handler = func.GetHandler();
+ if ( handler && GetHandler() != handler )
+ return false;
+
+ const wxEventFunction method = GetMethod();
+ return !method || GetMethod() == method;
+ }
+
+ virtual void *GetHandler() const
+ {
+ return m_handler;
+ }
+
+ virtual wxEventFunction GetMethod() const
+ {
+ return this->ConvertToEvtFunction(m_method);
+ }
+
+ virtual wxEvtHandler *GetEvtHandler() const
+ {
+ return this->ConvertToEvtHandler(m_handler);
+ }
+
+private:
+ ObjClass *m_handler;
+ void (Class::*m_method)(EventArg&);
+};
+
+
+//
+// Create functors for the templatized events, either allocated on the heap for
+// wxNewXXX() variants (this is needed in wxEvtHandler::Connect() to store them
+// in dynamic event table) or just by returning them as temporary objects (this
+// is enough for Disconnect() and we allocate unnecessary heap allocation like
+// this)
+
+
+// Create functors wrapping other functors (including functions):
+template <typename EventTag, typename Functor>
+inline wxEventFunctorFunction<EventTag, Functor> *
+wxNewEventFunctor(const EventTag&, Functor func)
+{
+ return new wxEventFunctorFunction<EventTag, Functor>(func);
+}
+
+template <typename EventTag, typename Functor>
+inline wxEventFunctorFunction<EventTag, Functor>
+wxMakeEventFunctor(const EventTag&, Functor func)
+{
+ return wxEventFunctorFunction<EventTag, Functor>(func);
+}
+
+
+// Create functors for methods:
+template
+ <typename EventTag, typename Class, typename EventArg, typename ObjClass>
+inline wxEventFunctorMethod<EventTag, Class, EventArg, ObjClass> *
+wxNewEventFunctor(const EventTag&,
+ void (Class::*method)(EventArg&),
+ ObjClass *handler)
+{
+ return new wxEventFunctorMethod<EventTag, Class, EventArg, ObjClass>(
+ method, handler);
+}
+
+template
+ <typename EventTag, typename Class, typename EventArg, typename ObjClass>
+inline wxEventFunctorMethod<EventTag, Class, EventArg, ObjClass>
+wxMakeEventFunctor(const EventTag&,
+ void (Class::*method)(EventArg&),
+ ObjClass *handler)
+{
+ return wxEventFunctorMethod<EventTag, Class, EventArg, ObjClass>(
+ method, handler);
+}
+
+// Special case for the wxNewEventFunctor() calls used inside the event table
+// macros: they don't specify the handler so ObjClass can't be deduced
+template <typename EventTag, typename Class, typename EventArg>
+inline wxEventFunctorMethod<EventTag, Class, EventArg, Class> *
+wxNewEventFunctor(const EventTag&, void (Class::*method)(EventArg&))
+{
+ return new wxEventFunctorMethod<EventTag, Class, EventArg, Class>(
+ method, NULL);
+}
+
+template
+ <typename EventTag, typename Class, typename EventArg, typename ObjClass>
+inline wxEventFunctorMethod<EventTag, Class, EventArg, Class>
+wxMakeEventFunctor(const EventTag&, void (Class::*method)(EventArg&))
+{
+ return wxEventFunctorMethod<EventTag, Class, EventArg, Class>(
+ method, NULL);
+}
+
+#endif // !wxEVENTS_COMPATIBILITY_2_8
+
+
+// many, but not all, standard event types
+
+ // some generic events
+extern WXDLLIMPEXP_BASE const wxEventType wxEVT_NULL;
+extern WXDLLIMPEXP_BASE const wxEventType wxEVT_FIRST;
+extern WXDLLIMPEXP_BASE const wxEventType wxEVT_USER_FIRST;
+
+ // Need events declared to do this
+class WXDLLIMPEXP_FWD_CORE wxCommandEvent;
+class WXDLLIMPEXP_FWD_CORE wxThreadEvent;
+class WXDLLIMPEXP_FWD_CORE wxMouseEvent;
+class WXDLLIMPEXP_FWD_CORE wxFocusEvent;
+class WXDLLIMPEXP_FWD_CORE wxChildFocusEvent;
+class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
+class WXDLLIMPEXP_FWD_CORE wxNavigationKeyEvent;
+class WXDLLIMPEXP_FWD_CORE wxSetCursorEvent;
+class WXDLLIMPEXP_FWD_CORE wxScrollEvent;
+class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
+class WXDLLIMPEXP_FWD_CORE wxScrollWinEvent;
+class WXDLLIMPEXP_FWD_CORE wxSizeEvent;
+class WXDLLIMPEXP_FWD_CORE wxMoveEvent;
+class WXDLLIMPEXP_FWD_CORE wxCloseEvent;
+class WXDLLIMPEXP_FWD_CORE wxActivateEvent;
+class WXDLLIMPEXP_FWD_CORE wxWindowCreateEvent;
+class WXDLLIMPEXP_FWD_CORE wxWindowDestroyEvent;
+class WXDLLIMPEXP_FWD_CORE wxShowEvent;
+class WXDLLIMPEXP_FWD_CORE wxIconizeEvent;
+class WXDLLIMPEXP_FWD_CORE wxMaximizeEvent;
+class WXDLLIMPEXP_FWD_CORE wxMouseCaptureChangedEvent;
+class WXDLLIMPEXP_FWD_CORE wxMouseCaptureLostEvent;
+class WXDLLIMPEXP_FWD_CORE wxPaintEvent;
+class WXDLLIMPEXP_FWD_CORE wxEraseEvent;
+class WXDLLIMPEXP_FWD_CORE wxNcPaintEvent;
+class WXDLLIMPEXP_FWD_CORE wxMenuEvent;
+class WXDLLIMPEXP_FWD_CORE wxContextMenuEvent;
+class WXDLLIMPEXP_FWD_CORE wxSysColourChangedEvent;
+class WXDLLIMPEXP_FWD_CORE wxDisplayChangedEvent;
+class WXDLLIMPEXP_FWD_CORE wxQueryNewPaletteEvent;
+class WXDLLIMPEXP_FWD_CORE wxPaletteChangedEvent;
+class WXDLLIMPEXP_FWD_CORE wxJoystickEvent;
+class WXDLLIMPEXP_FWD_CORE wxDropFilesEvent;
+class WXDLLIMPEXP_FWD_CORE wxInitDialogEvent;
+class WXDLLIMPEXP_FWD_CORE wxIdleEvent;
+class WXDLLIMPEXP_FWD_CORE wxUpdateUIEvent;
+class WXDLLIMPEXP_FWD_CORE wxClipboardTextEvent;
+class WXDLLIMPEXP_FWD_CORE wxHelpEvent;
+
+
+ // Command events
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SLIDER_UPDATED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEvent);
+
+// wxEVT_COMMAND_SCROLLBAR_UPDATED is deprecated, use wxEVT_SCROLL... events
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SCROLLBAR_UPDATED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_VLBOX_SELECTED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_RCLICKED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, wxCommandEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_ENTER, wxCommandEvent);
+
+ // Thread events
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_THREAD, wxThreadEvent);
+
+ // Mouse event types
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_DOWN, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_UP, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_DOWN, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_UP, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_DOWN, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_UP, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOTION, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ENTER_WINDOW, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEAVE_WINDOW, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_DCLICK, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_DCLICK, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_DCLICK, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SET_FOCUS, wxFocusEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KILL_FOCUS, wxFocusEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHILD_FOCUS, wxChildFocusEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSEWHEEL, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DOWN, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_UP, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DCLICK, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DOWN, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_UP, wxMouseEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DCLICK, wxMouseEvent);
+
+ // Character input event type
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR, wxKeyEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR_HOOK, wxKeyEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_NAVIGATION_KEY, wxNavigationKeyEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KEY_DOWN, wxKeyEvent);
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KEY_UP, wxKeyEvent);