Class: Wx::SVGAttributes
- Inherits:
-
Object
- Object
- Wx::SVGAttributes
- Defined in:
- lib/wx/doc/gen/svg_file_dc.rb
Overview
This class is untracked and should not be derived from nor instances extended!
Helper class for building a set of SVG and ARIA attributes to attach to an accessible group in the output of 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#begin_accessible_group or to the SVGAccessibleGroup RAII helper. Example:
dc.BeginAccessibleGroup(
wxSVGAttributes().Role("img").AriaLabel("Quarterly sales"),
"Quarterly sales",
"Bar chart showing revenue for Q1-Q4 2026.");
// ... drawing commands ...
dc.EndAccessibleGroup();
Category: Device Contexts
Instance Method Summary collapse
-
#add(name, value) ⇒ Wx::SVGAttributes
Adds or updates an arbitrary attribute.
-
#aria_described_by(id) ⇒ Wx::SVGAttributes
Sets the
aria-describedbyattribute: points at the id of another element whose text content provides a longer description, announced after the accessible name. -
#aria_details(id) ⇒ Wx::SVGAttributes
Sets the
aria-detailsattribute: points at the id of another element containing extended information about this one (e.g., a data table describing a chart). -
#aria_hidden(hidden = true) ⇒ Wx::SVGAttributes
Sets the
aria-hiddenattribute. -
#aria_label(label) ⇒ Wx::SVGAttributes
Sets the
aria-labelattribute: a short accessible name read aloud by screen readers. -
#aria_labelled_by(id) ⇒ Wx::SVGAttributes
Sets the
aria-labelledbyattribute: instead of supplying a name inline, points at the id of another element whose text content provides the accessible name. -
#aria_role_description(desc) ⇒ Wx::SVGAttributes
Sets the
aria-roledescriptionattribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example"pie chart"instead of"graphic"). -
#class_(classname) ⇒ Wx::SVGAttributes
Sets the class attribute, used to associate the element with one or more CSS classes for styling the SVG output.
-
#get_aria_described_by ⇒ String
Returns the
aria-describedbyattribute. -
#get_aria_details ⇒ String
Returns the
aria-detailsattribute. -
#get_aria_label ⇒ String
Returns the
aria-labelattribute. -
#get_aria_labelled_by ⇒ String
Returns the
aria-labelledbyattribute. -
#get_aria_role_description ⇒ String
Returns the
aria-roledescriptionattribute. -
#get_attribute(name) ⇒ String
(also: #attribute)
Returns the value of the attribute with the given name.
-
#get_class ⇒ String
(also: #class)
Returns the class attribute.
-
#get_id ⇒ String
Returns the id attribute.
-
#get_role ⇒ String
Returns the role attribute.
-
#id(id) ⇒ Wx::SVGAttributes
Sets the id attribute, giving the element a unique identifier other attributes (such as
aria-labelledby) or stylesheets can reference. -
#initialize ⇒ Wx::SVGAttributes
constructor
Default constructor creates an empty set of attributes.
-
#is_aria_hidden ⇒ Boolean
(also: #aria_hidden?)
Returns true if the
aria-hiddenattribute is set to"true". -
#is_empty ⇒ Boolean
(also: #empty?)
Returns true if no attributes have been set.
-
#role(role) ⇒ Wx::SVGAttributes
Sets the role attribute, which classifies the element for assistive technology.
Constructor Details
#initialize ⇒ Wx::SVGAttributes
Default constructor creates an empty set of attributes.
246 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 246 def initialize; end |
Instance Method Details
#add(name, value) ⇒ Wx::SVGAttributes
Adds or updates an arbitrary attribute.
If name is already set, its value is replaced; otherwise a new entry is appended.
343 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 343 def add(name, value) end |
#aria_described_by(id) ⇒ Wx::SVGAttributes
Sets the aria-describedby attribute: points at the id of another element whose text content provides a longer description, announced after the accessible name.
282 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 282 def aria_described_by(id) end |
#aria_details(id) ⇒ Wx::SVGAttributes
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).
303 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 303 def aria_details(id) end |
#aria_hidden(hidden = true) ⇒ Wx::SVGAttributes
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.
293 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 293 def aria_hidden(hidden=true) end |
#aria_label(label) ⇒ Wx::SVGAttributes
Sets the aria-label attribute: a short accessible name read aloud by screen readers.
Use when no visible text label exists.
264 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 264 def aria_label(label) end |
#aria_labelled_by(id) ⇒ Wx::SVGAttributes
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.
273 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 273 def aria_labelled_by(id) end |
#aria_role_description(desc) ⇒ Wx::SVGAttributes
Sets the aria-roledescription attribute: a human-readable, optionally localized phrase that replaces the default spoken role (for example "pie chart" instead of "graphic").
312 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 312 def aria_role_description(desc) end |
#class_(classname) ⇒ Wx::SVGAttributes
Sets the class attribute, used to associate the element with one or more CSS classes for styling the SVG output.
330 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 330 def class_(classname) end |
#get_aria_described_by ⇒ String
Returns the aria-describedby attribute.
286 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 286 def get_aria_described_by; end |
#get_aria_details ⇒ String
Returns the aria-details attribute.
307 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 307 def get_aria_details; end |
#get_aria_label ⇒ String
Returns the aria-label attribute.
268 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 268 def get_aria_label; end |
#get_aria_labelled_by ⇒ String
Returns the aria-labelledby attribute.
277 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 277 def get_aria_labelled_by; end |
#get_aria_role_description ⇒ String
Returns the aria-roledescription attribute.
316 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 316 def get_aria_role_description; end |
#get_attribute(name) ⇒ String Also known as: attribute
Returns the value of the attribute with the given name.
Returns an empty string if the attribute is not set.
350 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 350 def get_attribute(name) end |
#get_class ⇒ String Also known as: class
Returns the class attribute.
334 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 334 def get_class; end |
#get_id ⇒ String
Returns the id attribute.
325 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 325 def get_id; end |
#get_role ⇒ String
Returns the role attribute.
257 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 257 def get_role; end |
#id(id) ⇒ Wx::SVGAttributes
Sets the id attribute, giving the element a unique identifier other attributes (such as aria-labelledby) or stylesheets can reference.
321 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 321 def id(id) end |
#is_aria_hidden ⇒ Boolean Also known as:
Returns true if the aria-hidden attribute is set to "true".
297 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 297 def is_aria_hidden; end |
#is_empty ⇒ Boolean Also known as: empty?
Returns true if no attributes have been set.
355 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 355 def is_empty; end |
#role(role) ⇒ Wx::SVGAttributes
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".
253 |
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 253 def role(role) end |