3f66f6a5b3
This keyword is not expanded by Git which means it's not replaced with the correct revision value in the releases made using git-based scripts and it's confusing to have lines with unexpanded "$Id$" in the released files. As expanding them with Git is not that simple (it could be done with git archive and export-subst attribute) and there are not many benefits in having them in the first place, just remove all these lines. If nothing else, this will make an eventual transition to Git simpler. Closes #14487. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
62 lines
1.5 KiB
C++
62 lines
1.5 KiB
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Name: testableframe.cpp
|
|
// Purpose: An improved wxFrame for unit-testing
|
|
// Author: Steven Lamerton
|
|
// Copyright: (c) 2010 Steven Lamerton
|
|
// Licence: wxWindows licence
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// For compilers that support precompilation, includes "wx/wx.h".
|
|
#include "testprec.h"
|
|
|
|
#ifdef __BORLANDC__
|
|
#pragma hdrstop
|
|
#endif
|
|
|
|
#include "wx/app.h"
|
|
#include "testableframe.h"
|
|
|
|
wxTestableFrame::wxTestableFrame() : wxFrame(NULL, wxID_ANY, "Test Frame")
|
|
{
|
|
}
|
|
|
|
void wxTestableFrame::OnEvent(wxEvent& evt)
|
|
{
|
|
m_count[evt.GetEventType()]++;
|
|
|
|
if(! evt.IsCommandEvent() )
|
|
evt.Skip();
|
|
}
|
|
|
|
int wxTestableFrame::GetEventCount(wxEventType type)
|
|
{
|
|
return m_count[type];
|
|
}
|
|
|
|
void wxTestableFrame::ClearEventCount(wxEventType type)
|
|
{
|
|
m_count[type] = 0;
|
|
}
|
|
|
|
EventCounter::EventCounter(wxWindow* win, wxEventType type) : m_type(type),
|
|
m_win(win)
|
|
|
|
{
|
|
m_frame = wxStaticCast(wxTheApp->GetTopWindow(), wxTestableFrame);
|
|
|
|
m_win->Connect(m_type, wxEventHandler(wxTestableFrame::OnEvent),
|
|
NULL, m_frame);
|
|
}
|
|
|
|
EventCounter::~EventCounter()
|
|
{
|
|
m_win->Disconnect(m_type, wxEventHandler(wxTestableFrame::OnEvent),
|
|
NULL, m_frame);
|
|
|
|
//This stops spurious counts from previous tests
|
|
Clear();
|
|
|
|
m_frame = NULL;
|
|
m_win = NULL;
|
|
}
|