Re: NSComboBox initialFirstResponder and nextKeyView Outlets
Re: NSComboBox initialFirstResponder and nextKeyView Outlets
- Subject: Re: NSComboBox initialFirstResponder and nextKeyView Outlets
- From: Stephen Magyari <email@hidden>
- Date: Wed, 13 Mar 2002 21:59:50 -0800
I don't remember the specifics of the original thread... But it sounds like
you don't want the value to be changed, but you do want the user to still be
able to see what the available options were...
Forgive me if I'm running off on a tangent to nowheresville or
overcomplicating the obvious, but one of the major benefits behind a
ComboBox is that the user can tab to it and start typing to auto-select a
value.
I'm left wondering why you would want the user to be able to tab to the
control if you don't want them to edit the value -- it seems
counter-intuitive. Granted I'm not "all users", but from my viewpoint (from
a usability perspective) it makes sense that tabbing would/should skip over
items that aren't currently editable anyway; otherwise the user is left
wondering why they can access the field but not change it... not to mention
the wasted keystroke.
You said you want the user to "use the tab key to tab through all of the
various input items in the gui and enter all of the information without
using a mouse". Well, if you don't want the item to be editable in the
first place, what information is there for the user to enter? If the
control is just plain not editable at all by anyone, then I'd wonder why
it's even on the interface...
I'm new to Cocoa and fairly new to programming in general, so I'm by no
means an expert... However, a possible workaround (assuming that users
would, at some point, be able to edit the value of the control) might be to
use NSPopUpButton, which does what you're describing (almost) off the shelf.
You would need to do some validation of the menu items so that the current
value (that you don't want the user to change -- yet) is the only selectable
one. That way when they tab to it and it has focus, then can use the down
arrow or the spacebar to see the other options, but the validation you
implement would dim those options, preventing the user from selecting them.
From what I've read in the docs and on this list, that might be a possible
route to explore if no one else chimes in with a more elegant (and probably
simpler) solution...
Just my 2 cents (feel free to make change...)
Stephen
on 3/13/02 11:17 AM, CHIMPO at email@hidden wrote:
>
I was kind of able to get it to work by making the combo box editable, but
>
I don't want it to be editable. I want a user to be able to use the tab
>
key to tab through all of the various input items in the gui and enter all
>
of the information without using a mouse. For example, in MFC under
>
Windows, I can create an uneditable combo box that a user can tab to and
>
press the down arrow key to select one of the items in the list. I have
>
not been able to do that in Cocoa as of yet. Any help would be great. If
>
it is not possible to do this, I would be severly disappointed.
>
>
Scott
>
>
>
> In IB, combo boxes appear to have three relevant attributes:
>
editable,> selectable, and enabled. My guess is that you want to change
>
one or two> of those attributes; perhaps you want it to be enabled and
>
selectable,> but not editable? From your description I'm not sure exactly
>
what> you're trying to do, though, so that's about as much advice as I can
>
> give.
>
> The doc should tell you the methods to set these attributes, if you
>
> can't use IB for some reason. Note the attributes might only be
>
> accessible via a superclass method, or via a method on a cell kept by
>
> the control. Finding the method that does what you want for an
>
> NSControl subclass that uses a cell to draw is always a bit of an
>
> adventure. :->
>
>
>
> Ben Haller
>
> Stick Software
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.