X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9aaf9bed0e95c65cadb8af608a9d6908122c5954..2ec6905c69c73f908533697c770c690657f4371c:/src/common/event.cpp?ds=sidebyside diff --git a/src/common/event.cpp b/src/common/event.cpp index f3a647d4a9..73d7d79ba6 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -83,6 +83,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxHelpEvent, wxCommandEvent) + IMPLEMENT_DYNAMIC_CLASS(wxContextMenuEvent, wxCommandEvent) #endif // wxUSE_GUI const wxEventTable *wxEvtHandler::GetEventTable() const @@ -111,6 +112,7 @@ wxList *wxPendingEvents = (wxList *)NULL; // common event types are defined here, other event types are defined by the // components which use them +DEFINE_EVENT_TYPE(wxEVT_NULL) DEFINE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKBOX_CLICKED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED) @@ -149,6 +151,7 @@ DEFINE_EVENT_TYPE(wxEVT_MIDDLE_DCLICK) DEFINE_EVENT_TYPE(wxEVT_RIGHT_DCLICK) DEFINE_EVENT_TYPE(wxEVT_SET_FOCUS) DEFINE_EVENT_TYPE(wxEVT_KILL_FOCUS) +DEFINE_EVENT_TYPE(wxEVT_MOUSEWHEEL) // Non-client mouse events DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_DOWN) @@ -413,6 +416,9 @@ wxMouseEvent::wxMouseEvent(wxEventType commandType) m_middleDown = FALSE; m_x = 0; m_y = 0; + m_wheelRotation = 0; + m_wheelDelta = 0; + m_linesPerAction = 0; } void wxMouseEvent::CopyObject(wxObject& obj_d) const @@ -937,15 +943,21 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) } #if wxUSE_GUI - // Carry on up the parent-child hierarchy, - // but only if event is a command event: it wouldn't - // make sense for a parent to receive a child's size event, for example + // Carry on up the parent-child hierarchy, but only if event is a command + // event: it wouldn't make sense for a parent to receive a child's size + // event, for example if ( m_isWindow && event.IsCommandEvent() ) { wxWindow *win = (wxWindow *)this; - wxWindow *parent = win->GetParent(); - if (parent && !parent->IsBeingDeleted()) - return parent->GetEventHandler()->ProcessEvent(event); + + // also, don't propagate events beyond the first top level window: it + // doesn't make sense to process dialogs events in the parent frame + if ( !win->IsTopLevel() ) + { + wxWindow *parent = win->GetParent(); + if (parent && !parent->IsBeingDeleted()) + return parent->GetEventHandler()->ProcessEvent(event); + } } #endif // wxUSE_GUI