// $Revision: 1.4 $ // Copyright (c) 1994-1995 Taligent, Inc. All rights reserved. #ifndef TaligentSamples_GRAPHICVIEW #define TaligentSamples_GRAPHICVIEW #ifndef Taligent_ACTIVATIBLEVIEW #include #endif #ifndef Taligent_MOUSEINPUT #include #endif #ifndef Taligent_RGBCOLOR #include #endif #ifndef Taligent_NUMBERFORMAT #include #endif #ifndef Taligent_TEXTDISPLAY #include #endif class TGraphicView : public TContentView, public MMouseEventHandler { public: MCollectibleDeclarationsMacro(TGraphicView); TGraphicView(); TGraphicView(const TGPoint& size, const TGPoint& location = TGPoint::kOrigin); virtual ~TGraphicView(); virtual void HandleAfterConnectionToViewRoot(); virtual void HandleBeforeDisconnectionFromViewRoot(); virtual void SetColor(const TColor&); // called by interactors virtual void SetPoint(const TGPoint&); virtual void DrawContents(TGrafPort&) const; virtual bool MouseButtonDown(TMouseDownEvent&, short); virtual void AddInteractor(TInteractor*); // used by interactor only. virtual void RemoveInteractor(const TInteractor&); protected: virtual void HandleDeactivate(); virtual void HandleAllocatedAreaChanged(const TGArea&); virtual void ResizeDisplay(const TGArea&); private: TInteractor* fInteractor; TRGBColor fColor; TGPoint fPoint; TTextDisplay fDisplay; // Cache. TUniversalNumberFormatter fFormatter; enum EVersion { kOriginalVersion }; }; #endif // TaligentSamples_GRAPHICVIEW