home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WWTCLKit / WWSimpleImageViewIBInspector.m < prev    next >
Encoding:
Text File  |  1995-03-22  |  2.5 KB  |  56 lines

  1. #import "WWSimpleImageViewIBInspector.h"
  2. #import "WWSimpleImageView.h"
  3. #import "aspectRatios.h"
  4.  
  5. @implementation WWSimpleImageViewIBInspector
  6.  
  7. - init 
  8. {
  9.    char buf[MAXPATHLEN + 1];
  10.    id bundle;
  11.     
  12.    [super init];
  13.     
  14.    bundle = [NXBundle bundleForClass:[self class]];
  15.    [bundle getPath:buf forResource:"WWSimpleImageViewIBInspector" ofType:"nib"];
  16.    [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
  17.    [self revert:nil];
  18.  
  19.    return self;
  20. }
  21.  
  22. - revert:sender 
  23.    [theColor setColor:[object backgroundColor]];
  24.    [alphaSlider setFloatValue:[object alpha]];
  25.    [theImage setStringValue:""];
  26.    [aspectRatioMatrix selectCellWithTag:[object aspectRatioType]];
  27.    [horizontalLayoutMatrix selectCellWithTag:[object horizontalLayoutType]];
  28.    [verticalLayoutMatrix selectCellWithTag:[object verticalLayoutType]];
  29.    [customAspectRatioText setFloatValue:[object aspectRatio]];
  30.    [customAspectRatioText setEnabled:([object aspectRatioType] == WW_ASPECT_CUSTOM)];
  31.    [scaleSwitch setIntValue:(int)[(WWSimpleImageView *)object scaleToFit]];
  32.    [imageUnderSwitch setIntValue:[object imageUnder]];
  33.    [rotateTo setFloatValue:[object frameAngle]];
  34.    [borderTypeMatrix selectCellWithTag:[object borderType]];
  35.  
  36.    return self;
  37. }
  38.  
  39. - sizeToImage:s { [object sizeToImage:s]; [self revert:nil]; return [super ok:s]; }
  40. - takeColor_:s    { [object setBackgroundColor:[theColor color]]; [self revert:nil]; return [super ok:s]; }
  41. - setAlpha_:s    { [object setBackgroundAlpha:[s floatValue]]; [self revert:nil]; return [super ok:s]; }
  42. - setImage_:s    { [object setImageFile:(char *)[s stringValue]]; [self revert:nil]; return [super ok:s]; }
  43. - setAspectRatio_:s    { [object setAspectRatio:s]; [self revert:nil]; return [super ok:s]; }
  44. - setImageUnder_:s    { [object setImageUnder:[s intValue]]; [self revert:nil]; return [super ok:s]; }
  45. - setScale_:s    { [object setScaleToFit:[s intValue]]; [self revert:nil]; return [super ok:s]; }
  46. - setAspectRatioFromMatrix_:s    { [object setAspectRatioFromMatrix:s]; [self revert:nil]; return [super ok:s]; }
  47. - setHorizontalLayoutFromMatrix_:s    { [object setHorizontalLayoutFromMatrix:s]; [self revert:nil]; return [super ok:s]; }
  48. - setBorderTypeFromMatrix_:s    { [object setBorderType:[[s selectedCell] tag]]; [self revert:nil]; return [super ok:s]; }
  49. - setVerticalLayoutFromMatrix_:s    { [object setVerticalLayoutFromMatrix:s]; [self revert:nil]; return [super ok:s]; }
  50. - rotateTo_:s { [object rotateTo:[s floatValue]];  [object display]; [self revert:nil]; return [super ok:s]; }
  51.  
  52. - (BOOL)wantsButtons    { return NO; }
  53. @end
  54.  
  55.