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

Method FilterEvent

src/toolbars/ToolManager.cpp:691–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689}
690
691int ToolManager::FilterEvent(wxEvent &event)
692{
693 // Snoop the global event stream for changes of focused window. Remember
694 // the last one of our own that is not a grabber.
695
696 if (event.GetEventType() == wxEVT_KILL_FOCUS) {
697 auto &focusEvent = static_cast<wxFocusEvent&>(event);
698 auto window = focusEvent.GetWindow();
699 auto top = wxGetTopLevelParent(window);
700 if(auto toolFrame = dynamic_cast<ToolFrame*>(top))
701 top = toolFrame->GetParent();
702 // window is that which will GET the focus
703 if ( window &&
704 !dynamic_cast<Grabber*>( window ) &&
705 !dynamic_cast<ToolFrame*>( window ) &&
706 top == FindProjectFrame( mParent ) )
707 // Note this is a dangle-proof wxWindowRef:
708 mLastFocus = window;
709 }
710
711 return Event_Skip;
712}
713
714//
715// Read the toolbar states

Callers

nothing calls this directly

Calls 3

FindProjectFrameFunction · 0.85
GetWindowMethod · 0.80
GetParentMethod · 0.45

Tested by

no test coverage detected