Remove wxDataViewTreeCtrlAccessibilty class
Since wxDataViewCtrlAccessible::GetName() calls to wxDataViewIconTextRenderer::GetAccessibleDescription() to directly retrieve the content of the renderer, there is no need to override wxDataViewCtrlAccessible::GetName() in order to get a proper content of the renderer in wxDataViewTreeCtrl.
This commit is contained in:
@@ -2782,57 +2782,4 @@ void wxDataViewTreeCtrl::OnSize( wxSizeEvent &event )
|
||||
event.Skip( true );
|
||||
}
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
wxAccessible* wxDataViewTreeCtrl::CreateAccessible()
|
||||
{
|
||||
return new wxDataViewTreeCtrlAccessible(this);
|
||||
}
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDataViewTreeCtrlAccessible
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
wxDataViewTreeCtrlAccessible::wxDataViewTreeCtrlAccessible(wxDataViewTreeCtrl* win)
|
||||
: wxDataViewCtrlAccessible(win)
|
||||
{
|
||||
}
|
||||
|
||||
// Gets the name of the specified object.
|
||||
wxAccStatus wxDataViewTreeCtrlAccessible::GetName(int childId, wxString* name)
|
||||
{
|
||||
wxDataViewTreeCtrl* dvCtrl = wxDynamicCast(GetWindow(), wxDataViewTreeCtrl);
|
||||
wxCHECK( dvCtrl, wxACC_FAIL );
|
||||
|
||||
if ( childId == wxACC_SELF )
|
||||
{
|
||||
*name = dvCtrl->GetName();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxDataViewItem item = dvCtrl->GetItemByRow(childId-1);
|
||||
if ( !item.IsOk() )
|
||||
{
|
||||
return wxACC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
wxString itemName = dvCtrl->GetItemText(item);
|
||||
if ( itemName.empty() )
|
||||
{
|
||||
// Return row number if not textual column found.
|
||||
// Rows are numbered from 1.
|
||||
*name = wxString::Format(_("Row %i"), childId);
|
||||
}
|
||||
else
|
||||
{
|
||||
*name = itemName;
|
||||
}
|
||||
}
|
||||
|
||||
return wxACC_OK;
|
||||
}
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
|
||||
#endif // wxUSE_DATAVIEWCTRL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user