-#if !wxEVENTS_COMPATIBILITY_2_8
- //
- // Connect a method to an event:
- //
-
- template <typename EventType, typename Class>
- void Connect( int winid,
- int lastId,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL )
- {
- wxEventFunctorMethod< EventType, Class, Class > *functor =
- wxNewEventFunctor( eventType, func, static_cast< Class * const >( this ));
-
- Subscribe( winid, lastId, eventType, functor, userData );
- }
-
- template <typename EventType, typename Class>
- void Connect( int winid,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL )
- { Connect( winid, wxID_ANY, eventType, func, userData ); }
-
- template <typename EventType, typename Class>
- void Connect( const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL )
- { Connect( wxID_ANY, wxID_ANY, eventType, func, userData ); }
-
- template <typename EventType, typename Class, typename Derived>
- void Connect( int winid,
- int lastId,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- {
- wxEventFunctorMethod< EventType, Class, Derived > *functor =
- wxNewEventFunctor( eventType, func, eventSink );
-
- Subscribe( winid, lastId, eventType, functor, userData );
- }
-
- template <typename EventType, typename Class, typename Derived>
- void Connect( int winid,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- { Connect( winid, wxID_ANY, eventType, func, userData, eventSink ); }
-
- template <typename EventType, typename Class, typename Derived>
- void Connect( const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- { Connect( wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); }
-
- template <typename Sender, typename EventType, typename Class, typename Derived>
- static void Connect( Sender *sender,
- int winid,
- int lastId,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- {
- wxEventFunctorMethod< EventType, Class, Derived > *functor =
- wxNewEventFunctor( eventType, func, eventSink );
-
- sender->Subscribe( winid, lastId, eventType, functor, userData );
- }
-
- template <typename Sender, typename EventType, typename Class, typename Derived>
- static void Connect( Sender *sender,
- int winid,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- { Connect( sender, winid, wxID_ANY, eventType, func, userData, eventSink ); }
-
- template <typename Sender, typename EventType, typename Class, typename Derived>
- static void Connect( Sender *sender,
- const EventType &eventType,
- void ( Class::*func )( typename EventType::CorrespondingEvent & ),
- wxObject *userData = NULL,
- Derived *eventSink = NULL )
- { Connect( sender, wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); }
-
- //
- // Connect a function to an event:
- //
- template <typename EventType>
- void Connect(int winid,
- int lastId,
- const EventType &eventType,
- void (*func)(typename EventType::CorrespondingEvent&),
- wxObject* userData = NULL)
- {
- wxEventFunctorFunction< EventType > *functor = wxNewEventFunctor( eventType, func );
-
- Subscribe( winid, lastId, eventType, functor, userData );
- }