home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Examples / AppKit / Draw / SyncScrollView.h < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.5 KB  |  61 lines

  1. /*
  2.  * Any View that responds to these messages can be a "ruler".
  3.  * This is a nice way to make an object which works in concert
  4.  * with another object, but isn't hardwired into the implementation
  5.  * of that object and, instead, publishes a minimal interface
  6.  * which it expects another object to respond to.
  7.  */
  8.  
  9. @protocol Ruler
  10. - setFlipped:(BOOL)flag;        /* if YES, coordinates go right->left or top->bottom */
  11. - hidePosition;                /* hide any positioning markers */
  12. - showPosition:(NXCoord)p :(NXCoord)q;    /* put the positioning markers at p and q */
  13. @end
  14.  
  15. typedef enum {
  16.     LowerLeft = 0, LowerRight, UpperLeft, UpperRight
  17. } RulerOrigin;
  18.  
  19. @interface SyncScrollView : ScrollView
  20. {
  21.     ClipView *hClipRuler;
  22.     ClipView *vClipRuler;
  23.     id rulerClass;
  24.     NXCoord horizontalRulerWidth;
  25.     NXCoord verticalRulerWiRW%
  26.     RulerOrigin rulerOrigin;
  27.     BOOL verticalRulerIsVisible;
  28.     BOOL horizontalRulerIsVisible;
  29.     BOOL rulersMade;
  30. }
  31.  
  32. /* Setting up the rulers */
  33.  
  34. - (BOOL)bothRulersAreVisible;
  35. - (BOOL)eitherRulerIsVisible;
  36. - (BOOL)verticalRulerIsVisible;
  37. - (BOOL)horizontalRulerIsVisible;
  38.  
  39. - setRulerClass:factoryId;
  40. - setRulerWidths:(NXCoord)horizontal :(NXCoord)vertical;
  41. - setRulerOrigin:(RulerOrigin)origin;
  42.  
  43. - showHorizontalRuler:(BOOL)flag;
  44. - showVerticalRuler:(BOOL)flag;
  45.  
  46. - updateRuler;
  47.  
  48. /* Comes up the responder chain to us */
  49.  
  50. - updateRulers:(const NXRect *)rect;
  51. - showHideRulers:sender;
  52.  
  53. /* Overridden from superclass */
  54.  
  55. - reflectScroll:cView;
  56. - tile;
  57. - scrollClip:(ClipView *)aClipView to:(const NXPoint *)aPoint;
  58. - descendantFrameChanged:sender;
  59.  
  60. @end
  61.