mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 00:29:41 +02:00
David Bailes's patch for Bug 742 - Track panel focus bug with NVDA screeen reader
This commit is contained in:
parent
81d264ffbc
commit
d383e79997
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user