1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00

TrackPanelAx: add Navigate function for NVDA object navigation

accNavigate is deprecated, but NVDA uses it for object navigation. (Jaws and narrator do not).
So add Navigate function to TrackPanelAx.

Info on accNavigate:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318473(v=vs.85).aspx
This commit is contained in:
David Bailes 2018-03-10 11:31:53 +00:00
parent dd1ffb0390
commit 0c2c956893
2 changed files with 62 additions and 0 deletions

View File

@ -642,4 +642,63 @@ wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child )
#endif #endif
} }
// Navigates from fromId to toId/toObject
wxAccStatus TrackPanelAx::Navigate(wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject)
{
int childCount;
GetChildCount( &childCount );
if (fromId > childCount)
return wxACC_FAIL;
switch (navDir) {
case wxNAVDIR_FIRSTCHILD:
if (fromId == CHILDID_SELF && childCount > 0 )
*toId = 1;
else
return wxACC_FALSE;
break;
case wxNAVDIR_LASTCHILD:
if (fromId == CHILDID_SELF && childCount > 0 )
*toId = childCount;
else
return wxACC_FALSE;
break;
case wxNAVDIR_NEXT:
case wxNAVDIR_DOWN:
if (fromId != CHILDID_SELF) {
*toId = fromId + 1;
if (*toId > childCount)
return wxACC_FALSE;
}
else
return wxACC_NOT_IMPLEMENTED;
break;
case wxNAVDIR_PREVIOUS:
case wxNAVDIR_UP:
if (fromId != CHILDID_SELF) {
*toId = fromId - 1;
if (*toId < 1)
return wxACC_FALSE;
}
else
return wxACC_NOT_IMPLEMENTED;
break;
case wxNAVDIR_LEFT:
case wxNAVDIR_RIGHT:
if (fromId != CHILDID_SELF)
return wxACC_FALSE;
else
return wxACC_NOT_IMPLEMENTED;
break;
}
*toObject = nullptr;
return wxACC_OK;
}
#endif // wxUSE_ACCESSIBILITY #endif // wxUSE_ACCESSIBILITY

View File

@ -104,6 +104,9 @@ public:
// Returns a localized string representing the value for the object // Returns a localized string representing the value for the object
// or child. // or child.
wxAccStatus GetValue(int childId, wxString* strValue) override; wxAccStatus GetValue(int childId, wxString* strValue) override;
// Navigates from fromId to toId/toObject
wxAccStatus Navigate(wxNavDir navDir, int fromId, int* toId, wxAccessible** toObject) override;
#endif #endif
private: private: