
#import "NameInspector.h"

@implementation NameInspector

- awakeFromNib;
{
	[self clear:self];
    return self;
}
- clear:sender;
{
	[textField setStringValue:""];
    return self;
}
- textActed:sender;
{
// note mit Name aus repository
// wenn nicht gefunden, Failure Sound spielen;
// sonst an client melden.
	Note	*myNote;

	if(myNote = [myNR noteByNam:(char *)[textField stringValue]]){
		[client newNote:myNote from:self];
	}else{
		NXBeep();
	}
	[textField selectText:self];

    return self;
}
- (void)displayNote:(Note *)note;
{
	if(!note)return;
	if([note b]){
		[textField setStringValue:[note name2]];
	}else{
		[textField setStringValue:[note name1]];
	}
}
- (void)setEditable:(BOOL)yn;
{
	[super setEditable:yn];
	[(TextField *)textField setEnabled:yn];
	[(TextField *)textField setBackgroundGray:(yn? 1.0 : 2./3.)];
}


@end
