• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom view, selection consistency with NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom view, selection consistency with NSTableView


  • Subject: Re: Custom view, selection consistency with NSTableView
  • From: Paul Szego <email@hidden>
  • Date: Sun, 17 Apr 2005 21:47:06 +1200


On 17/04/2005, at 8:48 PM, mmalcolm crawford wrote:


On Apr 17, 2005, at 1:26 AM, Paul Szego wrote:
On 17/04/2005, at 6:12 PM, mmalcolm crawford wrote:
On Apr 16, 2005, at 10:17 PM, Paul Szego wrote:
I assume you're referring to the GraphicsBinding example? If so, it's not quite what I'm after. I want to provide a contiguous selection, as my graphical layout does lend itself to the notion of ordering. So if you click on one object, and then shift-click on another it should make all objects in between selected also. The graphics binding example doesn't do this (I assume as the notion of ordering doesn't really apply here due to the layout of the dots).
The same principles apply.
The fact that it uses bindings is orthogonal to the selection. The example does support multiple selection from within the graphic view. It's up to you to write the selection logic for your own view...
Yes, I know this - the first part of the post says that's what I'm doing. I've already written code to cover the simple cases.
[...]
The question was: "... before I try to nail this down from observation, is it documented anywhere just what the "standard" behaviour is? [...]

From your original post:
"For selection with mouse clicks most things are possible, but I cannot figure out how to easily implement shift-clicking using the additional model so that it co-operates with the NSTableView."


It's not clear what you're after. Are you simply after HI guidelines, or is there a technical issue?


Both.

I want to implement selection in my view so that it's consistent with existing controls, so there are no surprises for the user. The documentation isn't up to scratch, so it seems I have to reverse engineer out the behaviour by observing existing controls. Is this a guideline issue (doco) or technical (how is Cocoa implemented) - take your pick.

Try this simple case:

My array controller has 10 objects, indexes 0 to 9.
1) I click on 0, the selection is (0)
2) I shift-click on 3, the selection in (0,1,2,3)
3) I command-click on 9, the selection is (0,1,2,3,9)
4) I shift-click on 7, what should the selection be now?

How to figure out the correct answer? The HI guide doesn't have enough detail. By observing NSTableView it results in selection of (0,1,2,3,7,8,9). Fine - I can try to generalise from that observation into a rule to augment the HI guide.

Now how to build it? If my control only observes the first three actions via a KVO notification of changes to 'selectionIndexes' of an NSArrayController, but the fourth click is done in my view, how do I implement this? I can make something up, that's not hard. But I'm surprised that this isn't covered somewhere already.

Paul.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Custom view, selection consistency with NSTableView
      • From: mmalcolm crawford <email@hidden>
    • Re: Custom view, selection consistency with NSTableView
      • From: mmalcolm crawford <email@hidden>
References: 
 >Custom view, selection consistency with NSTableView (From: Paul Szego <email@hidden>)
 >Re: Custom view, selection consistency with NSTableView (From: mmalcolm crawford <email@hidden>)
 >Re: Custom view, selection consistency with NSTableView (From: Paul Szego <email@hidden>)
 >Re: Custom view, selection consistency with NSTableView (From: mmalcolm crawford <email@hidden>)
 >Re: Custom view, selection consistency with NSTableView (From: Paul Szego <email@hidden>)
 >Re: Custom view, selection consistency with NSTableView (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Custom view, selection consistency with NSTableView
  • Next by Date: Re: Custom view, selection consistency with NSTableView
  • Previous by thread: Re: Custom view, selection consistency with NSTableView
  • Next by thread: Re: Custom view, selection consistency with NSTableView
  • Index(es):
    • Date
    • Thread