annotate pkg-src/tree-nx/TreeButtonCell.m @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
163
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
1
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
2 #import "TreeButtonCell.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
3 #import "TreeButton.h"
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
4
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
5 @implementation TreeButtonCell
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
6
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
7 - parent { return parent; }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
8 - setParent:anObject
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
9 { // anObject should be the parent Control object subclass
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
10 parent = anObject;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
11 return self;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
12 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
13
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
14 - (BOOL)trackMouse:(NXEvent *)theEvent
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
15 inRect:(const NXRect *)cellFrame ofView:aView
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
16 { // this traps the button being selected.
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
17 BOOL result = [super trackMouse:theEvent inRect:cellFrame ofView:aView];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
18 if (result && [parent respondsTo:@selector(wasSelected:)]) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
19 [parent wasSelected:self];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
20 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
21 return result;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
22 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
23
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
24 - performClick:sender
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
25 {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
26 [super performClick:sender];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
27 if ([parent respondsTo:@selector(wasSelected:)]) {
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
28 [parent wasSelected:self];
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
29 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
30 return self;
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
31 }
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
32
0132846995bd Import from CVS: tag r20-3b8
cvs
parents:
diff changeset
33 @end