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
This commit is contained in:
Vadim Zeitlin 2009-06-16 19:08:24 +00:00
parent 9330d5afb6
commit 02bad8305c
2 changed files with 12 additions and 1 deletions

View 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

View 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)