diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 0d8ccd766a..4b78de8a43 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -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 diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 0e8d2e3b2a..9957669610 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -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 -