home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / BrainRulers / Source / Ruler.h < prev    next >
Encoding:
Text File  |  1994-06-07  |  1.6 KB  |  75 lines

  1. // Ruler.h
  2. // A general ruler class designed to be used with the RuledScrollView class 
  3.  
  4. #import <appkit/Text.h>    // required for alignment manifests
  5. #import <appkit/Font.h>
  6. #define TEXTBASELINE 2
  7. #define HORIZONTAL 0.0
  8. #define VERTICAL 90.0
  9.  
  10. @interface Ruler:View
  11. {
  12.     NXCoord    scaleSpacing;
  13.     float    scale, scaleOffset;
  14.     NXCoord    border;
  15.     float     orientation;
  16.     BOOL    inverted,mirrored;
  17.     int     alignment;
  18.     id        font;
  19.     NXColor backgroundColor;
  20.     float     backgroundGray;
  21.     id        image;
  22.     int        unitsLength;
  23.     char    *units;
  24.     BOOL    draggableRuler;
  25.     NXCoord ascender, descender, lineHeight;
  26.     NXCoord leftOrBottomMargin, rightOrTopMargin;
  27. }
  28.  
  29. /* instance methods */
  30. /* Initializing and freeing an instance */
  31. - initFrame:(NXRect *)frameRect;
  32. - free;
  33.  
  34. /* Drawing the view */
  35. - drawSelf:(NXRect *)rects :(int)count;
  36.  
  37. /* Event handling */
  38. - (BOOL) acceptsFirstMouse;
  39. - mouseDown:(NXEvent *)theEvent;
  40.  
  41. /* Sizing the rulers */
  42. - setSize;
  43.  
  44. /* Setting/returning Ruler attributes */
  45. - setScaleSpacing:(NXCoord)points;
  46. - (NXCoord)scaleSpacing;
  47. - setScale:(float)scaleIncrement;
  48. - (float)scale;
  49. - setScaleOffset:(float)origin;
  50. - (float)scaleOffset;
  51. - setBorder:(NXCoord)theBorder;
  52. - (NXCoord)border;
  53. - setOrientation:(float)angle;
  54. - (float)orientation; 
  55. - setInverted:(BOOL)invertFlag;
  56. - (BOOL)inverted;
  57. - setMirrored:(BOOL)mirrorFlag;
  58. - (BOOL)mirrored;
  59. - setAlignment:(int)alignType;
  60. - (int)alignment;
  61. - setUnits:(char *)name;
  62. - (const char *)units;
  63. - setFont:aFont;
  64. - (Font *)font;
  65. - setBackgroundColor:(NXColor)bColor;
  66. - (NXColor)backgroundColor;
  67. - setBackgroundGray:(float)value;
  68. - (float)backgroundGray;
  69. - setImage:anImage;
  70. - image;
  71. - setDraggableRuler:(BOOL)yesOrNo;
  72. - (BOOL)draggableRuler;
  73.  
  74. @end
  75.