This is FPObject.m in view mode; [Download] [Up]
#import "FPObject.h"
@implementation FPObject
- (void)awakeFromNib
// This is one of the last methods executed after the nib file is loaded.
// This is the Best way to initialize an object and jump into
// a method after the nib file was loaded.
{
[FindPercentagePanel makeKeyAndOrderFront:NULL];
[AskingPrice selectText:self];
}
- (void)Calc:(id)sender
{
float dummy1;
float dummy2;
float askingprice;
float municipalevaluation;
float offer;
float percentasking;
float percentmunicipal;
// Assign Variables
askingprice = [AskingPrice floatValue];
municipalevaluation = [MunicipalEvaluation floatValue];
offer = [Offer floatValue];
// This section finds the % in comparision with the
// Asking Price
// Formula is: Offer/Asking Price = X
// Multiply X by 100 = Y
// 100 - Y = Value we want!
dummy1 = (offer/askingprice);
dummy2 = (dummy1 * 100);
percentasking = (dummy2 - 100);
// Displays Results
// Sets TextField as a NSFloatType
[[PercentAsking cell] setEntryType:NSFloatType];
// Format the TextField with two number at the left of the floating point
// and two numbers at the right of the floating point.
[[PercentAsking cell] setFloatingPointFormat:NO left:3 right:2];
[PercentAsking setFloatValue:percentasking];// Display result
[PercentAsking display];
// This section finds the % in comparision with the
// Municipal Evaluation
// Formula is: Offer/Municipal Evaluation = X
// Multiply X by 100 = Y
// 100 - Y = Value we want!
dummy1 = (offer/municipalevaluation);
dummy2 = (dummy1 * 100);
percentmunicipal = (dummy2 - 100);
// Displays Results
// Sets TextField as a NSFloatType
[[PercentMunicipal cell] setEntryType:NSFloatType];
// Format the TextField with two number at the left of the floating point
// and two numbers at the right of the floating point.
[[PercentMunicipal cell] setFloatingPointFormat:NO left:3 right:2];
[PercentMunicipal setFloatValue:percentmunicipal];// Display result
[PercentMunicipal display];
[Offer selectText:self];
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.