phoenix_title wx.SVGAttributes

Helper class for building a set of SVG and ARIA attributes to attach to an accessible group in the output of wx.SVGFileDC.

ARIA (Accessible Rich Internet Applications) is a W3C specification of attributes that describe the content to assistive technology such as screen readers.

The class exposes a chainable builder API so multiple attributes can be specified inline. The resulting object is passed to wx.SVGFileDC.BeginAccessibleGroup or to the SVGAccessibleGroup RAII helper.

Example:

Added in version 4.3/wxWidgets-3.3.3.


class_hierarchy Class Hierarchy

Inheritance diagram of SVGAttributes


method_summary Methods Summary

__init__

Default constructor creates an empty set of attributes.

Add

Adds or updates an arbitrary attribute.

AriaDescribedBy

Sets the aria-describedby attribute: points at the id of another element whose text content provides a longer description, announced after the accessible name.

AriaDetails

Sets the aria-details attribute: points at the id of another element containing extended information about this one (e.g., a data table describing a chart).

AriaHidden

Sets the aria-hidden attribute.

AriaLabel

Sets the aria-label attribute: a short accessible name read aloud by screen readers.

AriaLabelledBy

Sets the aria-labelledby attribute: instead of supplying a name inline, points at the id of another element whose text content provides the accessible name.

AriaRoleDescription

Sets the aria-roledescription attribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example "pie chart" instead of "graphic" ).

Class

Sets the class attribute, used to associate the element with one or more CSS classes for styling the SVG output.

GetAriaDescribedBy

Returns the aria-describedby attribute.

GetAriaDetails

Returns the aria-details attribute.

GetAriaLabel

Returns the aria-label attribute.

GetAriaLabelledBy

Returns the aria-labelledby attribute.

GetAriaRoleDescription

Returns the aria-roledescription attribute.

GetAttribute

Returns the value of the attribute with the given name.

GetClass

Returns the class attribute.

GetId

Returns the id attribute.

GetRole

Returns the role attribute.

Id

Sets the id attribute, giving the element a unique identifier other attributes (such as aria-labelledby ) or stylesheets can reference.

IsAriaHidden

Returns True if the aria-hidden attribute is set to "true" .

IsEmpty

Returns True if no attributes have been set.

Role

Sets the role attribute, which classifies the element for assistive technology.


api Class API

class wx.SVGAttributes(object)

Possible constructors:

SVGAttributes() -> None

Helper class for building a set of SVG and ARIA attributes to attach to an accessible group in the output of SVGFileDC.


Methods

__init__(self)

Default constructor creates an empty set of attributes.

Return type:

None



Add(self, name, value)

Adds or updates an arbitrary attribute.

If name is already set, its value is replaced; otherwise a new entry is appended.

Parameters:
  • name (string)

  • value (string)

Return type:

wx.SVGAttributes



AriaDescribedBy(self, id)

Sets the aria-describedby attribute: points at the id of another element whose text content provides a longer description, announced after the accessible name.

Parameters:

id (string)

Return type:

wx.SVGAttributes



AriaDetails(self, id)

Sets the aria-details attribute: points at the id of another element containing extended information about this one (e.g., a data table describing a chart).

Parameters:

id (string)

Return type:

wx.SVGAttributes



AriaHidden(self, hidden=True)

Sets the aria-hidden attribute.

The default hidden value of True is the common case (hide decorative content from assistive technology). Passing False is only meaningful when overriding an inherited aria-hidden="true" on an ancestor.

Parameters:

hidden (bool)

Return type:

wx.SVGAttributes



AriaLabel(self, label)

Sets the aria-label attribute: a short accessible name read aloud by screen readers.

Use when no visible text label exists.

Parameters:

label (string)

Return type:

wx.SVGAttributes



AriaLabelledBy(self, id)

Sets the aria-labelledby attribute: instead of supplying a name inline, points at the id of another element whose text content provides the accessible name.

Parameters:

id (string)

Return type:

wx.SVGAttributes



AriaRoleDescription(self, desc)

Sets the aria-roledescription attribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example "pie chart" instead of "graphic" ).

Parameters:

desc (string)

Return type:

wx.SVGAttributes



Class(self, classname)

Sets the class attribute, used to associate the element with one or more CSS classes for styling the SVG output.

Parameters:

classname (string)

Return type:

wx.SVGAttributes



GetAriaDescribedBy(self)

Returns the aria-describedby attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetAriaDetails(self)

Returns the aria-details attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetAriaLabel(self)

Returns the aria-label attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetAriaLabelledBy(self)

Returns the aria-labelledby attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetAriaRoleDescription(self)

Returns the aria-roledescription attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetAttribute(self, name)

Returns the value of the attribute with the given name.

Returns an empty string if the attribute is not set.

Parameters:

name (string)

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetClass(self)

Returns the class attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetId(self)

Returns the id attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



GetRole(self)

Returns the role attribute.

Return type:

str

Added in version 4.3/wxWidgets-3.3.3.



Id(self, id)

Sets the id attribute, giving the element a unique identifier other attributes (such as aria-labelledby ) or stylesheets can reference.

Parameters:

id (string)

Return type:

wx.SVGAttributes



IsAriaHidden(self)

Returns True if the aria-hidden attribute is set to "true" .

Return type:

bool

Added in version 4.3/wxWidgets-3.3.3.



IsEmpty(self)

Returns True if no attributes have been set.

Return type:

bool



Role(self, role)

Sets the role attribute, which classifies the element for assistive technology.

Common SVG values include "img" (the subtree is a single graphical image), "graphics-document" , and "graphics-symbol" .

Parameters:

role (string)

Return type:

wx.SVGAttributes