home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Utilities / CATax-2.0-MIS / Inverse.m < prev    next >
Encoding:
Text File  |  1997-02-26  |  1.2 KB  |  53 lines

  1. #import "Inverse.h"
  2.  
  3. @implementation Inverse
  4.  
  5. - (void)IN_Calc:(id)sender
  6. {
  7.     // Decalare Variables    
  8.     float price, catax, total;
  9.  
  10.     // Assign the number in the field to the variable
  11.     total = [IN_Total floatValue];
  12.  
  13.     // Do a little calculation
  14.     price = (total/1.0825);
  15.     catax = (price*.0825);
  16.  
  17.     // Display result in the panel
  18.     // Sets TextField as a NSFloatType
  19.     [[IN_CATax cell] setEntryType:NSFloatType];
  20.     [[IN_Price cell] setEntryType:NSFloatType];
  21.     // Format the TextField with two number at the left of the floating point
  22.     // and two numbers at the right of the floating point.
  23.     [[IN_CATax cell] setFloatingPointFormat:NO left:4 right:2];
  24.     [[IN_Price cell] setFloatingPointFormat:NO left:4 right:2];
  25.  
  26.     // Display result in the panel
  27.     [IN_CATax setFloatValue:catax];
  28.     [IN_Price setFloatValue:price];
  29.  
  30.     // Bring the cusor back to the Price field and select it.
  31.     [IN_Total selectText:self];
  32. }
  33.  
  34. - (void)windowDidBecomeKey:(NSNotification *)notification;
  35. {
  36.  
  37.     // Brings the cursor to the field and selects text
  38.     [IN_Total selectText:self];
  39.  
  40. }
  41.  
  42. - (void)MoreInfo:(id)sender
  43. {
  44.  
  45.     [NSBundle loadNibNamed:@"MoreInfo.nib" owner:self]; // load nib
  46.  
  47. }
  48.  
  49.  
  50.  
  51.  
  52. @end
  53.