Class: Wx::Accessible
Overview
The Accessible class allows wxWidgets applications, and wxWidgets itself, to return extended information about user interface elements to client applications such as screen readers.
This is the main way in which wxWidgets implements accessibility features. At present, only Microsoft Active Accessibility is supported by this class. To use this class, derive from Accessible, implement appropriate functions, and associate an object of the class with a window using Window#set_accessible. All functions return an indication of success, failure, or not implemented using values of the AccStatus enum type. If you return ACC_NOT_IMPLEMENTED from any function, the system will try to implement the appropriate functionality. However this will not work with all functions. Most functions work with an object id, which can be zero to refer to ‘this’ UI element, or greater than zero to refer to the nth child element. This allows you to specify elements that don’t have a corresponding Window or Accessible; for example, the sash of a splitter window. For details on the semantics of functions and types, please refer to the Microsoft Active Accessibility 1.2 documentation. This class is compiled into wxWidgets only if the Setup::USE_ACCESSIBILITY setup symbol is set to 1. Availability: only available for the WXMSW port.
Category: Miscellaneous
Class Method Summary collapse
-
.notify_event(eventType, window, objectType, objectId) ⇒ void
Allows the application to send an event when something changes in an accessible object.
Instance Method Summary collapse
-
#do_default_action(childId) ⇒ Wx::AccStatus
Performs the default action for the object.
-
#get_child(childId) ⇒ Array(Wx::AccStatus,Wx::Accessible)
(also: #child)
Gets the specified child (starting from 1).
-
#get_child_count ⇒ Array(Wx::AccStatus,Integer)
(also: #child_count)
Returns the number of children in childCount.
-
#get_default_action(childId) ⇒ Array(Wx::AccStatus,String)
(also: #default_action)
Gets the default action for this object (0) or a child (greater than 0).
-
#get_description(childId) ⇒ Array(Wx::AccStatus,String)
(also: #description)
Returns the description for this object or a child.
-
#get_focus ⇒ Array(Wx::AccStatus,Integer,Wx::Accessible)
(also: #focus)
Gets the window with the keyboard focus.
-
#get_help_text(childId) ⇒ Array(Wx::AccStatus,String)
(also: #help_text)
Returns help text for this object or a child, similar to tooltip text.
-
#get_keyboard_shortcut(childId) ⇒ Array(Wx::AccStatus,String)
(also: #keyboard_shortcut)
Returns the keyboard shortcut for this object or child.
-
#get_location(rect, elementId) ⇒ Wx::AccStatus
(also: #location)
Returns the rectangle for this object (id is 0) or a child element (id is greater than 0).
-
#get_name(childId) ⇒ Array(Wx::AccStatus,String)
(also: #name)
Gets the name of the specified object.
-
#get_parent ⇒ Array(Wx::AccStatus,Wx::Accessible)
(also: #parent)
Returns the parent of this object, or NULL.
-
#get_role(childId) ⇒ Array(Wx::AccStatus,Wx::AccRole)
(also: #role)
Returns a role constant describing this object.
-
#get_selections(selections) ⇒ Wx::AccStatus
(also: #selections)
Gets a variant representing the selected children of this object.
-
#get_state(childId) ⇒ Array(Wx::AccStatus,Integer)
(also: #state)
Returns a state constant.
-
#get_value(childId) ⇒ Array(Wx::AccStatus,String)
(also: #value)
Returns a localized string representing the value for the object or child.
-
#get_window ⇒ Wx::Window
(also: #window)
Returns the window associated with this object.
-
#hit_test(pt) ⇒ Array(Wx::AccStatus,Integer,Wx::Accessible)
Returns a status value and object id to indicate whether the given point was on this or a child object.
-
#initialize(win = nil) ⇒ Wx::Accessible
constructor
Constructor, taking an optional window.
-
#navigate(navDir, fromId) ⇒ Array(Wx::AccStatus,Integer,Wx::Accessible)
Navigates from fromId to toId or to toObject.
-
#select(childId, selectFlags) ⇒ Wx::AccStatus
Selects the object or child.
-
#set_window(window) ⇒ void
(also: #window=)
Sets the window associated with this object.
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize(win = nil) ⇒ Wx::Accessible
Constructor, taking an optional window.
The object can be associated with a window later.
33 |
# File 'lib/wx/doc/gen/accessible.rb', line 33 def initialize(win=nil) end |
Class Method Details
.notify_event(eventType, window, objectType, objectId) ⇒ void
This method returns an undefined value.
Allows the application to send an event when something changes in an accessible object.
189 |
# File 'lib/wx/doc/gen/accessible.rb', line 189 def self.notify_event(eventType, window, objectType, objectId) end |
Instance Method Details
#do_default_action(childId) ⇒ Wx::AccStatus
Performs the default action for the object.
childId is 0 (the action for this object) or greater than 0 (the action for a child). Wx::ACC_NOT_SUPPORTED if there is no default action for this window (e.g. an edit control).
41 |
# File 'lib/wx/doc/gen/accessible.rb', line 41 def do_default_action(childId) end |
#get_child(childId) ⇒ Array(Wx::AccStatus,Wx::Accessible) Also known as: child
Gets the specified child (starting from 1).
If child is NULL and the return value is Wx::ACC_OK, this means that the child is a simple element and not an accessible object.
48 |
# File 'lib/wx/doc/gen/accessible.rb', line 48 def get_child(childId) end |
#get_child_count ⇒ Array(Wx::AccStatus,Integer) Also known as: child_count
Returns the number of children in childCount.
53 |
# File 'lib/wx/doc/gen/accessible.rb', line 53 def get_child_count; end |
#get_default_action(childId) ⇒ Array(Wx::AccStatus,String) Also known as: default_action
Gets the default action for this object (0) or a child (greater than 0).
Return Wx::ACC_OK even if there is no action. actionName is the action, or the empty string if there is no action. The retrieved string describes the action that is performed on an object, not what the object does as a result. For example, a toolbar button that prints a document has a default action of “Press” rather than “Prints the current document.”
62 |
# File 'lib/wx/doc/gen/accessible.rb', line 62 def get_default_action(childId) end |
#get_description(childId) ⇒ Array(Wx::AccStatus,String) Also known as: description
Returns the description for this object or a child.
68 |
# File 'lib/wx/doc/gen/accessible.rb', line 68 def get_description(childId) end |
#get_focus ⇒ Array(Wx::AccStatus,Integer,Wx::Accessible) Also known as: focus
Gets the window with the keyboard focus.
If childId is 0 and child is NULL, no object in this subhierarchy has the focus. If this object has the focus, child should be ‘this’.
75 |
# File 'lib/wx/doc/gen/accessible.rb', line 75 def get_focus; end |
#get_help_text(childId) ⇒ Array(Wx::AccStatus,String) Also known as: help_text
Returns help text for this object or a child, similar to tooltip text.
81 |
# File 'lib/wx/doc/gen/accessible.rb', line 81 def get_help_text(childId) end |
#get_keyboard_shortcut(childId) ⇒ Array(Wx::AccStatus,String) Also known as: keyboard_shortcut
Returns the keyboard shortcut for this object or child.
Returns e.g. ALT+K.
89 |
# File 'lib/wx/doc/gen/accessible.rb', line 89 def get_keyboard_shortcut(childId) end |
#get_location(rect, elementId) ⇒ Wx::AccStatus Also known as: location
Returns the rectangle for this object (id is 0) or a child element (id is greater than 0).
rect is in screen coordinates.
98 |
# File 'lib/wx/doc/gen/accessible.rb', line 98 def get_location(rect, elementId) end |
#get_name(childId) ⇒ Array(Wx::AccStatus,String) Also known as: name
Gets the name of the specified object.
104 |
# File 'lib/wx/doc/gen/accessible.rb', line 104 def get_name(childId) end |
#get_parent ⇒ Array(Wx::AccStatus,Wx::Accessible) Also known as: parent
Returns the parent of this object, or NULL.
109 |
# File 'lib/wx/doc/gen/accessible.rb', line 109 def get_parent; end |
#get_role(childId) ⇒ Array(Wx::AccStatus,Wx::AccRole) Also known as: role
Returns a role constant describing this object.
See Wx::AccRole for a list of these roles.
117 |
# File 'lib/wx/doc/gen/accessible.rb', line 117 def get_role(childId) end |
#get_selections(selections) ⇒ Wx::AccStatus Also known as: selections
Gets a variant representing the selected children of this object.
Acceptable values are:
-
a null variant (
IsNull()
returns true) if no children are selected -
a
void*
pointer to a Wx::Accessible of selected child object -
an integer representing the selected child element, or 0 if this object is selected (
GetType()
==
"long"
) -
a list variant (
GetType()
==
"list"
) if multiple child objects are selected
133 |
# File 'lib/wx/doc/gen/accessible.rb', line 133 def get_selections(selections) end |
#get_state(childId) ⇒ Array(Wx::AccStatus,Integer) Also known as: state
Returns a state constant.
See Wx::AccStatus for a list of these states.
141 |
# File 'lib/wx/doc/gen/accessible.rb', line 141 def get_state(childId) end |
#get_value(childId) ⇒ Array(Wx::AccStatus,String) Also known as: value
Returns a localized string representing the value for the object or child.
147 |
# File 'lib/wx/doc/gen/accessible.rb', line 147 def get_value(childId) end |
#get_window ⇒ Wx::Window Also known as: window
Returns the window associated with this object.
152 |
# File 'lib/wx/doc/gen/accessible.rb', line 152 def get_window; end |
#hit_test(pt) ⇒ Array(Wx::AccStatus,Integer,Wx::Accessible)
Returns a status value and object id to indicate whether the given point was on this or a child object.
Can return either a child object, or an integer representing the child element, starting from 1. pt is in screen coordinates.
161 |
# File 'lib/wx/doc/gen/accessible.rb', line 161 def hit_test(pt) end |
#navigate(navDir, fromId) ⇒ Array(Wx::AccStatus,Integer,Wx::Accessible)
Navigates from fromId to toId or to toObject.
167 |
# File 'lib/wx/doc/gen/accessible.rb', line 167 def navigate(navDir, fromId) end |
#select(childId, selectFlags) ⇒ Wx::AccStatus
Selects the object or child.
See Wx::AccSelectionFlags for a list of the selection actions.
175 |
# File 'lib/wx/doc/gen/accessible.rb', line 175 def select(childId, selectFlags) end |
#set_window(window) ⇒ void Also known as: window=
This method returns an undefined value.
Sets the window associated with this object.
180 |
# File 'lib/wx/doc/gen/accessible.rb', line 180 def set_window(window) end |