// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
-// Copyright: (c) Julian Smart and Markus Holzem
+// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
void wxMouseEvent::Assign(const wxMouseEvent& event)
{
+ m_eventType = event.m_eventType;
+
m_x = event.m_x;
m_y = event.m_y;
m_altDown = FALSE;
m_keyCode = 0;
m_scanCode = 0;
+#if wxUSE_UNICODE
+ m_uniChar = 0;
+#endif
+}
+
+wxKeyEvent::wxKeyEvent(const wxKeyEvent& evt)
+ : wxEvent(evt)
+{
+ m_x = evt.m_x;
+ m_y = evt.m_y;
+
+ m_keyCode = evt.m_keyCode;
+
+ m_controlDown = evt.m_controlDown;
+ m_shiftDown = evt.m_shiftDown;
+ m_altDown = evt.m_altDown;
+ m_metaDown = evt.m_metaDown;
+ m_scanCode = evt.m_scanCode;
+ m_rawCode = evt.m_rawCode;
+ m_rawFlags = evt.m_rawFlags;
+
+#if wxUSE_UNICODE
+ m_uniChar = evt.m_uniChar;
+#endif
}
+long wxKeyEvent::KeyCode() const
+{
+ return m_keyCode;
+}
wxWindowCreateEvent::wxWindowCreateEvent(wxWindow *win)
{
if (m_dynamicEvents)
{
- wxNode *node = m_dynamicEvents->First();
+ wxNode *node = m_dynamicEvents->GetFirst();
while (node)
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
+ wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data();
+ wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if (entry->m_callbackUserData)
delete entry->m_callbackUserData;
delete entry;
- node = node->Next();
+ node = node->GetNext();
}
delete m_dynamicEvents;
};
# if !defined(__VISAGECPP__)
delete m_eventsLocker;
# endif
+
+ // Remove us from wxPendingEvents if necessary.
+ if(wxPendingEventsLocker)
+ wxENTER_CRIT_SECT(*wxPendingEventsLocker);
+ if ( wxPendingEvents ) {
+ wxPendingEvents->DeleteObject(this);
+ }
+ if(wxPendingEventsLocker)
+ wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);
#endif
// we only delete object data, not untyped
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
- wxNode *node = m_pendingEvents->First();
+ wxNode *node = m_pendingEvents->GetFirst();
while ( node )
{
- wxEvent *event = (wxEvent *)node->Data();
+ wxEvent *event = (wxEvent *)node->GetData();
delete node;
// In ProcessEvent, new events might get added and
wxENTER_CRIT_SECT( *m_eventsLocker);
#endif
- node = m_pendingEvents->First();
+ node = m_pendingEvents->GetFirst();
}
#if defined(__VISAGECPP__)
if (!m_dynamicEvents)
m_dynamicEvents = new wxList;
- m_dynamicEvents->Append( (wxObject*) entry );
+ // Insert at the front of the list so most recent additions are found first
+ m_dynamicEvents->Insert( (wxObject*) entry );
}
bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
if (!m_dynamicEvents)
return FALSE;
- wxNode *node = m_dynamicEvents->First();
+ wxNode *node = m_dynamicEvents->GetFirst();
while (node)
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
+ wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data();
+ wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if ((entry->m_id == id) &&
delete entry;
return TRUE;
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
}
int commandId = event.GetId();
- wxNode *node = m_dynamicEvents->First();
+ wxNode *node = m_dynamicEvents->GetFirst();
while (node)
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
- wxEventTableEntry *entry = (wxEventTableEntry*)node->Data();
+ wxEventTableEntry *entry = (wxEventTableEntry*)node->GetData();
#else // !WXWIN_COMPATIBILITY_EVENT_TYPES
- wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->Data();
+ wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData();
#endif // WXWIN_COMPATIBILITY_EVENT_TYPES/!WXWIN_COMPATIBILITY_EVENT_TYPES
if (entry->m_fn)
(this->*((wxEventFunction) (entry->m_fn)))(event);
- if (event.GetSkipped())
- return FALSE;
- else
+ if ( ! event.GetSkipped() )
return TRUE;
}
}
- node = node->Next();
+ node = node->GetNext();
}
return FALSE;
};