]> git.saurik.com Git - wxWidgets.git/commitdiff
added helper GTKShouldIgnoreEvent() to use in void GTK event handlers
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Jun 2009 19:08:24 +0000 (19:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Jun 2009 19:08:24 +0000 (19:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/window.h
src/gtk/window.cpp

index bb5e714d19e04660fa12b566f7e755fd23fa72f9..d34f5b1de85b59c1e833743d56eb926fc75c2d35 100644 (file)
@@ -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
index db5446339cbfbbf0e3d72d2bdf05e28c1cf3f34a..b5d5d18bfe1c98c559c6682368c04bdde4a25da7 100644 (file)
@@ -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)