home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Examples / AppKit / Draw / SyncScrollView.h < prev    next >
Text File  |  1995-08-06  |  2KB  |  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. - setZeroAtViewOrigin:(BOOL)flag;        /* if NO, coordinates go right->left or top->bottom */
  11. - hidePosition;                /* hide any positioning markers */
  12. - showPosition:(float)p :(float)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 : NSScrollView
  20. {
  21.     NSClipView *hClipRuler;
  22.     NSClipView *vClipRuler;
  23.     id rulerClass;
  24.     float horizontalRulerWidth;
  25.     float verticalRulerWidth;
  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. - (void)setRulerClass:factoryId;
  40. - (void)setRulerWidths:(float)horizontal :(float)vertical;
  41. - (void)setRulerOrigin:(RulerOrigin)origin;
  42.  
  43. - (void)showHorizontalRuler:(BOOL)flag;
  44. - (void)showVerticalRuler:(BOOL)flag;
  45.  
  46. - (void)updateRuler;
  47.  
  48. /* Comes up the responder chain to us */
  49.  
  50. - (void)updateRulers:(const NSRect *)rect;
  51. - (void)showHideRulers:sender;
  52.  
  53. /* Overridden from superclass */
  54.  
  55. - (void)reflectScrolledClipView:(NSClipView *)cView;
  56. - (void)tile;
  57. - (void)scrollClipView:(NSClipView *)aClipView toPoint:(NSPoint)aPoint;
  58. - (void)viewFrameChanged:(NSNotification *)notification;
  59.  
  60. @end
  61.