X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/acd15a3fa015caf2d1e3213a7694b05c92d5b49c..ea1ad04b434f92c1269e6dde222a77698d6f873c:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 5e618cc09f..df2d8c4477 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -79,6 +79,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxSetCursorEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxDisplayChangedEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent) @@ -218,12 +219,12 @@ DEFINE_EVENT_TYPE(wxEVT_PAINT) DEFINE_EVENT_TYPE(wxEVT_ERASE_BACKGROUND) DEFINE_EVENT_TYPE(wxEVT_NC_PAINT) DEFINE_EVENT_TYPE(wxEVT_PAINT_ICON) -DEFINE_EVENT_TYPE(wxEVT_MENU_CHAR) -DEFINE_EVENT_TYPE(wxEVT_MENU_INIT) +DEFINE_EVENT_TYPE(wxEVT_MENU_OPEN) +DEFINE_EVENT_TYPE(wxEVT_MENU_CLOSE) DEFINE_EVENT_TYPE(wxEVT_MENU_HIGHLIGHT) -DEFINE_EVENT_TYPE(wxEVT_POPUP_MENU_INIT) DEFINE_EVENT_TYPE(wxEVT_CONTEXT_MENU) DEFINE_EVENT_TYPE(wxEVT_SYS_COLOUR_CHANGED) +DEFINE_EVENT_TYPE(wxEVT_DISPLAY_CHANGED) DEFINE_EVENT_TYPE(wxEVT_SETTING_CHANGED) DEFINE_EVENT_TYPE(wxEVT_QUERY_NEW_PALETTE) DEFINE_EVENT_TYPE(wxEVT_PALETTE_CHANGED) @@ -629,6 +630,13 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) { // 1) Add event to list of pending events of this event handler + wxEvent *eventCopy = event.Clone(); + + // we must be able to copy the events here so the event class must + // implement Clone() properly instead of just providing a NULL stab for it + wxCHECK_RET( eventCopy, + _T("events of this type aren't supposed to be posted") ); + #if defined(__VISAGECPP__) wxENTER_CRIT_SECT( m_eventsLocker); #else @@ -638,9 +646,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) if ( !m_pendingEvents ) m_pendingEvents = new wxList; - wxEvent *event2 = event.Clone(); - - m_pendingEvents->Append(event2); + m_pendingEvents->Append(eventCopy); #if defined(__VISAGECPP__) wxLEAVE_CRIT_SECT( m_eventsLocker); @@ -721,6 +727,8 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) info = CLASSINFO(wxWindowMSW); # elif defined(__WXGTK__) info = CLASSINFO(wxWindowGTK); +# elif defined(__WXX11__) + info = CLASSINFO(wxWindowX11); # elif defined(__WXMGL__) info = CLASSINFO(wxWindowMGL); # elif defined(__WXPM__)