]> git.saurik.com Git - wxWidgets.git/blame - tests/testableframe.h
Postpone EnsureVisible() to idle as this sometimes seems to be required, fixes #12480...
[wxWidgets.git] / tests / testableframe.h
CommitLineData
232fdc63
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: testableframe.h
3// Purpose: An improved wxFrame for unit-testing
4// Author: Steven Lamerton
5// RCS-ID: $Id:$
6// Copyright: (c) 2010 Steven Lamerton
7// Licence: wxWidgets licence
8///////////////////////////////////////////////////////////////////////////////
9
10#include "wx/frame.h"
11#include "wx/hashmap.h"
12#include "wx/event.h"
13
14class wxTestableFrame : public wxFrame
15{
16public:
17 wxTestableFrame();
18
19 void OnEvent(wxEvent& evt);
20
21 //wxEVT_ANY get the count for all events or a type can be specified
22 int GetEventCount(wxEventType type = wxEVT_ANY);
23
24private:
25 wxLongToLongHashMap m_count;
26};
27
28class EventCounter
29{
30public:
31 EventCounter(wxWindow* win, wxEventType type);
32 ~EventCounter();
33
34private:
35 wxEventType m_type;
36 wxTestableFrame* m_frame;
37 wxWindow* m_win;
38};