// $Revision: 1.11 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994, 1995 Taligent, Inc. All rights reserved. // // Project: StockBrowser // File: ViewerDrawers.h // Build/Version: 1.0.0 // // Description: TPriceDrawer graphs stock price information, consisting // of high price, low price and closing price. // // TVolumeDrawer graphs stock trading volume information. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_VIEWERDRAWERS #define TaligentSamples_VIEWERDRAWERS #ifndef TaligentSamples_BARDRAWER #include #endif #ifndef TaligentSamples_STOCKDAY #include #endif #ifndef TaligentSamples_GRAPHRANGE #include // Included for GraphValue #endif #ifndef Taligent_GRAPHICS #include // Included for TArea and TLine #endif //============================================================================== // TPriceDrawer class TPriceDrawer : public TGraphDrawer { public: TaligentTypeExtensionDeclarationsMacro(TPriceDrawer) public: TPriceDrawer(GraphValue dataPointWidth, GraphValue dataPointInterval, TCollectionOf* stocksForAdoption); TPriceDrawer(const TPriceDrawer& source); virtual ~TPriceDrawer(); TPriceDrawer& operator=(const TPriceDrawer& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); virtual GraphValue GetDataPointWidth() const; virtual GraphValue GetDataPointInterval() const; virtual void SetDataPointWidth(GraphValue width); virtual void SetDataPointInterval(GraphValue interval); virtual void SetLineColor(const TColor& color); virtual void SetBoxColor(const TColor& color); virtual void SetBoxSize(const TGPoint& size); //................................................................... // TGraphDrawer overrides virtual void DrawIntoGraph(TGrafPort& port) const; virtual TGRect GetBounds() const; protected: TPriceDrawer(); // For streaming only private: void CopyStocks(const TCollectionOf& source); void DeleteStocks(); enum {kOriginalVersion}; TCollectionOf* fStocks; GraphValue fDataPointWidth; GraphValue fDataPointInterval; TLine fLine; TArea fClosePriceBox; }; //============================================================================== // TVolumeDrawer class TVolumeDrawer : public TBarDrawer { public: TaligentTypeExtensionDeclarationsMacro(TVolumeDrawer) public: TVolumeDrawer( GraphValue xAxisLocation, GraphValue barWidth, GraphValue barInterval, const TCollectionOf& stocks); TVolumeDrawer(const TVolumeDrawer& source); virtual ~TVolumeDrawer(); TVolumeDrawer& operator=(const TVolumeDrawer& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); void SetVolumeInformation(const TCollectionOf& stocks); protected: TVolumeDrawer(); // For streaming only private: enum {kOriginalVersion}; }; #endif