mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 09:00:07 +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:
parent
0c2c956893
commit
59d1ca46df
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user