#import "InspectMeApp.h"
#import "InspectMeDoc.h"
#import "ThingInspector.h"
#import "ColorInspector.h"
#import <appkit/Window.h>		// for orderFront

@implementation InspectMeApp

+ new
{
	self = [super new];
	inspectorManager = [[InspectorManager alloc] init];
	[inspectorManager addGroup:"Attributes"];
	[inspectorManager addGroup:"Colors"];

	[[ThingInspector new] setupInspectors:(id)inspectorManager];
	[[ColorInspector new] setupInspectors:(id)inspectorManager];
	return self;
}

- inspectorManager { return   inspectorManager; }

- newDocWindow:sender
	// target of "New window" menu item
{
	[[InspectMeDoc alloc] init];
	return self;
}

- displayInspectorPanel:sender
	// target of "Inspector..." menu item
{
    if (inspectorManager) {
		[[inspectorManager panel] orderFront:NULL];
		}
    
    return self;
}

- windowDidBecomeKey:sender
	// Show "Not Applicable" in the inspector panel and set self as
	// inspectorManager's delegate.  (We don't actually respond to 
	// any inspectorManager delegate messages, but becoming delegate 
	// prevents the old delegate from receiving messages that
	// no longer apply to it.)
{
	[[inspectorManager setDelegate:self] showMessage:"Not\nApplicable"];
	return self;
}

@end
