home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / Gnuplot / Source / ContourOptionsPanel.m < prev    next >
Encoding:
Text File  |  1993-03-18  |  1.8 KB  |  113 lines

  1.  
  2. static char RCSId[]="$Id: ContourOptionsPanel.m,v 1.1.1.1 1993/03/18 03:31:29 davis Exp $";
  3.  
  4.  
  5.  
  6. #import <appkit/Application.h>
  7. #import <appkit/Button.h>
  8. #import <appkit/Matrix.h>
  9. #import <appkit/Panel.h>
  10. #import <appkit/TextField.h>
  11.  
  12. #import "ContourOptionsPanel.h"
  13. #import "Status.h"
  14. #import "StatusContour.h"
  15.  
  16.  
  17. @interface ContourOptionsPanel (Private)
  18.  
  19. - _updatePanel;            /** Overridden from OptionsPanel (Private) **/
  20.  
  21. @end
  22.  
  23.  
  24.  
  25. @implementation ContourOptionsPanel
  26.  
  27. - init
  28. {
  29.     [super init];
  30.  
  31.     [NXApp loadNibSection: "ContourOptionsPanel.nib"
  32.             owner: self
  33.         withNames: NO
  34.          fromZone: [self zone]];
  35.  
  36.     [panel setFrameUsingName:"ContourOptionsPanel"];
  37.     [panel setFrameAutosaveName:"ContourOptionsPanel"];
  38.  
  39.     return self;
  40. }
  41.  
  42.  
  43. - doSetKind:sender
  44. {
  45.     return [status setContourKind:[sender selectedTag]];
  46. }
  47.  
  48.  
  49. - doSetPoints:sender
  50. {
  51.     return [status setContourPoints:[sender intValue]];
  52. }
  53.  
  54.  
  55. - doSetOrder:sender
  56. {
  57.     return [status setContourOrder:[sender intValue]];
  58. }
  59.  
  60.  
  61. - doSetKey:sender
  62. {
  63.     return [status setContourInKey:[sender state]];
  64. }
  65.  
  66.  
  67.  
  68. // Shuts up the compiler about unused RCSId
  69. - (const char *) rcsid
  70. {
  71.     return RCSId;
  72. }
  73.  
  74.  
  75.  
  76. @end
  77.  
  78.  
  79.  
  80.  
  81.  
  82. @implementation ContourOptionsPanel (Private)
  83.  
  84. - _updatePanel
  85. {
  86.     [panel disableDisplay];
  87.  
  88.     /* 
  89.      *  If the current status is not nil, update the values of all the 
  90.      *  controls.
  91.      */
  92.     if (status) {
  93.  
  94.     [kindMatrix selectCellWithTag:[status contourKind]];
  95.     [pointsField setIntValue:[status contourPoints]];
  96.     [orderField setIntValue:[status contourOrder]];
  97.     [keyButton setState:[status contourInKey]];
  98.  
  99.     }
  100.  
  101.     [kindMatrix setEnabled:status? YES: NO];
  102.     [pointsField setEnabled:status? YES: NO];
  103.     [orderField setEnabled:status? YES: NO];
  104.     [keyButton setEnabled:status? YES: NO];
  105.  
  106.     [panel reenableDisplay];
  107.     [panel display];
  108.  
  109.     return self;
  110. }
  111.  
  112. @end
  113.