Implement wxDataViewCustomRenderer::GetAccessibleDescription()

This is a default description of the renderer content (for accessibility purposes).
Thanks to this implementation there is not necessary to override GetAccessibleDescription() in the renderers derived from wxDataViewCustomRenderer.
This commit is contained in:
Artur Wieczorek
2016-10-30 20:59:51 +01:00
parent fb219aaf35
commit 9b8f46df36
3 changed files with 31 additions and 3 deletions

View File

@@ -1012,6 +1012,29 @@ wxDataViewCustomRenderer::wxDataViewCustomRenderer( const wxString &varianttype,
{
}
#if wxUSE_ACCESSIBILITY
wxString wxDataViewCustomRenderer::GetAccessibleDescription() const
{
wxVariant val;
GetValue(val);
wxString strVal;
if ( val.IsType(wxS("bool")) )
{
/* TRANSLATORS: Name of Boolean true value */
strVal = val.GetBool() ? _("true")
/* TRANSLATORS: Name of Boolean false value */
: _("false");
}
else
{
strVal = val.MakeString();
}
return strVal;
}
#endif // wxUSE_ACCESSIBILITY
// ---------------------------------------------------------
// wxDataViewTextRenderer
// ---------------------------------------------------------