163
|
1
|
|
2 #import "TreeButtonCell.h"
|
|
3 #import "TreeButton.h"
|
|
4
|
|
5 @implementation TreeButtonCell
|
|
6
|
|
7 - parent { return parent; }
|
|
8 - setParent:anObject
|
|
9 { // anObject should be the parent Control object subclass
|
|
10 parent = anObject;
|
|
11 return self;
|
|
12 }
|
|
13
|
|
14 - (BOOL)trackMouse:(NXEvent *)theEvent
|
|
15 inRect:(const NXRect *)cellFrame ofView:aView
|
|
16 { // this traps the button being selected.
|
|
17 BOOL result = [super trackMouse:theEvent inRect:cellFrame ofView:aView];
|
|
18 if (result && [parent respondsTo:@selector(wasSelected:)]) {
|
|
19 [parent wasSelected:self];
|
|
20 }
|
|
21 return result;
|
|
22 }
|
|
23
|
|
24 - performClick:sender
|
|
25 {
|
|
26 [super performClick:sender];
|
|
27 if ([parent respondsTo:@selector(wasSelected:)]) {
|
|
28 [parent wasSelected:self];
|
|
29 }
|
|
30 return self;
|
|
31 }
|
|
32
|
|
33 @end
|