home *** CD-ROM | disk | FTP | other *** search
- #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
-