source: trunk/macosx/TorrentTableView.m @ 2824

Last change on this file since 2824 was 2824, checked in by livings124, 15 years ago

preliminary support for setting speed limits through the action menu

  • Property svn:keywords set to Date Rev Author Id
File size: 20.2 KB
Line 
1/******************************************************************************
2 * $Id: TorrentTableView.m 2824 2007-08-17 23:58:21Z livings124 $
3 *
4 * Copyright (c) 2005-2007 Transmission authors and contributors
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *****************************************************************************/
24
25#import "TorrentTableView.h"
26#import "TorrentCell.h"
27#import "Controller.h"
28#import "Torrent.h"
29
30#define PADDING 3.0
31
32#define BUTTON_TO_TOP_REGULAR 33.0
33#define BUTTON_TO_TOP_SMALL 20.0
34
35#define ACTION_BUTTON_TO_TOP 47.0
36
37#define ACTION_MENU_GLOBAL_TAG 101
38#define ACTION_MENU_UNLIMITED_TAG 102
39#define ACTION_MENU_LIMIT_TAG 103
40
41#define ACTION_MENU_FILE_TAG 201
42
43@interface TorrentTableView (Private)
44
45- (NSRect) pauseRectForRow: (int) row;
46- (NSRect) revealRectForRow: (int) row;
47- (NSRect) actionRectForRow: (int) row;
48
49- (BOOL) pointInIconRect: (NSPoint) point;
50- (BOOL) pointInMinimalStatusRect: (NSPoint) point;
51
52- (BOOL) pointInPauseRect: (NSPoint) point;
53- (BOOL) pointInRevealRect: (NSPoint) point;
54- (BOOL) pointInActionRect: (NSPoint) point;
55
56@end
57
58@implementation TorrentTableView
59
60- (id) initWithCoder: (NSCoder *) decoder
61{
62    if ((self = [super initWithCoder: decoder]))
63    {
64        fResumeOnIcon = [NSImage imageNamed: @"ResumeOn.png"];
65        fResumeOffIcon = [NSImage imageNamed: @"ResumeOff.png"];
66        fPauseOnIcon = [NSImage imageNamed: @"PauseOn.png"];
67        fPauseOffIcon = [NSImage imageNamed: @"PauseOff.png"];
68        fResumeNoWaitOnIcon = [NSImage imageNamed: @"ResumeNoWaitOn.png"];
69        fResumeNoWaitOffIcon = [NSImage imageNamed: @"ResumeNoWaitOff.png"];
70       
71        fRevealOnIcon = [NSImage imageNamed: @"RevealOn.png"];
72        fRevealOffIcon = [NSImage imageNamed: @"RevealOff.png"];
73       
74        fActionOnIcon = [NSImage imageNamed: @"ActionOn.png"];
75        fActionOffIcon = [NSImage imageNamed: @"ActionOff.png"];
76       
77        fClickPoint = NSZeroPoint;
78        fClickIn = NO;
79       
80        fKeyStrokes = [[NSMutableArray alloc] init];
81       
82        fSmallStatusAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
83                                        [NSFont messageFontOfSize: 9.0], NSFontAttributeName, nil];
84       
85        fDefaults = [NSUserDefaults standardUserDefaults];
86       
87        [self setDelegate: self];
88    }
89   
90    return self;
91}
92   
93- (void) awakeFromNib
94{
95    [fContextRow setTitle: @"Context"];
96    [fContextNoRow setTitle: @"Context"];
97}
98
99- (void) dealloc
100{
101    [fKeyStrokes release];
102    [fSmallStatusAttributes release];
103   
104    [fMenuTorrent release];
105   
106    [super dealloc];
107}
108
109- (void) setTorrents: (NSArray *) torrents
110{
111    fTorrents = torrents;
112}
113
114- (void) tableView: (NSTableView *) tableView willDisplayCell: (id) cell
115        forTableColumn: (NSTableColumn *) tableColumn row: (int) row
116{
117    [cell setRepresentedObject: [fTorrents objectAtIndex: row]];
118}
119
120- (void) mouseDown: (NSEvent *) event
121{
122    fClickPoint = [self convertPoint: [event locationInWindow] fromView: nil];
123
124    if ([self pointInActionRect: fClickPoint])
125    {
126        int row = [self rowAtPoint: fClickPoint];
127        [self setNeedsDisplayInRect: [self rectOfRow: row]]; //ensure button is pushed down
128       
129        [self displayTorrentMenuForEvent: event];
130       
131        fClickPoint = NSZeroPoint;
132        [self setNeedsDisplayInRect: [self rectOfRow: row]];
133    }
134    else if ([self pointInPauseRect: fClickPoint] || [self pointInRevealRect: fClickPoint])
135    {
136        fClickIn = YES;
137        [self setNeedsDisplayInRect: [self rectOfRow: [self rowAtPoint: fClickPoint]]];
138    }
139    else
140    {
141        if ([event modifierFlags] & NSAlternateKeyMask)
142        {
143            [fDefaults setBool: ![fDefaults boolForKey: @"UseAdvancedBar"] forKey: @"UseAdvancedBar"];
144            fClickPoint = NSZeroPoint;
145            [self reloadData];
146        }
147        else
148        {
149            if ([self pointInMinimalStatusRect: fClickPoint])
150            {
151                [fDefaults setBool: ![fDefaults boolForKey: @"SmallStatusRegular"] forKey: @"SmallStatusRegular"];
152                fClickPoint = NSZeroPoint;
153                [self reloadData];
154            }
155
156            [super mouseDown: event];
157        }
158    }
159}
160
161- (void) mouseUp: (NSEvent *) event
162{
163    NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
164    int row = [self rowAtPoint: point], oldRow = [self rowAtPoint: fClickPoint];
165    BOOL sameRow = row == oldRow;
166   
167    if (sameRow && [self pointInPauseRect: point] && [self pointInPauseRect: fClickPoint])
168    {
169        Torrent * torrent = [fTorrents objectAtIndex: row];
170
171        if ([torrent isActive])
172            [fController stopTorrents: [NSArray arrayWithObject: torrent]];
173        else if ([torrent isPaused])
174        {
175            if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask)
176                [fController resumeTorrentsNoWait: [NSArray arrayWithObject: torrent]];
177            else if ([torrent waitingToStart])
178                [fController stopTorrents: [NSArray arrayWithObject: torrent]];
179            else
180                [fController resumeTorrents: [NSArray arrayWithObject: torrent]];
181        }
182        else;
183    }
184    else if (sameRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint])
185        [[fTorrents objectAtIndex: row] revealData];
186    else if ([event clickCount] == 2 && !NSEqualPoints(fClickPoint, NSZeroPoint))
187    {
188        if ([self pointInIconRect: point])
189            [[fTorrents objectAtIndex: row] revealData];
190        else if (![self pointInActionRect: point])
191            [fController showInfo: nil];
192        else;
193    }
194    else;
195   
196    [super mouseUp: event];
197
198    fClickPoint = NSZeroPoint;
199    fClickIn = NO;
200    [self setNeedsDisplayInRect: [self rectOfRow: oldRow]];
201}
202
203- (void) mouseDragged: (NSEvent *) event
204{
205    if (NSEqualPoints(fClickPoint, NSZeroPoint))
206    {
207        [super mouseDragged: event];
208        return;
209    }
210   
211    NSPoint point = [self convertPoint: [event locationInWindow] fromView: nil];
212    int oldRow = [self rowAtPoint: fClickPoint];
213   
214    BOOL inRect;
215    if ([self pointInRevealRect: fClickPoint])
216        inRect = oldRow == [self rowAtPoint: point] && [self pointInRevealRect: point];
217    else if ([self pointInPauseRect: fClickPoint])
218        inRect = oldRow == [self rowAtPoint: point] && [self pointInPauseRect: point];
219    else
220    {
221        [super mouseDragged: event];
222        return;
223    }
224   
225    if (inRect != fClickIn)
226    {
227        fClickIn = inRect;
228        [self setNeedsDisplayInRect: [self rectOfRow: oldRow]];
229    }
230}
231
232- (NSMenu *) menuForEvent: (NSEvent *) event
233{
234    int row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
235   
236    if (row >= 0)
237    {
238        if (![self isRowSelected: row])
239            [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO];
240               
241        return fContextRow;
242    }
243    else
244    {
245        [self deselectAll: self];
246        return fContextNoRow;
247    }
248}
249
250- (void) keyDown: (NSEvent *) event
251{
252    unichar newChar = [[event characters] characterAtIndex: 0];
253    if (newChar == ' ' || [[NSCharacterSet alphanumericCharacterSet] characterIsMember: newChar]
254        || [[NSCharacterSet symbolCharacterSet] characterIsMember: newChar]
255        || [[NSCharacterSet punctuationCharacterSet] characterIsMember: newChar])
256    {
257        if ([fKeyStrokes count] > 0 && [event timestamp] - [[fKeyStrokes lastObject] timestamp] > 1.0)
258            [fKeyStrokes removeAllObjects];
259        [fKeyStrokes addObject: event];
260   
261        [self interpretKeyEvents: fKeyStrokes];
262    }
263    else
264    {
265        if ([fKeyStrokes count] > 0)
266            [fKeyStrokes removeAllObjects];
267       
268        [super keyDown: event];
269    }
270}
271
272- (void) flagsChanged: (NSEvent *) event
273{
274    [self display];
275    [super flagsChanged: event];
276}
277
278- (void) insertText: (NSString *) text
279{
280    //sort torrents by name before finding closest match
281    NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"name" ascending: YES
282                                            selector: @selector(caseInsensitiveCompare:)] autorelease];
283    NSArray * descriptors = [[NSArray alloc] initWithObjects: nameDescriptor, nil];
284
285    NSArray * tempTorrents = [fTorrents sortedArrayUsingDescriptors: descriptors];
286    [descriptors release];
287   
288    //select torrent closest to text that isn't before text alphabetically
289    int row;
290    NSEnumerator * enumerator = [tempTorrents objectEnumerator];
291    Torrent * torrent;
292    while ((torrent = [enumerator nextObject]))
293        if ([[torrent name] caseInsensitiveCompare: text] != NSOrderedAscending)
294        {
295            row = [fTorrents indexOfObject: torrent];
296            break;
297        }
298   
299    //select last torrent alphabetically if no match found
300    if (!torrent)
301        row = [fTorrents indexOfObject: [tempTorrents lastObject]];
302   
303    [self selectRow: row byExtendingSelection: NO];
304    [self scrollRowToVisible: row];
305}
306
307- (void) displayTorrentMenuForEvent: (NSEvent *) event
308{
309    int row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
310    if (row < 0)
311        return;
312   
313    //get file menu
314    fMenuTorrent = [[fTorrents objectAtIndex: row] retain];
315    NSMenu * fileMenu = [fMenuTorrent fileMenu];
316    [fileMenu setDelegate: self];
317   
318    //remove old file menu
319    NSMenuItem * oldFileMenuItem;
320    if ((oldFileMenuItem = [fActionMenu itemWithTag: ACTION_MENU_FILE_TAG]))
321        [fActionMenu removeItem: oldFileMenuItem];
322   
323    //set file menu
324    #warning localize
325    NSMenuItem * fileMenuItem = [[NSMenuItem alloc] initWithTitle: NSLocalizedString(@"Files",
326                                    "torrent action context menu -> files menu") action: NULL keyEquivalent: @""];
327    [fileMenuItem setTag: ACTION_MENU_FILE_TAG];
328    [fileMenuItem setSubmenu: fileMenu];
329    [fActionMenu addItem: fileMenuItem];
330   
331    [fileMenuItem release];
332   
333    NSRect rect = [self actionRectForRow: row];
334    NSPoint location = rect.origin;
335    location.y += rect.size.height + 5.0;
336    location = [self convertPoint: location toView: nil];
337   
338    NSEvent * newEvent = [NSEvent mouseEventWithType: [event type] location: location
339        modifierFlags: [event modifierFlags] timestamp: [event timestamp] windowNumber: [event windowNumber]
340        context: [event context] eventNumber: [event eventNumber] clickCount: [event clickCount] pressure: [event pressure]];
341   
342    [NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
343   
344    [fMenuTorrent release];
345    fMenuTorrent = nil;
346}
347
348- (void) menuNeedsUpdate: (NSMenu *) menu
349{
350    //this method seems to be called when it shouldn't be
351    if (!fMenuTorrent || ![menu supermenu])
352        return;
353   
354    BOOL create = [menu numberOfItems] <= 0, folder;
355   
356    NSMenu * supermenu = [menu supermenu];
357    NSArray * items;
358    NSDictionary * folderDict;
359    #warning move to submethod
360    if (menu == fUploadMenu || menu == fDownloadMenu)
361    {
362        BOOL upload = menu == fUploadMenu;
363        tr_speedlimit_t mode = [fMenuTorrent speedMode: upload];
364       
365        NSMenuItem * item = [menu itemWithTag: ACTION_MENU_LIMIT_TAG];
366        [item setState: mode == TR_SPEEDLIMIT_SINGLE ? NSOnState : NSOffState];
367        [item setTitle: [NSString stringWithFormat: NSLocalizedString(@"Limit (%d KB/s)",
368                    "torrent action context menu -> upload/download limit"), [fMenuTorrent speedLimit: upload]]];
369       
370        item = [menu itemWithTag: ACTION_MENU_UNLIMITED_TAG];
371        [item setState: mode == TR_SPEEDLIMIT_UNLIMITED ? NSOnState : NSOffState];
372       
373        item = [menu itemWithTag: ACTION_MENU_GLOBAL_TAG];
374        [item setState: mode == TR_SPEEDLIMIT_GLOBAL ? NSOnState : NSOffState];
375       
376        return;
377    }
378    else if ((folderDict = [[supermenu itemAtIndex: [supermenu indexOfItemWithSubmenu: menu]] representedObject]))
379        items = [[[supermenu itemAtIndex: [supermenu indexOfItemWithSubmenu: menu]] representedObject] objectForKey: @"Children"];
380    else
381        items = [fMenuTorrent fileList];
382   
383    #warning move rest to submethod
384    NSEnumerator * enumerator = [items objectEnumerator];
385    NSDictionary * dict;
386    NSMenuItem * item;
387    while ((dict = [enumerator nextObject]))
388    {
389        NSString * name = [dict objectForKey: @"Name"];
390       
391        folder = [[dict objectForKey: @"IsFolder"] boolValue];
392       
393        if (create)
394        {
395            item = [[NSMenuItem alloc] initWithTitle: name action: NULL keyEquivalent: @""];
396           
397            NSImage * icon;
398            if (!folder)
399            {
400                icon = [[dict objectForKey: @"Icon"] copy];
401                [icon setFlipped: NO];
402            }
403            else
404            {
405                NSMenu * itemMenu = [[NSMenu alloc] initWithTitle: name];
406                [itemMenu setAutoenablesItems: NO];
407                [item setSubmenu: itemMenu];
408                [itemMenu setDelegate: self];
409                [itemMenu release];
410               
411                icon = [[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] copy];
412            }
413           
414            [item setRepresentedObject: dict];
415           
416            [icon setScalesWhenResized: YES];
417            [icon setSize: NSMakeSize(16.0, 16.0)];
418            [item setImage: icon];
419            [icon release];
420           
421            [item setAction: @selector(checkFile:)];
422           
423            [menu addItem: item];
424            [item release];
425        }
426        else
427            item = [menu itemWithTitle: name];
428       
429        NSIndexSet * indexSet = [dict objectForKey: @"Indexes"];
430        [item setState: [fMenuTorrent checkForFiles: indexSet]];
431        [item setEnabled: [fMenuTorrent canChangeDownloadCheckForFiles: indexSet]];
432    }
433}
434
435- (void) setQuickLimitMode: (id) sender
436{
437    int tag = [sender tag];
438    tr_speedlimit_t mode;
439    if (tag == ACTION_MENU_UNLIMITED_TAG)
440        mode = TR_SPEEDLIMIT_UNLIMITED;
441    else if (tag == ACTION_MENU_LIMIT_TAG)
442        mode = TR_SPEEDLIMIT_SINGLE;
443    else
444        mode = TR_SPEEDLIMIT_GLOBAL;
445   
446    [fMenuTorrent setSpeedMode: mode upload: [sender menu] == fUploadMenu];
447   
448    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateSettings" object: nil];
449}
450
451- (void) setQuickLimit: (id) sender
452{
453   
454}
455
456- (void) checkFile: (id) sender
457{
458    #warning get working
459    NSIndexSet * indexSet;
460    if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask)
461        indexSet = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fMenuTorrent fileCount])];
462    else
463        indexSet = [[sender representedObject] objectForKey: @"Indexes"];
464   
465    [fMenuTorrent setFileCheckState: [sender state] != NSOnState ? NSOnState : NSOffState forIndexes: indexSet];
466   
467    [[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateStats" object: nil];
468}
469
470- (void) drawRow: (int) row clipRect: (NSRect) rect
471{
472    [super drawRow: row clipRect: rect];
473   
474    Torrent * torrent = [fTorrents objectAtIndex: row];
475   
476    //pause/resume icon
477    NSImage * pauseImage = nil;
478    NSRect pauseRect  = [self pauseRectForRow: row];
479    if ([torrent isActive])
480    {
481        if (![torrent isChecking])
482            pauseImage = fClickIn && NSPointInRect(fClickPoint, pauseRect) ? fPauseOnIcon : fPauseOffIcon;
483    }
484    else if ([torrent isPaused])
485    {
486        BOOL inPauseRect = fClickIn && NSPointInRect(fClickPoint, pauseRect);
487        if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask && [fDefaults boolForKey: @"Queue"])
488            pauseImage = inPauseRect ? fResumeNoWaitOnIcon : fResumeNoWaitOffIcon;
489        else if ([torrent waitingToStart])
490            pauseImage = inPauseRect ? fPauseOnIcon : fPauseOffIcon;
491        else
492            pauseImage = inPauseRect ? fResumeOnIcon : fResumeOffIcon;
493    }
494    else;
495   
496    if (pauseImage)
497        [pauseImage compositeToPoint: NSMakePoint(pauseRect.origin.x, NSMaxY(pauseRect)) operation: NSCompositeSourceOver];
498   
499    //reveal icon
500    NSRect revealRect = [self revealRectForRow: row];
501    NSImage * revealImage = fClickIn && NSPointInRect(fClickPoint, revealRect) ? fRevealOnIcon : fRevealOffIcon;
502    [revealImage compositeToPoint: NSMakePoint(revealRect.origin.x, NSMaxY(revealRect)) operation: NSCompositeSourceOver];
503   
504    //action icon
505    if (![fDefaults boolForKey: @"SmallView"])
506    {
507        NSRect actionRect = [self actionRectForRow: row];
508        NSImage * actionImage = NSPointInRect(fClickPoint, actionRect) ? fActionOnIcon : fActionOffIcon;
509        [actionImage compositeToPoint: NSMakePoint(actionRect.origin.x, NSMaxY(actionRect)) operation: NSCompositeSourceOver];
510    }
511}
512
513@end
514
515@implementation TorrentTableView (Private)
516
517- (NSRect) pauseRectForRow: (int) row
518{
519    if (row < 0)
520        return NSZeroRect;
521   
522    NSRect cellRect = [self frameOfCellAtColumn: 0 row: row];
523   
524    float buttonToTop = [fDefaults boolForKey: @"SmallView"] ? BUTTON_TO_TOP_SMALL : BUTTON_TO_TOP_REGULAR;
525   
526    return NSMakeRect(NSMaxX(cellRect) - PADDING - BUTTON_WIDTH - PADDING - BUTTON_WIDTH,
527                        cellRect.origin.y + buttonToTop, BUTTON_WIDTH, BUTTON_WIDTH);
528}
529
530- (NSRect) revealRectForRow: (int) row
531{
532    if (row < 0)
533        return NSZeroRect;
534   
535    NSRect cellRect = [self frameOfCellAtColumn: 0 row: row];
536   
537    float buttonToTop = [fDefaults boolForKey: @"SmallView"] ? BUTTON_TO_TOP_SMALL : BUTTON_TO_TOP_REGULAR;
538   
539    return NSMakeRect(NSMaxX(cellRect) - PADDING - BUTTON_WIDTH,
540                        cellRect.origin.y + buttonToTop, BUTTON_WIDTH, BUTTON_WIDTH);
541}
542
543- (NSRect) actionRectForRow: (int) row
544{
545    if (row < 0)
546        return NSZeroRect;
547   
548    TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
549    NSRect cellRect = [self frameOfCellAtColumn: 0 row: row],
550            iconRect = [cell iconRectForBounds: cellRect];
551   
552    if ([fDefaults boolForKey: @"SmallView"])
553        return iconRect;
554    else
555        return NSMakeRect(iconRect.origin.x + (iconRect.size.width - ACTION_BUTTON_WIDTH) * 0.5,
556                        cellRect.origin.y + ACTION_BUTTON_TO_TOP, ACTION_BUTTON_WIDTH, ACTION_BUTTON_HEIGHT);
557}
558
559- (BOOL) pointInIconRect: (NSPoint) point
560{
561    int row = [self rowAtPoint: point];
562    if (row < 0)
563        return NO;
564   
565    TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
566    return NSPointInRect(point, [cell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
567}
568
569- (BOOL) pointInMinimalStatusRect: (NSPoint) point
570{
571    int row = [self rowAtPoint: point];
572    if (row < 0 || ![fDefaults boolForKey: @"SmallView"])
573        return NO;
574   
575    TorrentCell * cell = [[self tableColumnWithIdentifier: @"Torrent"] dataCell];
576    [cell setRepresentedObject: [fTorrents objectAtIndex: row]];
577    return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
578}
579
580- (BOOL) pointInPauseRect: (NSPoint) point
581{
582    int row = [self rowAtPoint: point];
583    if (row < 0)
584        return NO;
585   
586    return NSPointInRect(point, [self pauseRectForRow: row]);
587}
588
589- (BOOL) pointInRevealRect: (NSPoint) point
590{
591    int row = [self rowAtPoint: point];
592    if (row < 0)
593        return NO;
594   
595    return NSPointInRect(point, [self revealRectForRow: row]);
596}
597
598- (BOOL) pointInActionRect: (NSPoint) point
599{
600    int row = [self rowAtPoint: point];
601    if (row < 0)
602        return NO;
603   
604    return NSPointInRect(point, [self actionRectForRow: row]);
605}
606
607@end
Note: See TracBrowser for help on using the repository browser.