Class: Wx::Accessible

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

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

See Also:

  • Sample

Requires:

  • USE_ACCESSIBILITY

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:



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.

Parameters:

  • eventType (Integer)
  • window (Wx::Window)
  • objectType (Wx::AccObject)
  • objectId (Integer)


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

Parameters:

  • childId (Integer)

Returns:

  • (Wx::AccStatus)


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.

Parameters:

  • childId (Integer)

Returns:



48
# File 'lib/wx/doc/gen/accessible.rb', line 48

def get_child(childId) end

#get_child_countArray(Wx::AccStatus,Integer) Also known as: child_count

Returns the number of children in childCount.

Returns:

  • (Array(Wx::AccStatus,Integer))


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

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,String))


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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,String))


68
# File 'lib/wx/doc/gen/accessible.rb', line 68

def get_description(childId) end

#get_focusArray(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’.

Returns:



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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,String))


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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,String))


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.

Parameters:

Returns:

  • (Wx::AccStatus)


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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,String))


104
# File 'lib/wx/doc/gen/accessible.rb', line 104

def get_name(childId) end

#get_parentArray(Wx::AccStatus,Wx::Accessible) Also known as: parent

Returns the parent of this object, or NULL.

Returns:



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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,Wx::AccRole))


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

Parameters:

Returns:

  • (Wx::AccStatus)


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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,Integer))


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.

Parameters:

  • childId (Integer)

Returns:

  • (Array(Wx::AccStatus,String))


147
# File 'lib/wx/doc/gen/accessible.rb', line 147

def get_value(childId) end

#get_windowWx::Window Also known as: window

Returns the window associated with this object.

Returns:



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.

Parameters:

Returns:



161
# File 'lib/wx/doc/gen/accessible.rb', line 161

def hit_test(pt) end

Navigates from fromId to toId or to toObject.

Parameters:

  • navDir (Wx::NavDir)
  • fromId (Integer)

Returns:



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.

Parameters:

  • childId (Integer)
  • selectFlags (Wx::AccSelectionFlags)

Returns:

  • (Wx::AccStatus)


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.

Parameters:



180
# File 'lib/wx/doc/gen/accessible.rb', line 180

def set_window(window) end