]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/testableframe.cpp
Add virtual ~wxAnyScrollHelperBase() to fix compiler warning.
[wxWidgets.git] / tests / testableframe.cpp
index d69be423ebef1686d6b5ff6fa78a1d80815d1c7d..b260adaa458a399bae7f6788598d656178af1e79 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        testableframe.cpp
 // Purpose:     An improved wxFrame for unit-testing
 // Author:      Steven Lamerton
 // Name:        testableframe.cpp
 // Purpose:     An improved wxFrame for unit-testing
 // Author:      Steven Lamerton
-// RCS-ID:      $Id$
 // Copyright:   (c) 2010 Steven Lamerton
 // Copyright:   (c) 2010 Steven Lamerton
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
 ///////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -31,27 +30,7 @@ void wxTestableFrame::OnEvent(wxEvent& evt)
 
 int wxTestableFrame::GetEventCount(wxEventType type)
 {
 
 int wxTestableFrame::GetEventCount(wxEventType type)
 {
-    if (type == wxEVT_ANY)
-    {
-        //Get the total event count
-        long total = 0;
-
-        for(wxLongToLongHashMap::iterator iter = m_count.begin();
-            iter != m_count.end();
-            iter++)
-        {
-            total += iter->second;
-            iter->second = 0;
-        }
-
-        return total;
-    }
-    else
-    {
-        long count = m_count[type];
-        m_count[type] = 0;
-        return count;
-    }
+    return m_count[type];
 }
 
 void wxTestableFrame::ClearEventCount(wxEventType type)
 }
 
 void wxTestableFrame::ClearEventCount(wxEventType type)
@@ -63,24 +42,19 @@ EventCounter::EventCounter(wxWindow* win, wxEventType type) : m_type(type),
                                                               m_win(win)
 
 {
                                                               m_win(win)
 
 {
-    m_frame = wxStaticCast(wxTheApp->GetTopWindow(),
-                           wxTestableFrame);
+    m_frame = wxStaticCast(wxTheApp->GetTopWindow(), wxTestableFrame);
 
 
-    m_win->Connect(m_type,
-                   wxEventHandler(wxTestableFrame::OnEvent),
-                   NULL,
-                   m_frame);
+    m_win->Connect(m_type, wxEventHandler(wxTestableFrame::OnEvent),
+                   NULL, m_frame);
 }
 
 EventCounter::~EventCounter()
 {
 }
 
 EventCounter::~EventCounter()
 {
-    m_win->Disconnect(m_type,
-                      wxEventHandler(wxTestableFrame::OnEvent),
-                      NULL,
-                      m_frame);
+    m_win->Disconnect(m_type, wxEventHandler(wxTestableFrame::OnEvent),
+                      NULL, m_frame);
 
     //This stops spurious counts from previous tests
 
     //This stops spurious counts from previous tests
-    m_frame->ClearEventCount(m_type);
+    Clear();
 
     m_frame = NULL;
     m_win = NULL;
 
     m_frame = NULL;
     m_win = NULL;