Re: Minimum events and attributes to support to make a custom view accessible
Re: Minimum events and attributes to support to make a custom view accessible
- Subject: Re: Minimum events and attributes to support to make a custom view accessible
- From: Guy Fullerton <email@hidden>
- Date: Tue, 14 Dec 2004 14:04:30 -0800
On Dec 14, 2004, at 1:34 PM, David Niemeijer wrote:
Hi,
I am working on making a custom view with nested custom views
accessible and am running into more problems than I would want. The
documentation still seems to be pretty sparse. I found:
http://developer.apple.com/releasenotes/Accessibility/AssistiveAPI.html
http://developer.apple.com/documentation/Carbon/Conceptual/
MakingAppsAccessible/index.html
+
CarbonEvents.h
AXConstants.h
I could not find any sample code illustrating making a Carbon
application accessible in the sample code area for accessibility
<http://developer.apple.com/samplecode/Accessibility/index-date.html>,
but perhaps one or more of the regular samples shows this. If so
please let me know which one(s) to look at.
Unfortunately, I don't think we have a good example of a custom HIView
with accessibility support yet.
Anyway, I figured that it would be best to start out by supporting a
minimum set of carbon accessibility events and a minimum number of
attributes. When I have that working I can add more goodies. Could
anyone here tell me what the minimum would be to make applications
such as UIElement Inspector and UI Browser at least provide basic
access to my custom HIViews?
Since it's a custom HIView, the following attributes will be taken care
of for you:
AXChildren
AXParent
AXSize
AXPosition
AXEnabled
AXWindow
AXTopLevelUIElement
AXHelp
AXFocused
The HIView subsystem will also properly handle the
kEventAccessibleGetChildAtPoint and kEventAccessibleGetChildAtFocus
events.
You are responsible for providing and handling any attributes that
describe how your custom HIView looks or behaves:
AXRole
AXTitle (if appropriate)
AXValue, Min, Max
etc.
You are also responsible for providing and handling any actions that
your custom HIView needs to support.
With what I implemented so far I get my custom views still reported as
unknown in UI browser, though it does show the proper hierarchy. so my
guess is I may still be missing some vital attribute (I currently
support kAXRoleAttribute, kAXRoleDescriptionAttribute,
kAXChildrenAttribute).
It sounds like you have a bug. If the proper hierarchy is there, then
the events are being delivered to the views, so your handlers should be
being called to allow you to specify the values for those attributes.
Are you handling the kEventAccessibleGetAllAttributeNames event, too?
I am also still unsure about how to use
AXUIElementCreateWithHIObjectAndIdentifier. If I am asked for a list
of my children I can call this on their HIViews and add that to a
CFArray to pass back
Yes. (The default handlers for a given HIView will automatically do
this in response to a kEventAccessibleGetNamedAttribute + AXChildren
event, so you shouldn't have to do any work here ... unless you're
trying to add additional children above and beyond the ones the default
handlers provide.)
(or should I ask them somehow for their AXUIElementRef?).
No. If you want to create an AXUIElementRef that represents a whole
HIViewRef, call AXUIElementCreateWithHIObjectAndIdentifier with the
HIViewRef and an identifier of zero.
If I am later again requested for my children do I need to give back
the exact same AXUIElementRefs or can I make new ones by calling
AXUIElementCreateWithHIObjectAndIdentifier again?
Either way is fine. In the toolbox, we create new AXUIElementRefs every
time we are asked for them. (The code ends up being simpler that way.)
If I am asked about my parent, should I get my superview and call
AXUIElementCreateWithHIObjectAndIdentifier to get an AXUIElementRef?
Or, should I ask the superview somehow for it and then pass that back
if my kAXParentAttribute is requested?
As above.
Thanks,
david.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden