Re: Custom Control with AXSlider Role
Re: Custom Control with AXSlider Role
- Subject: Re: Custom Control with AXSlider Role
- From: James Dempsey <email@hidden>
- Date: Mon, 9 Mar 2009 18:01:19 -0700
On Mar 9, 2009, at 5:04 PM, Chris Suter wrote:
Hi,
I've recently been working on some accessibility stuff for our
application and I've run into a number of problems.
Our situation is that we have a pie chart with slices that can be
resized. We present the pie chart as an AXList and each pie slice as
an AXSlider.
First, I think I encountered the bug described in this thread:
<http://lists.apple.com/archives/accessibility-dev/2006/Nov/msg00019.html
>
As we were resizing pie slices, VoiceOver wouldn't notice the updates
as our accessibility UI element wasn't derived from NSView. To
workaround this, I implemented the undocumented -
(BOOL)accessibilityShouldUseUniqueId method and made sure that I clean
up by calling NSAccessibilityUnregisterUniqueIdForUIElement (self)
in my dealloc method. So I don't need help with that, but it might
help someone else.
Those functions/methods are not documented because they are not
public. Like any use of private functions/methods, there is the risk
that your app will break in some fashion with a future release of the
operating system.
That said, it is an existing limitation of the public API that this is
not possible, and it is a known issue.
The second issue that I have is that as the slices are resized, the
focus rectangle used for VoiceOver doesn't get updated even though we
send all the appropriate notifications. I'd be interested in any
suggestions for working around that.
That is probably because VoiceOver is not expecting an AXSlider to
change size or position when its value changes, since that is not how
AXSliders typically behave.
One thing that might get the behavior you are looking for is to post
the NSAccessibilityFocusedUIElementChanged notification for the slice
element after it is resized. I believe this will cause VoiceOver to
refocus on the same element again, and fetch its new size and position.
The third issue is that VoiceOver insists on adding the word
"horizontal" or "vertical" which clearly isn't appropriate for us. Any
ideas as to how we might get rid of that?
In the end, an AXList of AXSliders is not ideal to represent a pie
chart with adjustable slices, but given the current set of AX roles,
it is probably the best fit.
Every time we introduce a new role, it is another kind of element that
assistive applications need to update to include, and assistive app
users, such as VoiceOver users, need to learn about how to interact
with a new type of element. So, it's always a balance between where
we define as a role and where we use existing roles in somewhat
different ways than their original intent.
Since these elements are reporting themselves as sliders, VoiceOver is
going to treat them like sliders, and sliders have an orientation.
Remember that a VoiceOver user is going to understand this control as
a list of sliders, since that is what it is described as. Pick an
orientation for the list (AXVerticalOrientation maybe) and one for the
sliders (AXHorizontalOrientation, maybe), and that is probably the
best way to go.
Definitely file a bug requesting roles for chart elements, they may be
common enough elements to warrant a set of roles and attributes.
-James
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility-
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--------------------------------------------------
James Dempsey
AppKit Engineering
Apple
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