This is Inverse.m in view mode; [Download] [Up]
#import "Inverse.h"
@implementation Inverse
- (void)IN_Calc:(id)sender
{
// Decalare Variables
float price, catax, total;
// Assign the number in the field to the variable
total = [IN_Total floatValue];
// Do a little calculation
price = (total/1.0825);
catax = (price*.0825);
// Display result in the panel
// Sets TextField as a NSFloatType
[[IN_CATax cell] setEntryType:NSFloatType];
[[IN_Price 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.
[[IN_CATax cell] setFloatingPointFormat:NO left:4 right:2];
[[IN_Price cell] setFloatingPointFormat:NO left:4 right:2];
// Display result in the panel
[IN_CATax setFloatValue:catax];
[IN_Price setFloatValue:price];
// Bring the cusor back to the Price field and select it.
[IN_Total selectText:self];
}
- (void)windowDidBecomeKey:(NSNotification *)notification;
{
// Brings the cursor to the field and selects text
[IN_Total selectText:self];
}
- (void)MoreInfo:(id)sender
{
[NSBundle loadNibNamed:@"MoreInfo.nib" owner:self]; // load nib
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.