view lisp/oobr/tree-nx/TreeButtonCell.m @ 160:1c55655d6702

Added tag r20-3b6 for changeset 3bb7ccffb0c0
author cvs
date Mon, 13 Aug 2007 09:41:47 +0200
parents 376386a54a3c
children
line wrap: on
line source


#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