gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBrowser modifications ?


From: Nicola Pero
Subject: Re: NSBrowser modifications ?
Date: Wed, 20 Jun 2001 14:31:09 +0100 (BST)

> > While playing around with the NSBrowser, i added the possibilities to
> > move in it using the page up/page down keys & the alphanumerical keys :
> >  - pressing 'c' select the first item starting with a 'c' (wrapping around
> >     if necessary)
> > 
> > do you think this behaviour should be added to NSBrowser ?
> 
> Add the alphanumerical keys in NSMatrix. 

Ahm - hm - while I would heartily agree on pageUp/pageDown, I wouldn't add
alphanumerical keys at all.

Because if an application doesn't want them, then it needs to subclass
NSMatrix, catch all key down events, and discard the ones it doesn't want
and then call super's implementation.  This is very ugly.

And in most matrices, you don't want them.  For example, in a radio matrix
(say in a preference panel) with long texts for each cell (in which case
the first letter has no relevance to the actual contents of the cell), you
don't want the selection to silently jump to a random cell when the user
is absent-minded and presses a random button on the keyboard without
realizing.  Also because, how does the user gets back to the previously
selected cell ?  The new position does not bear any particular logical
relationship to the previous cell, so if the user by mistake press a key
(without realizing), there is no way to get back (or figuring out what has
happened) unless he remembers the previous selection.


> The pageUp/Down stuff could go in NSBrowser since the matrix is not 
> the best place. (specially for matrix with multiple columns)

Just a quick thought - might be stupid - but I wonder whether it shouldn't
go into NSView instead.

In NSView, we could check whether there is an enclosing scrollview, and in
that case, scroll the enclosing scrollview.

That would make sure that whenever you press PageUp/PageDown in *any* view
which is inside a scrollview, the scrollview is scrolled (without us
having to implement that for *each* type of control - and we would still
be missing anyway custom controls/views which would have to implement that
themselves).

In the browser I suppose you would then pass the key down to the matrix,
which would pass to superview, which sooner or later would be NSView and
which would scroll the enclosing scrollview.


> > By the way how can one recognize a unicode character which is not a
> > function key (i.e. that can be displayed) ?
> > (i use (character < 0xF700) is it the right way ?)

The NSFunctionKeyMask mask should be set for the keyboard event, if the
keyboard event is actually a function key, that is one of the unicode like
NSUndoFunctionKey.  Let me know if it doesn't work, I thought it did.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]