home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / DeveloperLabs / Lab1 / Solution / Calculator.h < prev    next >
Encoding:
Text File  |  1989-09-26  |  956 b   |  43 lines

  1.  
  2. /*
  3. **    Interface file for calculator exercise, lab #1    
  4. **    NeXT Technical Support
  5. */
  6.  
  7. #import <objc/Object.h>
  8.  
  9. #define STACKSIZE 20
  10.  
  11. @interface Calculator:Object
  12. {
  13.         id    aWindow;     /* main window in which calculator is drawn */
  14.     id    viewer;        /* calculator's simulated LCD display */
  15.     char    viewerStr[24];    /* string of digits to put in viewer */
  16.     double    stack[STACKSIZE];     
  17.     int    topOfStack;
  18.     BOOL    frozen;        /* flag to freeze calculator's functioning
  19.                   upon encountering an error, until 
  20.                   "clear" button is clicked */
  21. }
  22. +new;
  23. -(double)pop;
  24. -push:(double)aNum;
  25. -(double)getOperand;
  26. -displayValue:(double)aNum;
  27. -pushAndDisplay:(double)aNum;
  28. -enter:(id)sender;
  29. -clearDisplay:(id)sender;
  30. -digit:(id)sender;
  31. -period:(id)sender;
  32. -add:(id)sender;
  33. -subtract:(id)sender;
  34. -multiply:(id)sender;
  35. -divide:(id)sender;
  36. -changeSign:(id)sender;
  37. -stackError:(STR)errorMsg;
  38. - setAWindow:(id)anObject;    
  39. - setViewer:(id)anObject;
  40. - windowWillClose:(id)sender;             
  41. @end
  42.  
  43.