Re: NSBrowser/NSMatrix as drag-and-drop source
Re: NSBrowser/NSMatrix as drag-and-drop source
- Subject: Re: NSBrowser/NSMatrix as drag-and-drop source
- From: Kevin Dorne <email@hidden>
- Date: Thu, 26 May 2005 15:05:13 -0700
On Thu, May 26, 2005 at 03:56:33PM -0600, Nick Zitzmann wrote:
>
> On May 26, 2005, at 3:47 PM, Kevin Dorne wrote:
>
> >Following an example posted December 2003, I've added mouseDown and
> >mouseDragged methods to MyMatrix. The issue is that if I have the
> >mouseDown method as below, I can't select multiple cells, but
> >dragging works. If I just have the mouseDragged method, I can
> >select multiple cells, but dragging doesn't work.
> >
> >Is the code below correct, or am I going about this wrong?
>
> The code is correct, but it's incomplete. You need to add code to -
> mouseDown: to catch the case where the user is holding down Shift or
> Command when clicking, and if this is detected, then you need to
> manually extend the selection.
Ah, okay, so instead of
[self selectCellAtRow: row column: col];
I call
[self setSelectionFrom: row to: row anchor: anchor highlight: YES];
with the correct anchor depending on whether Shift or Command-clicked?
(I can't try this until I get home, sadly)
Cheers,
-k
_______________________________________________
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