// $Revision: 1.12 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. // // Project: StockBrowser // File: BarDrawer.h // Build/Version: 1.0.0 // // Description: TBarDrawer draws vertical bars on a TStandardGraph. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_BARDRAWER #define TaligentSamples_BARDRAWER class TBarDrawer; #ifndef TaligentSamples_GRAPHDRAWER #include "GraphDrawer.h" #endif #ifndef TaligentSamples_GRAPHRANGE #include "GraphRange.h" // for GraphValue #endif #ifndef Taligent_GRAPHICS #include #endif class TRawArray; //============================================================================== // TBarDrawer class TBarDrawer : public TGraphDrawer { public: TaligentTypeExtensionDeclarationsMacro(TBarDrawer) public: TBarDrawer( GraphValue xAxisLocation, GraphValue barWidth, GraphValue barInterval, TRawArray* valuesForAdoption); TBarDrawer(const TBarDrawer& source); virtual ~TBarDrawer(); TBarDrawer& operator=(const TBarDrawer& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); virtual void AdoptValues(TRawArray* valuesForAdoption); virtual TRawArray* OrphanValues(); virtual GraphValue GetBarWidth() const; virtual GraphValue GetBarInterval() const; virtual GraphValue GetXAxisLocation() const; virtual void SetBarWidth(const GraphValue& width); virtual void SetBarInterval(const GraphValue& interval); virtual void SetXAxisLocation(GraphValue xAxisLocation); virtual void SetBarColor(const TRGBColor& color); //................................................................... // TGraphDrawer overrides virtual void DrawIntoGraph(TGrafPort& port) const; virtual TGRect GetBounds() const; protected: TBarDrawer(); virtual void SetBar(GraphValue xValue, GraphValue yValue, TArea& bar) const; private: enum {kOriginalVersion}; GraphValue fBarWidth; GraphValue fBarInterval; TRawArray* fValues; TArea fBar; GraphValue fXAxisLocation; }; #endif