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¶
Methods Summary¶
Default constructor creates an empty set of attributes. |
|
Adds or updates an arbitrary attribute. |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the value of the attribute with the given name. |
|
Returns the |
|
Returns the |
|
Returns the |
|
Sets the |
|
Returns |
|
Returns |
|
Sets the |
Class API¶
- class wx.SVGAttributes(object)¶
Possible constructors:
SVGAttributes() -> None
Helper class for building a set of
SVGandARIAattributes 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:
- AriaDescribedBy(self, id)¶
Sets the
aria-describedbyattribute: points at theidof another element whose text content provides a longer description, announced after the accessible name.- Parameters:
id (string)
- Return type:
- AriaDetails(self, id)¶
Sets the
aria-detailsattribute: points at theidof another element containing extended information about this one (e.g., a data table describing a chart).- Parameters:
id (string)
- Return type:
- AriaHidden(self, hidden=True)¶
Sets the
aria-hiddenattribute.The default hidden value of
Trueis the common case (hide decorative content from assistive technology). PassingFalseis only meaningful when overriding an inheritedaria-hidden="true"on an ancestor.- Parameters:
hidden (bool)
- Return type:
- AriaLabel(self, label)¶
Sets the
aria-labelattribute: a short accessible name read aloud by screen readers.Use when no visible text label exists.
- Parameters:
label (string)
- Return type:
- AriaLabelledBy(self, id)¶
Sets the
aria-labelledbyattribute: instead of supplying a name inline, points at theidof another element whose text content provides the accessible name.- Parameters:
id (string)
- Return type:
- AriaRoleDescription(self, desc)¶
Sets the
aria-roledescriptionattribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example"pie chart"instead of"graphic").- Parameters:
desc (string)
- Return type:
- Class(self, classname)¶
Sets the
classattribute, used to associate the element with one or more CSS classes for styling theSVGoutput.- Parameters:
classname (string)
- Return type:
- GetAriaDescribedBy(self)¶
Returns the
aria-describedbyattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- GetAriaDetails(self)¶
Returns the
aria-detailsattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- GetAriaLabel(self)¶
Returns the
aria-labelattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- GetAriaLabelledBy(self)¶
Returns the
aria-labelledbyattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- GetAriaRoleDescription(self)¶
Returns the
aria-roledescriptionattribute.- 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
classattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- GetId(self)¶
Returns the
idattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- GetRole(self)¶
Returns the
roleattribute.- Return type:
str
Added in version 4.3/wxWidgets-3.3.3.
- Id(self, id)¶
Sets the
idattribute, giving the element a unique identifier other attributes (such asaria-labelledby) or stylesheets can reference.- Parameters:
id (string)
- Return type:
- IsAriaHidden(self)¶
Returns
Trueif thearia-hiddenattribute is set to"true".- Return type:
bool
Added in version 4.3/wxWidgets-3.3.3.
- IsEmpty(self)¶
Returns
Trueif no attributes have been set.- Return type:
bool
- Role(self, role)¶
Sets the
roleattribute, which classifies the element for assistive technology.Common
SVGvalues include"img"(the subtree is a single graphical image),"graphics-document", and"graphics-symbol".- Parameters:
role (string)
- Return type: