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

Method GetFocus

src/TrackPanelAx.cpp:563–605  ·  view source on GitHub ↗

Gets the window with the keyboard focus. If childId is 0 and child is NULL, no object in this subhierarchy has the focus. If this object has the focus, child should be 'this'.

Source from the content-addressed store, hash-verified

561// this subhierarchy has the focus.
562// If this object has the focus, child should be 'this'.
563wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child )
564{
565 auto pFocus = mwFocus.lock();
566 if (!pFocus)
567 return wxACC_FAIL;
568
569#if defined(__WXMSW__)
570
571 if (GetWindow() == wxWindow::FindFocus())
572 {
573 auto focusedTrack = pFocus->PeekFocus();
574 if (focusedTrack)
575 {
576 *childId = pFocus->TrackNum(focusedTrack);
577 }
578 else
579 {
580 *child = this;
581 }
582 }
583
584 return wxACC_OK;
585#endif
586
587#if defined(__WXMAC__)
588 if( GetWindow() == wxWindow::FindFocus() )
589 {
590 auto focusedTrack = pFocus->PeekFocus();
591 if( focusedTrack )
592 {
593 *childId = pFocus->TrackNum(focusedTrack);
594 }
595 else
596 {
597 *childId = wxACC_SELF;
598 }
599
600 return wxACC_OK;
601 }
602
603 return wxACC_NOT_IMPLEMENTED;
604#endif
605}
606
607// Navigates from fromId to toId/toObject
608wxAccStatus TrackPanelAx::Navigate(wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject)

Callers 2

UpdatedMethod · 0.45

Calls 4

FindFocusFunction · 0.85
PeekFocusMethod · 0.80
TrackNumMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected