X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63c95f27341f1af539bf0fb660bab75186a368b4..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/gtk/scrolbar.cpp?ds=sidebyside diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index 343e27f848..413e8fbe3c 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -33,14 +33,19 @@ gtk_value_changed(GtkRange* range, wxScrollBar* win) { const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL; const int value = win->GetThumbPosition(); - wxScrollEvent event(eventType, win->GetId(), value, orient); - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); + const int id = win->GetId(); + + // first send the specific event for the user action + wxScrollEvent evtSpec(eventType, id, value, orient); + evtSpec.SetEventObject(win); + win->HandleWindowEvent(evtSpec); + if (!win->m_isScrolling) { - wxScrollEvent event(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient); - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); + // and if it's over also send a general "changed" event + wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient); + evtChanged.SetEventObject(win); + win->HandleWindowEvent(evtChanged); } } } @@ -73,14 +78,15 @@ gtk_event_after(GtkRange* range, GdkEvent* event, wxScrollBar* win) const int value = win->GetThumbPosition(); const int orient = win->HasFlag(wxSB_VERTICAL) ? wxVERTICAL : wxHORIZONTAL; + const int id = win->GetId(); - wxScrollEvent event(wxEVT_SCROLL_THUMBRELEASE, win->GetId(), value, orient); - event.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event); + wxScrollEvent evtRel(wxEVT_SCROLL_THUMBRELEASE, id, value, orient); + evtRel.SetEventObject(win); + win->HandleWindowEvent(evtRel); - wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient); - event2.SetEventObject(win); - win->GetEventHandler()->ProcessEvent(event2); + wxScrollEvent evtChanged(wxEVT_SCROLL_CHANGED, id, value, orient); + evtChanged.SetEventObject(win); + win->HandleWindowEvent(evtChanged); } } }