#include <CRCapturedEvent.h>
Public Member Functions | |
CRCapturedEvent (wxEvent *event) | |
Constructor. | |
virtual void | EmitCpp ()=0 |
Emit event simulation specific C++ code using CRCppEmitter. | |
virtual wxEvent * | GetEvent () |
Get real wxEvent. | |
virtual bool | IsIrrelevant () const |
Return true for irrelevant events which should not be emitted. | |
virtual bool | IsPending () const |
Return true, if this event might be part of a series of events. | |
virtual void | Process (CRCapturedEvent **pendingEvt)=0 |
Process event, only called after checking for handling ability. | |
virtual | ~CRCapturedEvent () |
Destructor. | |
Protected Attributes | |
wxEvent * | m_event |
Implemented using Strategy pattern.
Definition at line 28 of file CRCapturedEvent.h.
wxTst::CRCapturedEvent::CRCapturedEvent | ( | wxEvent * | event | ) |
wxTst::CRCapturedEvent::~CRCapturedEvent | ( | ) | [virtual] |
void wxTst::CRCapturedEvent::EmitCpp | ( | ) | [pure virtual] |
Emit event simulation specific C++ code using CRCppEmitter.
Implemented in wxTst::CRButtonClickEvent, wxTst::CRCheckBoxClickEvent, wxTst::CRChoiceSelectionEvent, wxTst::CRMenuSelectionEvent, wxTst::CRNotebookPageChangeEvent, wxTst::CRRadioBoxSelectionEvent, wxTst::CRSliderUpdateEvent, wxTst::CRSpinCtrlUpdateEvent, wxTst::CRTextUpdateEvent, wxTst::CRTreeItemRightClickEvent, and wxTst::CRTreeSelectionChangingEvent.
Referenced by wxTst::CREventCaptureManager::EmitPendingEvent(), and wxTst::CREventCaptureManager::FilterEvent().
wxEvent * wxTst::CRCapturedEvent::GetEvent | ( | ) | [virtual] |
Get real wxEvent.
Definition at line 33 of file CRCapturedEvent.cpp.
References m_event.
Referenced by wxTst::CRTextUpdateEvent::Process(), wxTst::CRSpinCtrlUpdateEvent::Process(), wxTst::CRSliderUpdateEvent::Process(), and wxTst::CRNotebookPageChangeEvent::Process().
bool wxTst::CRCapturedEvent::IsIrrelevant | ( | ) | const [virtual] |
Return true for irrelevant events which should not be emitted.
E.g. text updates of double typed spin controls.
Reimplemented in wxTst::CRTextUpdateEvent.
Definition at line 45 of file CRCapturedEvent.cpp.
Referenced by wxTst::CREventCaptureManager::FilterEvent().
bool wxTst::CRCapturedEvent::IsPending | ( | ) | const [virtual] |
Return true, if this event might be part of a series of events.
E.g. Entering text in text controls creates wxEVT_COMMAND_TEXT_UPDATED events for every key stroke. Thus, they should be assembled into one.
Process() method is called before, allowing investigating the context.
Reimplemented in wxTst::CRNotebookPageChangeEvent, wxTst::CRSliderUpdateEvent, and wxTst::CRTextUpdateEvent.
Definition at line 39 of file CRCapturedEvent.cpp.
Referenced by wxTst::CREventCaptureManager::FilterEvent().
void wxTst::CRCapturedEvent::Process | ( | CRCapturedEvent ** | pendingEvt | ) | [pure virtual] |
Process event, only called after checking for handling ability.
By handing over the current pending event assembling a series of events before actual code emitting is allowed, cf. IsPending() method.
The pending event will be emitted and subsequently destroyed right after returning control from this method. Thus, if a pending event should not be emitted, because it is assembled in this new event it must be deleted within this method.
pendingEvt | current pending event with respect to code emitting (or NULL if none is pending) |
Implemented in wxTst::CRButtonClickEvent, wxTst::CRCheckBoxClickEvent, wxTst::CRChoiceSelectionEvent, wxTst::CRMenuSelectionEvent, wxTst::CRNotebookPageChangeEvent, wxTst::CRRadioBoxSelectionEvent, wxTst::CRSliderUpdateEvent, wxTst::CRSpinCtrlUpdateEvent, wxTst::CRTextUpdateEvent, wxTst::CRTreeItemRightClickEvent, and wxTst::CRTreeSelectionChangingEvent.
Referenced by wxTst::CREventCaptureManager::FilterEvent().
wxEvent* wxTst::CRCapturedEvent::m_event [protected] |
Definition at line 99 of file CRCapturedEvent.h.
Referenced by wxTst::CRAbstractTreeEvent::BuildTreeItemSiblingIdxHierarchyList(), wxTst::CRMenuSelectionEvent::EmitCpp(), GetEvent(), wxTst::CRTreeSelectionChangingEvent::Process(), wxTst::CRTreeItemRightClickEvent::Process(), wxTst::CRTextUpdateEvent::Process(), wxTst::CRSpinCtrlUpdateEvent::Process(), wxTst::CRSliderUpdateEvent::Process(), wxTst::CRRadioBoxSelectionEvent::Process(), wxTst::CRNotebookPageChangeEvent::Process(), wxTst::CRMenuSelectionEvent::Process(), wxTst::CRChoiceSelectionEvent::Process(), wxTst::CRCheckBoxClickEvent::Process(), and wxTst::CRButtonClickEvent::Process().