1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 00:50:05 +02:00

TrackPanelAx: add Select function

Added an override for Select. This enables NVDA to move the focus to the current navigator object, and Jaws to move the focus to the current element when using the touch cursor.

For info on accSelect:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318474(v=vs.85).aspx
This commit is contained in:
David Bailes 2018-03-12 13:47:27 +00:00
parent 0c2c956893
commit 59d1ca46df
2 changed files with 31 additions and 0 deletions

View File

@ -701,4 +701,32 @@ wxAccStatus TrackPanelAx::Navigate(wxNavDir navDir, int fromId, int* toId, wxAcc
return wxACC_OK;
}
// Modify focus or selection
wxAccStatus TrackPanelAx::Select(int childId, wxAccSelectionFlags selectFlags)
{
// Only support change of focus
if (selectFlags != wxACC_SEL_TAKEFOCUS)
return wxACC_NOT_IMPLEMENTED;
if (childId != CHILDID_SELF) {
int childCount;
GetChildCount( &childCount );
if (childId > childCount)
return wxACC_FAIL;
Track* t = FindTrack(childId).get();
if (t) {
mTrackPanel->SetFocusedTrack(t);
mTrackPanel->EnsureVisible(t);
AudacityProject* p = GetActiveProject();
if (p)
p->ModifyState(false);
}
}
else
return wxACC_NOT_IMPLEMENTED;
return wxACC_OK;
}
#endif // wxUSE_ACCESSIBILITY

View File

@ -107,6 +107,9 @@ public:
// Navigates from fromId to toId/toObject
wxAccStatus Navigate(wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject) override;
// Modify focus or selection
wxAccStatus Select(int childId, wxAccSelectionFlags selectFlags) override;
#endif
private: