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

  1. // RuledScrollView.h
  2. // RuledScrollView is intended as a general purpose class to make it
  3. // easy to add all kinds of rulers to any view.  This class is an 
  4. // extension of the tiledScrollView class, from "ScrollDoodScroll" 
  5. // (by Jayson Adams, NeXT Developer Support Team)
  6. // This class is intended to be widely useful without needing to
  7. // modify (or understand) its code, so it provides methods to setup 
  8. // the mainView and its rulerViews, rather than hardcoding the setup.
  9. // Kevin Brain (ksbrain@zeus.UWaterloo.ca)
  10.  
  11. #import <appkit/ScrollView.h>
  12. #import <appkit/ClipView.h>
  13. #import "Ruler.h"
  14.  
  15. // These manifests indicate which edge a scaleView is added to.,
  16. // Also, they give the 'slice' parameter of the NXDivideRect function.
  17. // (See the documentation for the NXDivideRect function in the
  18. // file NXFunctsStoZ.rtfd release 2)
  19. #define LEFTEDGE 0
  20. #define BOTTOMEDGE 1
  21. #define RIGHTEDGE 2
  22. #define TOPEDGE 3
  23. #define BOTTOMLEFTCORNER 4
  24. #define TOPLEFTCORNER 5
  25. #define BOTTOMRIGHTCORNER 6
  26. #define TOPRIGHTCORNER 7
  27.  
  28. #define    TOPBOTTOM 1
  29. #define    LEFTRIGHT 2
  30.  
  31. @interface RuledScrollView:ScrollView
  32.  
  33. {
  34.     View     *mainView,*printView;
  35.     id        leftRuler;
  36.     id        rightRuler;
  37.     id        topRuler;
  38.     id        bottomRuler;
  39.     id        bottomLeftStub;
  40.     id        topLeftStub;
  41.     id        bottomRightStub;
  42.     id        topRightStub;
  43.     ClipView *leftRulerClipView,*rightRulerClipView;
  44.     ClipView *topRulerClipView,*bottomRulerClipView;
  45.     // original rectangles of ClipViews before adjusting them for printing
  46.     NXRect    oldMainClipRect,oldLeftRect, oldRightRect, oldTopRect, oldBottomRect;
  47.     NXRect    oldRect;
  48.     // Connect popupListButton to a popUpList's button in Interface Builder 
  49.     // if you want a popUpList in the horizontal scroller (eg. for zooming)
  50.     id        hScrollerLeftEmbeddedView;
  51.     id        hScrollerRightEmbeddedView;
  52.     id        vScrollerTopEmbeddedView;
  53.     id        vScrollerBottomEmbeddedView;
  54.     BOOL    rulersOn;
  55.     int        rulerVisible[4];
  56.     id        printWindow;    
  57.     ClipView *mainPrintClipView;    // clipView that holds mainView 
  58.                                     // while constructing the printView
  59.     NXPoint    mainVisiblePoint;        // point to scroll mainView to
  60.     int    primaryRulers;                // which rulers extend to edge
  61. }
  62.  
  63. /* instance methods */
  64. - initFrame:(NXRect *)theFrame;
  65. - free;
  66. - setLeftRuler:anObject;
  67. - setRightRuler:anObject;
  68. - setTopRuler:anObject;
  69. - setBottomRuler:anObject;
  70. - setBottomLeftStub:anObject;
  71. - setTopLeftStub:anObject;
  72. - setBottomRightStub:anObject;
  73. - setTopRightStub:anObject;
  74. - addRulerView:(Ruler *)theView toEdge:(int)edge;
  75. - addStubView:(View *)theView toCorner:(int)corner;
  76. - tile;
  77. - reflectScroll:cView;
  78. - scrollClip:aClipView to:(NXPoint *)aPoint;
  79. - setSizeIfNeeded;
  80. - setSize;
  81. - setPrimaryRulers:(int)orientation;
  82. - (int)primaryRulers;
  83. - showRuler:(int)whichRuler;
  84. - hideRuler:(int)whichRuler;
  85. - (BOOL)isRulerVisible:(int)whichRuler;
  86. - topRuler;
  87. - bottomRuler;
  88. - leftRuler;
  89. - rightRuler;
  90. - bottomLeftStub;
  91. - topLeftStub;
  92. - bottomRightStub;
  93. - topRightStub;
  94. - getMinSize:(NXSize *)theSize;
  95. - printVisible:sender;
  96. - writeToStream:(NXStream *)stream;
  97.  
  98. @end
  99.