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

  1.  
  2. #import "WWImageButton.h"
  3. #import "WWImageButtonCell.h"
  4.  
  5. @implementation WWImageButton
  6.  
  7. static id myStoredCellClass;
  8.  
  9.  
  10. + initialize 
  11.   [WWImageButton setVersion:1]; 
  12.  
  13.   if (self == [WWImageButton class])
  14.   {  myStoredCellClass = [WWImageButtonCell class];
  15.   }
  16.  
  17.   return self; 
  18. }
  19. //
  20. + setCellClass:classID
  21. {
  22.   myStoredCellClass = classID;
  23.   return self;
  24. }
  25. ////////////////////////////////////////////////////////
  26. - initFrame:(const NXRect *)frameRect icon:(const char *)aString tag:(int)anInt target:anObject action:(SEL)aSelector key:(unsigned short)charCode enabled:(BOOL)flag
  27. {
  28.   id  oldCell;
  29.  
  30.  
  31.   [super initFrame:frameRect icon:aString tag:anInt target:anObject action:aSelector key:charCode enabled:flag];
  32.   oldCell = [self setCell:[[WWImageButtonCell alloc] init]];
  33.   [oldCell free];
  34.   [self setOpaque:NO];
  35.   return self;
  36. }
  37. //
  38. - initFrame:(const NXRect *)frameRect title:(const char *)aString tag:(int)anInt target:anObject action:(SEL)aSelector key:(unsigned short)charCode enabled:(BOOL)flag
  39. {
  40.   id  oldCell;
  41.  
  42.  
  43.   [super initFrame:frameRect title:aString tag:anInt target:anObject action:aSelector key:charCode enabled:flag];
  44.   oldCell = [self setCell:[[myStoredCellClass alloc] init]];
  45.   [oldCell free];
  46.   [self setOpaque:NO];
  47.   return self;
  48. }
  49. //
  50. - init
  51. {
  52.   id  oldCell;
  53.  
  54.  
  55.   [super init];
  56.   oldCell = [self setCell:[[myStoredCellClass alloc] init]];
  57.   [oldCell free];
  58.   [self setOpaque:NO];
  59.   return self;
  60. }
  61.  
  62. - setIcon:(const char *)iconName
  63. {
  64.   [super setIcon:iconName];
  65.   [[[self image] bestRepresentation] setOpaque:NO];
  66.   return self;
  67. }
  68.  
  69. - setImage:theImage
  70. {
  71.   [super setImage:theImage];
  72.   [[[self image] bestRepresentation] setOpaque:NO];
  73.   return self;
  74. }
  75.  
  76. - setAltIcon:(const char *)iconName
  77. {
  78.   [super setAltIcon:iconName];
  79.   [[[self altImage] bestRepresentation] setOpaque:NO];
  80.   return self;
  81. }
  82.  
  83. - setAltImage:theImage
  84. {
  85.   [super setImage:theImage];
  86.   [[[self altImage] bestRepresentation] setOpaque:NO];
  87.   return self;
  88. }
  89.  
  90. @end
  91.