Re: Role descriptions for custom controls
Re: Role descriptions for custom controls
- Subject: Re: Role descriptions for custom controls
- From: Ricky Sharp <email@hidden>
- Date: Mon, 03 Jul 2006 13:57:55 -0500
> 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);
Thanks for pointing that out. I missed that one when going through the docs.
> 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);
I don't know if I'll need these as my app's accessibility structure appears to be correct. I do have custom containers, but since they derive from NSView, they are being properly ignored.
> 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.
I do plan on reusing as much as possible.
There are two UI elements I have that may be a bit tricky. One is what I call a "value field". Basically, it's a non-editable text field paired with steppers (aka little arrows). But rather than being two separate UI elements, I have a single control/cell that encapsulates both. I'm thinking of using a role of NSAccessibilityIncrementorRole. I'll also not only allow the default inc/dec actions, but a "set value" action as well to set an arbitrary value within the min/max range.
The second element is what I call a "switch group" (NSMatrix subclass). Basically a multiple-select group. Not really sure if NSAccessibilityListRole fits here, so I may need to look at alternatives. I guess the cells themselves could be checkbox roles since they work exactly as checkboxes; they toggle on/off. But the matrix itself would need a role and so perhaps NSAccessibilityGroupRole.
> You might also want to take a look at the AXCanvas example in /Developer/Accessibility/AXCanvas.
>
> I hope this helps.
It definitely does. Thanks, James!
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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