Class: Wx::SVGAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/svg_file_dc.rb

Overview

Note:

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

Requires:

  • USE_SVG

Instance Method Summary collapse

Constructor Details

#initializeWx::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.

Parameters:

  • name (String)
  • value (String)

Returns:



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.

Parameters:

  • id (String)

Returns:



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).

Parameters:

  • id (String)

Returns:



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.

Parameters:

  • hidden (Boolean) (defaults to: true)

Returns:



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.

Parameters:

  • label (String)

Returns:



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.

Parameters:

  • id (String)

Returns:



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").

Parameters:

  • desc (String)

Returns:



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.

Parameters:

  • classname (String)

Returns:



330
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 330

def class_(classname) end

#get_aria_described_byString

Returns the aria-describedby attribute.

Returns:

  • (String)


286
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 286

def get_aria_described_by; end

#get_aria_detailsString

Returns the aria-details attribute.

Returns:

  • (String)


307
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 307

def get_aria_details; end

#get_aria_labelString

Returns the aria-label attribute.

Returns:

  • (String)


268
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 268

def get_aria_label; end

#get_aria_labelled_byString

Returns the aria-labelledby attribute.

Returns:

  • (String)


277
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 277

def get_aria_labelled_by; end

#get_aria_role_descriptionString

Returns the aria-roledescription attribute.

Returns:

  • (String)


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.

Parameters:

  • name (String)

Returns:

  • (String)


350
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 350

def get_attribute(name) end

#get_classString Also known as: class

Returns the class attribute.

Returns:

  • (String)


334
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 334

def get_class; end

#get_idString

Returns the id attribute.

Returns:

  • (String)


325
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 325

def get_id; end

#get_roleString

Returns the role attribute.

Returns:

  • (String)


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.

Parameters:

  • id (String)

Returns:



321
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 321

def id(id) end

#is_aria_hiddenBoolean Also known as: aria_hidden?

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

Returns:

  • (Boolean)


297
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 297

def is_aria_hidden; end

#is_emptyBoolean Also known as: empty?

Returns true if no attributes have been set.

Returns:

  • (Boolean)


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".

Parameters:

  • role (String)

Returns:



253
# File 'lib/wx/doc/gen/svg_file_dc.rb', line 253

def role(role) end