Mercurial > hg > xemacs-beta
diff lisp/oobr/tree-nx/TreeButtonCell.m @ 0:376386a54a3c r19-14
Import from CVS: tag r19-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:45:50 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/oobr/tree-nx/TreeButtonCell.m Mon Aug 13 08:45:50 2007 +0200 @@ -0,0 +1,33 @@ + +#import "TreeButtonCell.h" +#import "TreeButton.h" + +@implementation TreeButtonCell + +- parent { return parent; } +- setParent:anObject +{ // anObject should be the parent Control object subclass + parent = anObject; + return self; +} + +- (BOOL)trackMouse:(NXEvent *)theEvent + inRect:(const NXRect *)cellFrame ofView:aView +{ // this traps the button being selected. + BOOL result = [super trackMouse:theEvent inRect:cellFrame ofView:aView]; + if (result && [parent respondsTo:@selector(wasSelected:)]) { + [parent wasSelected:self]; + } + return result; +} + +- performClick:sender +{ + [super performClick:sender]; + if ([parent respondsTo:@selector(wasSelected:)]) { + [parent wasSelected:self]; + } + return self; +} + +@end