home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Draw / Sources / Ruler.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.5 KB  |  96 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Ruler.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef RULER_H
  11. #define RULER_H
  12.  
  13. #ifndef FWSVIEW_H
  14. #include "FWSView.h"
  15. #endif
  16.  
  17. #ifndef FWRUNTYP_H
  18. #include "FWRunTyp.h"
  19. #endif
  20.  
  21. #ifndef FWSTYLE_H
  22. #include "FWStyle.h"
  23. #endif
  24.  
  25. #ifndef FWFONT_H
  26. #include "FWFont.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Class Definitions
  31. //========================================================================================
  32.  
  33. class FW_CFont;
  34. class FW_CFrame;
  35. class FW_CPictureShape;
  36. class FW_CViewContext;
  37.  
  38. //========================================================================================
  39. //    CLASS CRuler
  40. //========================================================================================
  41.  
  42. class CRuler : public FW_CSuperView
  43. {
  44. public:
  45.     FW_DECLARE_CLASS
  46.     FW_DECLARE_AUTO(CRuler)
  47.     
  48. //----------------------------------------------------------------------------------------
  49. //    Initialization/destruction
  50. //
  51. public:
  52.     CRuler(Environment* ev, 
  53.             FW_CSuperView* container, 
  54.             const FW_CRect& bounds, 
  55.             FW_EScrollingDirection scrollDir,
  56.             FW_Fixed zoomFactor);
  57.     virtual ~CRuler();    
  58.  
  59. private:
  60.     CRuler(Environment* ev);
  61.  
  62. //----------------------------------------------------------------------------------------
  63. //    Inherited API
  64. //
  65. public:
  66.     virtual void     Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  67.  
  68.     // ----- Archiving -----
  69.     static void*    Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  70.     static void        Destroy(void* object, FW_ClassTypeConstant type);
  71.     virtual void    Flatten(Environment* ev, FW_CWritableStream& stream) const;
  72.     virtual void    InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
  73.     
  74. //----------------------------------------------------------------------------------------
  75. //    New API
  76. //
  77. public:
  78.     void            ZoomFactorChanged(Environment* ev, FW_Fixed zoomFactor);
  79.     
  80. protected:
  81.     void             RenderHorizontalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
  82.     void             RenderVerticalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
  83.     void            RenderGradation(FW_CViewContext& vc,
  84.                                     short gradation, 
  85.                                     const FW_CPoint& pos);
  86.     
  87. //----------------------------------------------------------------------------------------
  88. //    Data Members
  89. //
  90. private:
  91.     FW_CStyle    fLineStyle;
  92.     FW_CFont    fFont;
  93. };
  94.  
  95. #endif
  96.