mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
David Bailes's patch for Bug 742 - Track panel focus bug with NVDA screeen reader
This commit is contained in:
@@ -385,7 +385,33 @@ wxAccStatus TrackPanelAx::GetSelections( wxVariant * WXUNUSED(selections) )
|
||||
// Returns a state constant.
|
||||
wxAccStatus TrackPanelAx::GetState( int childId, long* state )
|
||||
{
|
||||
*state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
|
||||
#if defined(__WXMSW__)
|
||||
if( childId > 0 )
|
||||
{
|
||||
Track *t = FindTrack( childId );
|
||||
|
||||
*state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
|
||||
if (t)
|
||||
{
|
||||
if( t == mFocusedTrack )
|
||||
{
|
||||
*state |= wxACC_STATE_SYSTEM_FOCUSED;
|
||||
}
|
||||
|
||||
if( t->GetSelected() )
|
||||
{
|
||||
*state |= wxACC_STATE_SYSTEM_SELECTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // childId == wxACC_SELF
|
||||
{
|
||||
*state = wxACC_STATE_SYSTEM_FOCUSABLE + wxACC_STATE_SYSTEM_FOCUSED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
*state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
|
||||
|
||||
if( childId > 0 )
|
||||
{
|
||||
@@ -404,6 +430,7 @@ wxAccStatus TrackPanelAx::GetState( int childId, long* state )
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
@@ -464,17 +491,18 @@ wxAccStatus TrackPanelAx::GetValue( int childId, wxString* strValue )
|
||||
wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child )
|
||||
{
|
||||
#if defined(__WXMSW__)
|
||||
if( *childId == wxACC_SELF )
|
||||
|
||||
if (mTrackPanel == wxWindow::FindFocus())
|
||||
{
|
||||
if( mFocusedTrack )
|
||||
if (mFocusedTrack)
|
||||
{
|
||||
*childId = TrackNum(mFocusedTrack);
|
||||
}
|
||||
else
|
||||
{
|
||||
*child = this;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*child = NULL;
|
||||
}
|
||||
|
||||
return wxACC_OK;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user