home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 3.2 KB | 109 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Frame.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FRAME_H
- #define FRAME_H
-
- // ----- Framework Includes -----
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTRING_H
- #include "FWString.h"
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWMAPING_H
- #include "FWMaping.h"
- #endif
-
- //========================================================================================
- // Classes used by this interface
- //========================================================================================
-
- class FW_CTime;
- class CClockPart;
- class CClockContent;
- class FW_CGraphicContext;
-
-
- //========================================================================================
- // CClockFrame
- //========================================================================================
-
- class CClockFrame : public FW_CFrame
- {
- public:
- FW_DECLARE_AUTO(CClockFrame)
-
- //----------------------------------------------------------------------------------------
- // Constructor/Destructor
- //
- public:
- CClockFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CClockPart* clockPart, CClockContent* content);
- virtual ~ CClockFrame();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
- virtual void Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
-
- virtual ODShape* AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
- virtual ODShape* AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
-
- virtual void FrameShapeChanged(Environment* ev);
- virtual void CreateSubViews(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void UpdateAnalogClock(Environment* ev, FW_CGraphicContext& gc, const FW_CTime& time);
- void UpdateDigitalClock(Environment* ev, FW_CGraphicContext& gc, const FW_CTime& time);
-
- void UpdateClock(Environment* ev, const FW_CTime& time);
- void ChangeClockType(Environment* ev, short newClockType);
-
- private:
- void DrawClockFace(Environment* ev, FW_CGraphicContext& gc);
- void DrawHourHand(Environment* ev, FW_CGraphicContext& gc, FW_Fixed hour, FW_Fixed minute);
- void DrawMinuteHand(Environment* ev, FW_CGraphicContext& gc, FW_Fixed minute);
- void DrawSecondHand(Environment* ev, FW_CGraphicContext& gc, FW_Fixed second);
-
- void ResetMapping(Environment* ev);
-
- FW_CRect GetDigitalClockRect(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CClockPart* fClockPart;
- CClockContent* fContent;
- FW_CString32 fFaceString;
- FW_CMapping fMapping;
- FW_CFont fDigitalFont;
- FW_CTime fLastTime;
- CClockContent* fClockContent;
-
- };
-
- #endif
-