MCPcopy Create free account
hub / github.com/audacity/audacity / FilterEvent

Method FilterEvent

src/widgets/BasicMenu.cpp:105–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 }
104
105 int FilterEvent( wxEvent &event ) override
106 {
107 using namespace Journal::Events;
108
109 // Record something only if we are recording events, this is a menu
110 // event, there is an outstanding popup menu, and that or a descendant
111 // is the event object
112 auto pObj = event.GetEventObject();
113 if (!(IsWatching() &&
114 event.GetEventType() == wxEVT_MENU &&
115 !sMenuStack.empty() &&
116 ContainsMenu( sMenuStack.back(), pObj ) ))
117 return Event_Skip;
118
119 // Find a path identifying the object
120 auto pPath = FindPathName( *static_cast<wxMenu*>(pObj), event.GetId() );
121 if ( !pPath ) {
122 FailedEventSerialization();
123 return Event_Skip;
124 }
125
126 // Write a representation to the journal.
127 // Write names, not numerical ids, so the journal is not
128 // fragile if the assignment of ids to commands changes.
129 pPath->insert( pPath->begin(), JournalCode );
130 Journal::Output( *pPath );
131 sHandledEvent = true;
132
133 return Event_Skip;
134 }
135};
136
137void Watch()

Callers

nothing calls this directly

Calls 9

IsWatchingFunction · 0.85
ContainsMenuFunction · 0.85
FindPathNameFunction · 0.85
FailedEventSerializationFunction · 0.85
OutputFunction · 0.85
GetIdMethod · 0.80
emptyMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected