Create wxAccessible object on demand in wxDVC

Create wxAccessible objects only in response to calls to GetOrCreateAccessible() to save resources.
This commit is contained in:
Artur Wieczorek
2016-10-16 23:48:27 +02:00
parent 90e1769569
commit cfe0eaa7f2
4 changed files with 56 additions and 23 deletions

View File

@@ -2570,10 +2570,6 @@ bool wxDataViewTreeCtrl::Create( wxWindow *parent, wxWindowID id,
0 // not resizable
);
#if wxUSE_ACCESSIBILITY
SetAccessible(new wxDataViewTreeCtrlAccessible(this));
#endif // wxUSE_ACCESSIBILITY
return true;
}
@@ -2743,6 +2739,13 @@ 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