
#import <IconKit/IKBrowser.h>

#import "IKBrowserInspector.h"

@implementation IKBrowserInspector:IBInspector
{
        id		form;
}


/* ========================================================================== */


#define COLUMNS			0
#define MAXVISIBLE		1
#define MINWIDTH		2


/* ========================================================================== */


- init
{
    [super init];
    [NSBundle loadNibNamed:@"IKBrowserInspector" owner:self];
    return self;
}


/* ========================================================================== */


/*

All three options are reset whenever the user changes one of them.

*/

- (void)ok:(id)sender
{
    [[self object] setMinColumnWidth:1];
    [[self object] setMaxVisibleColumns: [[form cellWithTag:COLUMNS]  intValue]];
    [[self object] setMinColumnWidth:[[form cellWithTag:MINWIDTH]  intValue]];
    [[self object] setMaxVisibleColumns: [[form cellWithTag:MAXVISIBLE] intValue]];
    [super ok: sender];
}


- (void)revert:(id)sender
{
    [[form cellWithTag:COLUMNS]  setIntValue: [[self object] numberOfVisibleColumns]];
    [[form cellWithTag:MINWIDTH]  setIntValue: [[self object] minColumnWidth]];
    [[form cellWithTag:MAXVISIBLE]  setIntValue: [[self object] maxVisibleColumns]];
    [super revert: sender];
}


- (BOOL) wantsButtons
{
    return NO;
}


@end
