From 02bad8305c130cd70a8a23328a4c4c8dacbb622b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 16 Jun 2009 19:08:24 +0000 Subject: [PATCH] added helper GTKShouldIgnoreEvent() to use in void GTK event handlers git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/window.h | 8 +++++++- src/gtk/window.cpp | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index bb5e714d19..d34f5b1de8 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -154,6 +154,12 @@ public: // anything else. If it returns -1, the handler should continue as usual int GTKCallbackCommonPrologue(struct _GdkEventAny *event) const; + // Simplified form of GTKCallbackCommonPrologue() which can be used from + // GTK callbacks without return value to check if the event should be + // ignored: if this returns true, the event shouldn't be handled + bool GTKShouldIgnoreEvent() const; + + // override this if some events should never be consumed by wxWidgets but // but have to be left for the native control // @@ -276,7 +282,7 @@ public: // extra (wxGTK-specific) flags bool m_noExpose:1; // wxGLCanvas has its own redrawing bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size" - bool m_hasVMT:1; + bool m_hasVMT:1; // set after PostCreation() is called bool m_isScrolling:1; // dragging scrollbar thumb? bool m_clipPaintRegion:1; // true after ScrollWindow() wxRegion m_nativeUpdateRegion; // not transformed for RTL diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index db5446339c..b5d5d18bfe 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1208,6 +1208,11 @@ bool wxWindowGTK::GTKProcessEvent(wxEvent& event) const return HandleWindowEvent(event); } +bool wxWindowGTK::GTKShouldIgnoreEvent() const +{ + return !m_hasVMT || g_blockEventsOnDrag; +} + int wxWindowGTK::GTKCallbackCommonPrologue(GdkEventAny *event) const { if (!m_hasVMT)