Re: Tabbing between cells in a complex control
Re: Tabbing between cells in a complex control
- Subject: Re: Tabbing between cells in a complex control
- From: Graham Cox <email@hidden>
- Date: Mon, 1 Feb 2010 10:17:58 +1100
On 01/02/2010, at 7:03 AM, Charles Jenkins wrote:
> I have defined
> * A subclass of NSActionCell named CJIndicatorCell
> * A subclass of NSControl named CJDistributionControl
>
> The distribution control will contain more than one indicator cell. I have had no problem designing the control to the point where the cells can draw themselves and the control can manage them and everything displays properly, but the thing I'm not finding in Apple's documentation is how to make the individual cells become part of the responder chain (or at least act like it).
Just a note about terminology - the 'responder chain' is not the chain of widgets that the user can tab through, rather it is a 'vertical' chain of objects that can respond to user generated events, starting with some specific control or view and ending with the application as a whole.
What you are really talking about is a 'horizontal' chain of sibling controls at one level within the responder chain.
> I want to be able to tab from indicator to indicator when the control is on the screen. The purpose is to allow the user to use the keyboard to tab down to one of the indicators and adjust its value with the arrow keys.
>
> I guess another way to state it is that where a normal control takes up ONE position in the responder chain, this control will need to take X positions, where X is the number of indicators it is displaying.
I think you'd do this by trapping the tab and shift-tab key events within the cell and then focusing the next and so on. You'll probably have to handle all of it yourself, so you may want each cell to have a 'next cell' pointer and your control as a whole to have 'first cell' and 'last cell' pointer so you can figure out where to go next. When the last cell sees a tab, just call super to move to the next control in its entirety.
As far as I can see there's no built-in support for doing this above the level of raw event handling.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden