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:
parent
dd1ffb0390
commit
0c2c956893
@ -642,4 +642,63 @@ wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child )
|
||||
#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
|
||||
|
@ -104,6 +104,9 @@ public:
|
||||
// Returns a localized string representing the value for the object
|
||||
// or child.
|
||||
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
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user