home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Palettes / MiscArrowButtonPalette / MiscArrowButton.subproj / MiscArrowButtonCell.h < prev    next >
Encoding:
Text File  |  1994-01-16  |  2.0 KB  |  57 lines

  1. /******************************************************************
  2.  * CLASS:        MiscArrowButtonCell
  3.  * PROGRAMMER:    Todd Thomas 
  4.  * DATE:        Jan 16, 1993
  5.  * VERSION         0.3
  6.  *
  7.  *    With the help of ArrowButton, this is a recreation of that 
  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.  * This object is included in the MiscKit by permission from the author
  20.  * and its use is governed by the MiscKit license, found in the file
  21.  * "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  22.  * for a list of all applicable permissions and restrictions.
  23.  *******************************************************************/
  24.  
  25. #import <appkit/appkit.h>
  26.  
  27. // Use the method setArrowAlignment: with these defines
  28. // Used to use method setAlignment: but realized I still needed that method
  29.  
  30. #define MISC_ARROW_ABSOLUTE 0
  31. #define MISC_ARROW_RELATIVE 1
  32.  
  33.  
  34. @interface MiscArrowButtonCell : ButtonCell
  35. {
  36.     float  cellHeight;
  37.     unsigned int  arrowAlignment;
  38. }
  39.  
  40. - init;
  41. - initTextCell: (const char *)aString;
  42. - initTextCell: (const char *)aString altTitle: (const char *)altString;
  43. - (const char *)stringValue;
  44. - calcCellSize: (NXSize *)theSize inRect: (NXRect *)theRect;
  45. - getTitleRect: (NXRect *)theRect;
  46. - getAltTitleRect: (NXRect *)theRect;
  47. //- getDrawRect: (NXRect *)theRect;
  48. - setArrowAlignment: (int)alignment;
  49. - (int)arrowAlignment;
  50. - drawInside: (const NXRect *)cellFrame inView: controlView;
  51. - drawSelf: (const NXRect *)cellFrame inView: controlView;
  52. - read: (NXTypedStream *)stream;
  53. - write: (NXTypedStream *)stream;
  54. - (const char *)getInspectorClassName;
  55. - (const char *)getEditorClassName;
  56. @end
  57.