home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / MiscKit1.2.6 / Palettes / MiscArrowButtonPalette / MiscArrowButton.subproj / MiscArrowButtonCell.h < prev    next >
Encoding:
Text File  |  1994-04-26  |  2.0 KB  |  68 lines

  1. /******************************************************************
  2.  * CLASS:        MiscArrowButtonCell
  3.  * PROGRAMMER:    Todd Thomas 
  4.  * DATE:        Jan 16, 1993
  5.  * VERSION         1.0
  6.  *
  7.  *    With the help of ArrowButton, this is a recreation of the 
  8.  * button (well, it was a View there) from Websters.app (in the 
  9.  * Preferences panel). 
  10.  *     I created a new designated initializer, since it would be nice
  11.  * to be able to set both sides of the button at once. Also, since
  12.  * stringValue did not return anything useful, I made it return a
  13.  * pointer to either the contents (state 0) or altContents (state 1).
  14.  *
  15.  * CHANGES:
  16.  *    Now use setArrowAlignment/arrowAlignment to set/get whether the
  17.  *        the arrow is relative or absolutely aligned.
  18.  *    Added arrowAlignment instance method
  19.  *
  20.  * This object is included in the MiscKit by permission from the author
  21.  * and its use is governed by the MiscKit license, found in the file
  22.  * "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  23.  * for a list of all applicable permissions and restrictions.
  24.  *******************************************************************/
  25.  
  26. #import <appkit/appkit.h>
  27.  
  28. // Use the method setArrowAlignment: with these defines
  29. // Used to use method setAlignment: but realized I still needed that method
  30.  
  31. #define MISC_ARROW_ABSOLUTE 0
  32. #define MISC_ARROW_RELATIVE 1
  33.  
  34.  
  35. @interface MiscArrowButtonCell : ButtonCell
  36. {
  37.     float  cellHeight;
  38.     unsigned int  arrowAlignment;
  39. }
  40.  
  41. - init;
  42. - initTextCell: (const char *)aString;
  43. - initTextCell: (const char *)aString altTitle: (const char *)altString;
  44.  
  45. - (const char *)stringValue;
  46. - calcCellSize: (NXSize *)theSize inRect: (NXRect *)theRect;
  47. - getTitleRect: (NXRect *)theRect;
  48. - getAltTitleRect: (NXRect *)theRect;
  49. - setArrowAlignment: (int)alignment;
  50. - (int)arrowAlignment;
  51.  
  52. - drawInside: (const NXRect *)cellFrame inView: controlView;
  53. - drawSelf: (const NXRect *)cellFrame inView: controlView;
  54.  
  55. - read: (NXTypedStream *)stream;
  56. - write: (NXTypedStream *)stream;
  57.  
  58. @end
  59.  
  60.  
  61. @interface MiscArrowButtonCell (IB)
  62.  
  63. - (const char *)getInspectorClassName;
  64. - (const char *)getEditorClassName;
  65.  
  66. @end
  67.  
  68.