]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/testableframe.cpp
Skip EVT_RIGHT_UP event in wxHtmlWindow if it wasn't handled.
[wxWidgets.git] / tests / testableframe.cpp
index efa7396f267dcc6cd22cc2d7c4aa7edb923beff0..9617cfde096cbb1742e3ef762c2023257c3e9fe7 100644 (file)
@@ -2,9 +2,9 @@
 // Name:        testableframe.cpp
 // Purpose:     An improved wxFrame for unit-testing
 // Author:      Steven Lamerton
-// RCS-ID:      $Id:$
+// RCS-ID:      $Id$
 // Copyright:   (c) 2010 Steven Lamerton
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -54,6 +54,11 @@ int wxTestableFrame::GetEventCount(wxEventType type)
     }
 }
 
+void wxTestableFrame::ClearEventCount(wxEventType type)
+{
+    m_count[type] = 0;
+}
+
 EventCounter::EventCounter(wxWindow* win, wxEventType type) : m_type(type),
                                                               m_win(win)
 
@@ -74,6 +79,9 @@ EventCounter::~EventCounter()
                       NULL,
                       m_frame);
 
+    //This stops spurious counts from previous tests
+    m_frame->ClearEventCount(m_type);
+
     m_frame = NULL;
     m_win = NULL;
 }