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:
parent
dbb2781199
commit
fa4b077421
@ -1304,17 +1304,9 @@ public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewTreeCtrlAccessible;
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewTreeCtrl: public wxDataViewCtrl,
|
||||
public wxWithImages
|
||||
{
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
friend class wxDataViewTreeCtrlAccessible;
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
|
||||
public:
|
||||
wxDataViewTreeCtrl() { }
|
||||
wxDataViewTreeCtrl(wxWindow *parent,
|
||||
@ -1386,10 +1378,6 @@ public:
|
||||
void OnCollapsed( wxDataViewEvent &event );
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
virtual wxAccessible* CreateAccessible() wxOVERRIDE;
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
|
||||
private:
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl);
|
||||
@ -1416,21 +1404,6 @@ private:
|
||||
#define wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE
|
||||
#define wxEVT_COMMAND_DATAVIEW_ITEM_DROP wxEVT_DATAVIEW_ITEM_DROP
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDataViewTreeCtrlAccessible
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewTreeCtrlAccessible: public wxDataViewCtrlAccessible
|
||||
{
|
||||
public:
|
||||
wxDataViewTreeCtrlAccessible(wxDataViewTreeCtrl* win);
|
||||
virtual ~wxDataViewTreeCtrlAccessible() {};
|
||||
|
||||
virtual wxAccStatus GetName(int childId, wxString* name) wxOVERRIDE;
|
||||
};
|
||||
#endif // wxUSE_ACCESSIBILITY
|
||||
|
||||
#endif // wxUSE_DATAVIEWCTRL
|
||||
|
||||
#endif
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user