- template <typename EventType>
- void Connect( const EventType &eventType,
- void ( *func )( typename EventType::CorrespondingEvent & ),
- wxObject* userData = NULL )
- { Connect( wxID_ANY, wxID_ANY, eventType, func, userData ); }
-
- //
- // 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 an arbitrary functor to an event:
- //
-
- template <typename EventType, typename Functor>
- void Connect( int winid,
- int lastId,
- const EventType &eventType,
- Functor &functor,
- wxObject* userData = NULL)
- {
- wxEventFunctorAdapter< EventType, Functor > *adapter =
- wxNewEventFunctor( eventType, functor );
-
- Subscribe( winid, lastId, eventType, adapter, userData );
- }
- template <typename EventType, typename Functor>
- void Connect( int winid,
- const EventType &eventType,
- Functor &functor,
- wxObject* userData = NULL)
- { Connect( winid, wxID_ANY, eventType, functor, userData ); }
-
- template <typename EventType, typename Functor>
- void Connect( const EventType &eventType,
- Functor &functor,
- wxObject* userData = NULL)
- { Connect( wxID_ANY, wxID_ANY, eventType, functor, userData ); }
-
- //
- // Disconnect a function from an event:
- //
-
- template <typename EventType>
- bool Disconnect( int winid,
- int lastId,
- const EventType &eventType,
- void ( *func )( typename EventType::CorrespondingEvent & ),
- wxObject* userData = NULL )