#import "JoyStick.h"
#import "JoyStickInspector.h"

@implementation JoyStickInspector

- init
{
  char buf[MAXPATHLEN +1];
	id bundle;
	
	[super init];
	
	bundle = [NXBundle bundleForClass:[JoyStick class]];
	[bundle getPath:buf forResource:"JoyStickInspector" ofType:"nib"];
	[NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
	return self;

}

- ok:sender
{
    [object setXMax:[xtext floatValue]];
    [object setYMax:[ytext floatValue]];

    [object setTrackTime:[tracktext floatValue]];
    [object setFadeTime:[fadetext floatValue]];
    
    return[super ok:sender];
}

- revert:sender
{
    float val;
    
    val=[object xMax];
    [xslider setFloatValue:val];
    [xtext setFloatValue:val];
    
    val=[object yMax];
    [yslider setFloatValue:val];
    [ytext setFloatValue:val];
    
    val=[object trackTime];
    [trackslider setFloatValue:val];
    [tracktext setFloatValue:val];
    
    val=[object fadeTime];
    [fadeslider setFloatValue:val];
    [fadetext setFloatValue:val];

    return[super revert:sender];
}


@end
