Re: Role descriptions for custom controls
Re: Role descriptions for custom controls
- Subject: Re: Role descriptions for custom controls
- From: Mike Engber <email@hidden>
- Date: Mon, 10 Jul 2006 08:52:37 -0700
The AppKit classes that are already accessorized (e.g. NSView,
NSCell, ...) already implement the role description using
NSAccessibilityRoleDescription.
So, in your case, you should not need to call
NSAccessibilityRoleDescription in accessibilityAttributeValue. A call
to super should return the right thing.
The only time you'd need to call NSAccessibilityRoleDescription is if
you're accessorizing a class from scratch.
This applies to other attributes as well. I.e. you should be
inheriting the right behavior for most attributes. All you need to do
is override values for the ones that are "wrong" and call super for
the others.
-ME
On Jul 3, 2006, at 11:26 AM, James Dempsey wrote:
Ricky - not sure if this got through, so am resending,
In Cocoa, you can get the role description with
NSString *NSAccessibilityRoleDescription(NSString *role, NSString
*subrole);
You will find it, and a number of other helpful utility functions
in NSAccessibility.h.
Another related function is NSString
*NSAccessibilityActionDescription(NSString *action);
Also, you might find these functions useful for traversing the
accessibility hierarchy:
APPKIT_EXTERN id NSAccessibilityUnignoredAncestor(id element);
APPKIT_EXTERN id NSAccessibilityUnignoredDescendant(id element);
APPKIT_EXTERN NSArray *NSAccessibilityUnignoredChildren(NSArray
*originalChildren);
APPKIT_EXTERN NSArray *NSAccessibilityUnignoredChildrenForOnlyChild
(id originalChild);
In cases where I have a UI object that has no Apple equivalent, I
do know that I'd need to provide both the role and description
(basically what the Clock Control example code does).
Wherever possible, please use existing roles, if the behavior of
your UI object is the same or very similar to an existing element.
For instance, radio buttons, the segmented control, and the tabs of
a tab view are all accessorized as AXRadioButton, since they all
give the user the ability to select one choice of a number of items.
You might also want to take a look at the AXCanvas example in /
Developer/Accessibility/AXCanvas.
I hope this helps.
-James
--------------------------------------------------
James Dempsey
AppKit Engineering
Apple
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (Accessibility-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
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