home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / ButtonCell.h < prev    next >
Text File  |  1992-01-30  |  4KB  |  142 lines

  1. /*
  2.     ButtonCell.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "ActionCell.h"
  8.  
  9. /* Button Types */
  10.  
  11. #define NX_MOMENTARYPUSH    0
  12. #define NX_PUSHONPUSHOFF    1
  13. #define NX_TOGGLE        2
  14. #define NX_SWITCH        3
  15. #define NX_RADIOBUTTON        4
  16. #define NX_MOMENTARYCHANGE    5
  17. #define NX_ONOFF        6
  18.  
  19. @interface ButtonCell : ActionCell
  20. {
  21.     char               *altContents;
  22.     union _icon {
  23.     struct _bmap {
  24.         id                  normal;
  25.         id                  alternate;
  26.     }                   bmap;
  27.     struct _ke {
  28.         id                  font;
  29.         float               descent;
  30.     }                   ke;
  31.     }                   icon;
  32.     id                  sound;
  33.     struct _bcFlags1 {
  34.     unsigned int        pushIn:1;
  35.     unsigned int        changeContents:1;
  36.     unsigned int        changeBackground:1;
  37.     unsigned int        changeGray:1;
  38.     unsigned int        lightByContents:1;
  39.     unsigned int        lightByBackground:1;
  40.     unsigned int        lightByGray:1;
  41.     unsigned int        hasAlpha:1;
  42.     unsigned int        bordered:1;
  43.     unsigned int        iconOverlaps:1;
  44.     unsigned int        horizontal:1;
  45.     unsigned int        bottomOrLeft:1;
  46.     unsigned int        iconAndText:1;
  47.     unsigned int        lastState:1;
  48.     unsigned int        iconSizeDiff:1;
  49.     unsigned int        iconIsKeyEquivalent:1;
  50.     }                   bcFlags1;
  51.     struct _bcFlags2 {
  52.     unsigned int        keyEquivalent:8;
  53.     unsigned int        transparent:1;
  54.     unsigned int        _RESERVED:4;
  55.     unsigned int        _inset:2;
  56.     unsigned int        _momentarySound:1;
  57.     }                   bcFlags2;
  58.     unsigned short      periodicDelay;
  59.     unsigned short      periodicInterval;
  60. }
  61.  
  62. - init;
  63. - initTextCell:(const char *)aString;
  64. - initIconCell:(const char *)iconName;
  65.  
  66. - copyFromZone:(NXZone *)zone;
  67.  
  68. - free;
  69. - (const char *)title;
  70. - setTitle:(const char *)aString;
  71. - setTitleNoCopy:(const char *)aString;
  72. - (const char *)altTitle;
  73. - setAltTitle:(const char *)aString;
  74. - (const char *)icon;
  75. - setIcon:(const char *)iconName;
  76. - (const char *)altIcon;
  77. - setAltIcon:(const char *)iconName;
  78. - image;
  79. - setImage:image;
  80. - altImage;
  81. - setAltImage:image;
  82. - (int)iconPosition;
  83. - setIconPosition:(int)aPosition;UDbound;
  84. - setSound:aSound;
  85. - (int)highlightsBy;
  86. - setHighlightsBy:(int)aType;
  87. - (int)showsStateBy;
  88. - setShowsStateBy:(int)aType;
  89. - setType:(int)aType;
  90. - (BOOL)isOpaque;
  91. - (const char *)stringValue;
  92. - setStringValue:(const char *)aString;
  93. - setStringValueNoCopy:(const char *)aString;
  94. - (int)intValue;
  95. - setIntValue:(int)anInt;
  96. - (float)floatValue;
  97. - setFloatValue:(float)aFloat;
  98. - (double)doubleValue;
  99. - setDoubleValue:(double)aDouble;
  100. - setFont:fontObj;
  101. - (BOOL)isBordered;
  102. - setBordered:(BOOL)flag;
  103. - (BOOL)isTransparent;
  104. - setTransparent:(BOOL)flag;
  105. - setPeriodicDelay:(float)delay andInterval:(float)interval;
  106. - getPeriodicDelay:(float *)delay andInterval:(float *)interval;
  107. - (unsigned short)keyEquivalent;
  108. - setKeyEquivalent:(unsigned short)charCode;
  109. - setKeyEquivalentFont:fontObj;
  110. - setKeyEquivalentFont:(const char *)fontName size:(float)fontSize;
  111. - (int)getParameter:(int)aParameter;
  112. - setParameter:(int)aParameter to:(int)value;
  113. - getDrawRect:(NXRect *)theRect;
  114. - getTitleRect:(NXRect *)theRect;
  115. - getIconRect:(NXRect *)theRect;
  116. - calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect;
  117. - drawSelf:(const NXRect *)cellFrame inView:controlView;
  118. - drawInside:(const NXRect *)aRect inView:controlView;
  119. - highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
  120. - (BOOL)trackMouse:(NXEvent *)theEvent inRect:(const NXRect *)cellFrame ofView:controlView;
  121. - performClick:sender;
  122. - write:(NXTypedStream *)stream;
  123. - read:(NXTypedStream *)stream;
  124.  
  125. /* 
  126.  * The following new... methods are now obsolete.  They remain in this  
  127.  * interface file for backward compatibility only.  Use Object's alloc method  
  128.  * and the init... methods defined in this class instead.
  129.  */
  130. + new;
  131. + newTextCell;
  132. + newTextCell:(const char *)aString;
  133. + newIconCell;
  134. + newIconCell:(const char *)iconName;
  135.  
  136. @end
  137.  
  138. @interface Object(SoundKitMethods)
  139. - (int)play;
  140. - (int)stop;
  141. @end
  142.