1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-11 06:07:44 +02:00

David Bailes's patch for Bug 742 - Track panel focus bug with NVDA screeen reader

This commit is contained in:
v.audacity 2014-08-16 00:29:48 +00:00
parent 81d264ffbc
commit d383e79997

View File

@ -385,6 +385,32 @@ wxAccStatus TrackPanelAx::GetSelections( wxVariant * WXUNUSED(selections) )
// Returns a state constant. // Returns a state constant.
wxAccStatus TrackPanelAx::GetState( int childId, long* state ) wxAccStatus TrackPanelAx::GetState( int childId, long* state )
{ {
#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; *state = wxACC_STATE_SYSTEM_FOCUSABLE | wxACC_STATE_SYSTEM_SELECTABLE;
if( childId > 0 ) if( childId > 0 )
@ -404,6 +430,7 @@ wxAccStatus TrackPanelAx::GetState( int childId, long* state )
} }
} }
} }
#endif
return wxACC_OK; return wxACC_OK;
} }
@ -464,16 +491,17 @@ wxAccStatus TrackPanelAx::GetValue( int childId, wxString* strValue )
wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child ) wxAccStatus TrackPanelAx::GetFocus( int *childId, wxAccessible **child )
{ {
#if defined(__WXMSW__) #if defined(__WXMSW__)
if( *childId == wxACC_SELF )
if (mTrackPanel == wxWindow::FindFocus())
{ {
if( mFocusedTrack ) if (mFocusedTrack)
{ {
*child = this; *childId = TrackNum(mFocusedTrack);
}
} }
else else
{ {
*child = NULL; *child = this;
}
} }
return wxACC_OK; return wxACC_OK;