const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
{ DECLARE_EVENT_TABLE_ENTRY(wxEVT_NULL, 0, 0, (wxObjectEventFunction)NULL, NULL) };
-
+
#ifdef __WXDEBUG__
// Clear up event hash table contents or we can get problems
// when C++ is cleaning up the static object
};
IMPLEMENT_DYNAMIC_CLASS(wxEventTableEntryModule, wxModule)
#endif
-
+
// ----------------------------------------------------------------------------
// global variables
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
/*
- * General wxWindows events, covering
+ * General wxWidgets events, covering
* all interesting things that might happen (button clicking, resizing,
* setting text in widgets, etc.).
*
if (sm_updateInterval == -1)
return false;
- else if (sm_updateInterval == 0)
+
+ if (sm_updateInterval == 0)
return true;
- else
- {
+
#if wxUSE_STOPWATCH && wxUSE_LONGLONG
- wxLongLong now = wxGetLocalTimeMillis();
- if (now > (sm_lastUpdate + sm_updateInterval))
- {
- return true;
- }
-#else
- // If we don't have wxStopWatch or wxLongLong, we
- // should err on the safe side and update now anyway.
+ wxLongLong now = wxGetLocalTimeMillis();
+ if (now > (sm_lastUpdate + sm_updateInterval))
+ {
return true;
-#endif
}
+
return false;
+#else
+ // If we don't have wxStopWatch or wxLongLong, we
+ // should err on the safe side and update now anyway.
+ return true;
+#endif
}
// Reset the update time to provide a delay until the next
case wxMOUSE_BTN_RIGHT:
return RightDClick();
}
-
- return false;
}
// return true if was a button down event
case wxMOUSE_BTN_RIGHT:
return RightDown();
}
-
- return false;
}
// return true if was a button up event
case wxMOUSE_BTN_RIGHT:
return RightUp();
}
-
- return false;
}
// return true if the given button is currently changing state
case wxMOUSE_BTN_RIGHT:
return RightDown() || RightUp() || RightDClick();
}
-
- return false;
}
bool wxMouseEvent::ButtonIsDown(int but) const
case wxMOUSE_BTN_RIGHT:
return RightIsDown();
}
-
- return false;
}
int wxMouseEvent::GetButton() const
m_rebuildHash(true)
{
AllocEventTypeTable(EVENT_TYPE_TABLE_INIT_SIZE);
-
+
m_next = sm_first;
if (m_next)
m_next->m_previous = this;
m_previous->m_next = m_next;
if (sm_first == this)
sm_first = m_next;
-
+
Clear();
}
InitHashTable();
m_rebuildHash = false;
}
-
+
if (!m_eventTypeTable)
- return FALSE;
+ return false;
// Find all entries for the given event type.
wxEventType eventType = event.GetEventType();
// This might happen 'accidentally' as the app is exiting
if (!m_eventTypeTable)
return;
-
+
EventTypeTablePointer *peTTnode = &m_eventTypeTable[entry.m_eventType % m_size];
EventTypeTablePointer eTTnode = *peTTnode;
void wxEvtHandler::ProcessPendingEvents()
{
+ // this method is only called by wxApp if this handler does have pending
+ // events
+ wxCHECK_RET( m_pendingEvents,
+ wxT("Please call wxApp::ProcessPendingEvents() instead") );
+
#if defined(__VISAGECPP__)
wxENTER_CRIT_SECT( m_eventsLocker);
#else
// the event table (meaning "any") or the event id matches the id
// specified in the event table either exactly or by falling into
// range between first and last
- if ((tableId1 == -1) ||
- (tableId2 == -1 && tableId1 == event.GetId()) ||
- (tableId2 != -1 &&
+ if ((tableId1 == wxID_ANY) ||
+ (tableId2 == wxID_ANY && tableId1 == event.GetId()) ||
+ (tableId2 != wxID_ANY &&
(event.GetId() >= tableId1 && event.GetId() <= tableId2)))
{
event.Skip(false);
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if ((entry->m_id == id) &&
- ((entry->m_lastId == lastId) || (lastId == -1)) &&
+ ((entry->m_lastId == lastId) || (lastId == wxID_ANY)) &&
((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) &&
((entry->m_fn == func) || (func == (wxObjectEventFunction)NULL)) &&
((entry->m_eventSink == eventSink) || (eventSink == (wxEvtHandler*)NULL)) &&
wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
- if ((event.m_eventType == entry->m_eventType) && entry->m_fn)
+ if ((event.m_eventType == entry->m_eventType) && (entry->m_fn != 0))
{
wxEvtHandler *handler =
#if !WXWIN_COMPATIBILITY_EVENT_TYPES