home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CScrollorama 1.1 / CScrollorama.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  2.9 KB  |  110 lines  |  [TEXT/KAHL]

  1. /*
  2.  * CScrollorama.h
  3.  *
  4.  */
  5.  
  6.  
  7.  
  8. /********************************/
  9.  
  10. #pragma once
  11.  
  12. /********************************/
  13.  
  14. #include <CPanorama.h>
  15.  
  16. /********************************/
  17.  
  18.  
  19.  
  20. class CScrollorama : public CPanorama {
  21.     
  22. public:
  23.     
  24.     void            IScrollorama(CView *anEnclosure, CBureaucrat *aSupervisor,
  25.                         short aWidth, short aHeight,
  26.                         short aHEncl, short aVEncl,
  27.                         SizingOption aHSizing, SizingOption aVSizing);
  28.     void            IViewTemp(CView *anEnclosure, CBureaucrat *aSupervisor,
  29.                         Ptr viewData);
  30.     void            IScrolloramaX(void);
  31.     void            Dispose(void);
  32.     
  33.     
  34.                         // The first feature:  contained scrolling.
  35.                         // (See also the code for Scroll()).
  36.     void            setShowMargin(LongRect *newShowMargin);
  37.     void            getShowMargin(LongRect *theShowMargin);
  38.     void            setShowBounds(LongRect *newShowBounds); // convenience method
  39.     void            getShowBounds(LongRect *theShowBounds); // convenience method
  40.     
  41.                         // The second feature:  non-flashing scrolling.
  42.     void            Scroll(long hDelta, long vDelta, Boolean redraw);
  43.     
  44.                         // The third feature:  Mårten Sörliden's bug fix.
  45.     void            SetBounds(LongRect *aBounds);
  46.     
  47.                         // The fourth feature:  avoidance behavior.
  48.                         // (See also the code for Scroll()).
  49.     void            setAvoidSubscrolloramas(Boolean newAvoidSubscrolloramas);
  50.     Boolean        getAvoidSubscrolloramas(void);
  51.     void            setBeAvoided(Boolean newBeAvoided);
  52.     Boolean        getBeAvoided(void);
  53.     void            setClipToAvoidedRgn(Boolean newClipToAvoidedRgn);
  54.     Boolean        getClipToAvoidedRgn(void);
  55.     void            setAvoidedRgn(RgnHandle newAvoidedRgn);
  56.     void            getAvoidedRgn(RgnHandle theAvoidedRgn); // copies rgn into a valid RgnHandle
  57.     
  58.     
  59.                         /*
  60.                          * Housekeeping methods for the fourth feature.  These are public
  61.                          * because you can't screw anything up by calling them, and they
  62.                          * can be useful.  (In fact, a CScrollorama must sometimes call
  63.                          * markPaneVisRgnAsOutOfDate() for its enclosure.)
  64.                          */
  65.     void            markPaneVisRgnAsOutOfDate(void);
  66.     Boolean        getPaneVisRgnIsUpToDate(void);
  67.     void            updatePaneVisRgn(void);
  68.     
  69.     
  70.                         /*
  71.                          * Overrides required by the fourth feature:
  72.                          * keeping the paneVisRgn up to date.
  73.                          */
  74.     void            Hide(void);
  75.     void            Show(void);
  76.     void            AddSubview(CView *theSubview);
  77.     void            RemoveSubview(CView *theSubview);
  78.     void            Offset(long hOffset, long vOffset, Boolean redraw);
  79.     void            ChangeSize(Rect *delta, Boolean redraw);
  80.     
  81.                         /*
  82.                          * More overrides required by the fourth feature:
  83.                          * handling the actual drawing procedure.
  84.                          */
  85.     void            DrawAll(Rect *area);
  86.     void            Prepare(void);
  87.     
  88.     
  89. protected:
  90.     
  91.                         // For the first feature.
  92.     LongRect        showMargin;
  93.     
  94.                         // For the fourth feature.
  95.     Boolean        pvrIsUpToDate;
  96.     Boolean        avoidSubscrolloramas;
  97.     Boolean        beAvoided;
  98.     Boolean        clipToAvoidedRgn;
  99.     RgnHandle    avoidedRgn;
  100.     RgnHandle    paneVisRgn;
  101.     
  102.                         // Protected methods for the fourth feature.
  103.     void            forgetPaneVisRgn(void);
  104.     void            forgetAvoidedRgn(void);
  105.     
  106.     
  107. private:
  108.     
  109. } ;
  110.