This is MiscValueCellInspector.m in view mode; [Download] [Up]
//
// MiscValueCellInspector.m -- an IBInspector that edits a MiscValueCell
// or its MiscValueField.
// Written by David Fedchenko. Copyright 1994 by David Fedchenko.
// Version 1.0 All rights reserved.
//
// This notice may not be removed from this source code.
//
// This object is included in the MiscKit by permission from the author
// and its use is governed by the MiscKit license, found in the file
// "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
// for a list of all applicable permissions and restrictions.
//
#import "MiscValueCellInspector.h"
@implementation MiscValueCellInspector
- init
{
char buf[MAXPATHLEN + 1];
id bundle;
[super init];
bundle = [NXBundle bundleForClass:[MiscValueCell class]];
[bundle getPath:buf forResource:"MiscValueCellInspector" ofType:"nib"];
[NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
return self;
}
- updateControls
{
[idSoftLower setEnabled:[idExpandLower state]];
[idSoftLowerLabel setEnabled:[idExpandLower state]];
[idSoftUpper setEnabled:[idExpandUpper state]];
[idSoftUpperLabel setEnabled:[idExpandUpper state]];
return self;
}
- ok:sender
{
[object setMinValue:[idHardLower doubleValue]];
[object setMaxValue:[idHardUpper doubleValue]];
[object setMinBoundary:[idSoftLower doubleValue]];
[object setMaxBoundary:[idSoftUpper doubleValue]];
[object setStepSize:[idNormal doubleValue]];
[object setAltStepSize:[idAlternate doubleValue]];
[object setExpandMin:[idExpandLower state]];
[object setExpandMax:[idExpandUpper state]];
[object setContinuous:[idContinuous state]];
[self updateControls];
return [super ok:sender];
}
- revert:sender
{
// there is casting here because the NeXT headers have a type conflict
// for these two methods.
[idHardLower setDoubleValue:[(MiscValueField *)object minValue]];
[idHardUpper setDoubleValue:[(MiscValueField *)object maxValue]];
[idSoftLower setDoubleValue:[object minBoundary]];
[idSoftUpper setDoubleValue:[object maxBoundary]];
[idNormal setDoubleValue:[object stepSize]];
[idAlternate setDoubleValue:[object altStepSize]];
[idExpandLower setState:[object expandMin]];
[idExpandUpper setState:[object expandMax]];
[idContinuous setState:[object isContinuous]];
[self updateControls];
return [super revert:sender];
}
- (BOOL)wantsButtons
{
return NO;
}
// the text delegate functions to get the info more better
- textDidEnd:sender endChar:(unsigned short)whyEnd
{
[self ok:sender];
return self;
}
@end
@implementation MiscValueField (AttributesInspector)
- (const char *)getInspectorClassName
{
NXEvent *ev;
ev = [NXApp currentEvent];
if (ev->flags&NX_ALTERNATEMASK) // get the superclass inspector
return [super getInspectorClassName];
else // the real inspector
return "MiscValueCellInspector";
}
@end
@implementation MiscValueCell (AttributesInspector)
- (const char *)getInspectorClassName
{
NXEvent *ev;
ev = [NXApp currentEvent];
if (ev->flags&NX_ALTERNATEMASK) // get the superclass inspector
return [super getInspectorClassName];
else // the real inspector
return "MiscValueCellInspector";
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.