// this is used to make the event table entry type safe, so that for an event
// handler only a function with proper parameter list can be given.
-#define wxStaticCastEvent(type, val) wx_static_cast(type, val)
+#define wxStaticCastEvent(type, val) static_cast<type>(val)
#define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \
wxEventTableEntry(type, winid, idLast, fn, obj)
// example)
wxKeyEvent& operator=(const wxKeyEvent& evt)
{
- if (&evt != this)
+ if ( &evt != this )
{
wxEvent::operator=(evt);
- wxKeyboardState::operator=(evt);
+
+ // Borland C++ 5.82 doesn't compile an explicit call to an
+ // implicitly defined operator=() so need to do it this way:
+ *static_cast<wxKeyboardState *>(this) = evt;
m_x = evt.m_x;
m_y = evt.m_y;
// winid and event type
void Connect(int winid,
int lastId,
- int eventType,
+ wxEventType eventType,
wxObjectEventFunction func,
wxObject *userData = (wxObject *) NULL,
wxEvtHandler *eventSink = (wxEvtHandler *) NULL);
// Convenience function: take just one id
void Connect(int winid,
- int eventType,
+ wxEventType eventType,
wxObjectEventFunction func,
wxObject *userData = (wxObject *) NULL,
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
{ Connect(winid, wxID_ANY, eventType, func, userData, eventSink); }
// Even more convenient: without id (same as using id of wxID_ANY)
- void Connect(int eventType,
+ void Connect(wxEventType eventType,
wxObjectEventFunction func,
wxObject *userData = (wxObject *) NULL,
wxEvtHandler *eventSink = (wxEvtHandler *) NULL)
void SetClientData( void *data ) { DoSetClientData(data); }
void *GetClientData() const { return DoGetClientData(); }
+
+ // implementation from now on
+ // --------------------------
+
// check if the given event table entry matches this event and call the
// handler if it does
//
wxEvtHandler *handler,
wxEvent& event);
- // implementation from now on
virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
bool SearchDynamicEventTable( wxEvent& event );
void ClearEventHashTable() { GetEventHashTable().Clear(); }
void OnSinkDestroyed( wxEvtHandler *sink );
+
+ // The method processing the event in this event handler (or rather in this
+ // event handler chain as it also tries the next handler and so on), i.e.
+ // it returns true if we processed this event or false if we didn't but
+ // does not call TryParent() in the latter case. It also doesn't call
+ // wxApp::FilterEvent() before processing it, this is supposed to be done
+ // by the public ProcessEvent() only once for every event we handle.
+ //
+ // It is meant to be called from ProcessEvent() only and is not virtual,
+ // additional event handlers can be hooked into the normal event processing
+ // logic using TryValidator() hook.
+ bool ProcessEventHere(wxEvent& event);
+
+
private:
static const wxEventTableEntry sm_eventTableEntries[];
// Is event handler enabled?
bool m_enabled;
- // Avoid adding events from another thread during dtor
- bool m_beingDeleted;
// The user data: either an object which will be deleted by the container