home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 2.6 KB | 98 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Ruler.h
- // Release Version: $ ODF 1 $
- //
- // Author: Laurent Delamare
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef RULER_H
- #define RULER_H
-
- #ifndef FWSVIEW_H
- #include "FWSView.h"
- #endif
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- #ifndef FWSTYLE_H
- #include "FWStyle.h"
- #endif
-
- #ifndef FWFONT_H
- #include "FWFont.h"
- #endif
-
- //========================================================================================
- // Forward Class Definitions
- //========================================================================================
-
- class FW_CFont;
- class FW_CFrame;
- class FW_CPictureShape;
- class FW_CViewContext;
-
- //========================================================================================
- // CLASS CRuler
- //========================================================================================
-
- class CRuler : public FW_CSuperView
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(CRuler)
-
- //----------------------------------------------------------------------------------------
- // Initialization/destruction
- //
- public:
- CRuler(Environment* ev,
- FW_CSuperView* container,
- const FW_CRect& bounds,
- FW_EScrollingDirection scrollDir,
- FW_Fixed zoomFactor);
- virtual ~CRuler();
-
- private:
- CRuler(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
-
- // ----- Archiving -----
- static void* Create(FW_CReadableStream& stream, FW_ClassTypeConstant type);
- static void Destroy(void* object, FW_ClassTypeConstant type);
- virtual void Flatten(Environment* ev, FW_CWritableStream& stream) const;
- virtual void InitializeFromStream(Environment* ev, FW_CReadableStream& stream);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void ZoomFactorChanged(Environment* ev, FW_Fixed zoomFactor);
-
- protected:
- void RenderHorizontalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
- void RenderVerticalRuler(FW_CViewContext& vc, const FW_CRect& visibleRect);
- void RenderGradation(FW_CViewContext& vc,
- short gradation,
- const FW_CPoint& pos);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CStyle fLineStyle;
- FW_CFont fFont;
- };
-
- #endif
-