
#import "HistogramInspector.h"
#import "Histogram.h"

@implementation HistogramInspector

// ****************************************************************************
// ****************************************************************************
// Inspector protocol methods.
// ****************************************************************************
// ****************************************************************************

// Return the window that represents the inspector.
- window
{
	return window;
} 

// Return the title for the inspector panel.
- (char *)inspectorTitle
{
	return "Histogram Tool";
}

// Make sure the inspector displays the object's current values.
- revert:sender
{
	[intervalWidthField setFloatValue:[object intervalWidth]];
	[accuracyField setIntValue:[object accuracy]];
	[horizLabelField setStringValue:[object horizontalAxisLabel]];		
	[vertLabelField setStringValue:[object verticalAxisLabel]];		
	return self;
}

// Set the object's current values.
- ok:sender
{
	[object setIntervalWidth:[intervalWidthField floatValue]];
	[object setAccuracy:[accuracyField intValue]];
	[object setHorizontalAxisLabel:[horizLabelField stringValue]];
	[object setVerticalAxisLabel:[vertLabelField stringValue]];
		
	[window makeFirstResponder:window];
	return self;
}

@end
