#import "SineInspector.h"

@implementation SineInspector
 
- doRevert:sender
{
	[ampSlider setDoubleValue:[object amplitude]];
	[ampText setDoubleValue:[object amplitude]];
	[freqSlider setDoubleValue:[object frequency]];
	[freqText setDoubleValue:[object frequency]];

	return self;
}

/* In this example, there is an OK button. */
- doOk:sender
{
	[object setAmplitude:[ampSlider doubleValue]];
	[object setFrequency:[freqSlider doubleValue]];
	return self;
}

/* This just keeps the panel up to date, does not msg the object. */
- takeNewValueFrom:sender
{
	if(sender==ampSlider){
		[ampText setDoubleValue:[ampSlider doubleValue]];
	}
	if(sender==ampText){
		[ampSlider setDoubleValue:[ampText doubleValue]];
	}
	if(sender==freqSlider){
		[freqText setDoubleValue:[freqSlider doubleValue]];
	}
	if(sender==freqText){
		[freqSlider setDoubleValue:[freqText doubleValue]];
	}
	return self;
}

/* This inspector does want the Revert and OK buttons if used in the
	UHInspectorManager. */
- (BOOL)wantsButtons
{
	return YES;
}

	
@end