// -*- objc -*-

#import "MiscImageDissolver.h"

#import "MiscImageDissolverInspector.h"

@implementation MiscImageDissolverInspector

- init
{
    char buf[MAXPATHLEN + 1];
    id bundle;

    [super init];

    bundle = [NXBundle bundleForClass: [MiscImageDissolver class]];
    [bundle getPath: buf 
            forResource: "ImageDissolverInspector" 
            ofType: "nib"];
    [NXApp loadNibFile: buf 
           owner: self 
           withNames: NO 
           fromZone: [self zone]];

    return self;
}

- ok: sender
{
    [object setStepInterval: [dissolvingForm doubleValueAt: 0]];
    [object setNumSteps: [dissolvingForm intValueAt: 1]];

    [object setImage1Name: [imagesForm stringValueAt: 0]];
    [object setImage2Name: [imagesForm stringValueAt: 1]];

    [super ok: sender];

    return self;
}

- revert: sender
{
    [dissolvingForm setDoubleValue: [object stepInterval] at: 0];
    [dissolvingForm setIntValue: [object numSteps] at: 1];

    [imagesForm setStringValue: [object image1Name] at: 0];
    [imagesForm setStringValue: [object image2Name] at: 1];

    [super revert: sender];

    return self;
}

- (BOOL) wantsButtons
{
    return YES;
}

@end
