00001 /* 00002 * 00003 * ChartBalloonLabel.h 00004 * 00005 * Written by Cédric Moonen (cedric_moonen@hotmail.com) 00006 * 00007 * 00008 * 00009 * This code may be used for any non-commercial and commercial purposes in a compiled form. 00010 * The code may be redistributed as long as it remains unmodified and providing that the 00011 * author name and this disclaimer remain intact. The sources can be modified WITH the author 00012 * consent only. 00013 * 00014 * This code is provided without any garanties. I cannot be held responsible for the damage or 00015 * the loss of time it causes. Use it at your own risks 00016 * 00017 * An e-mail to notify me that you are using this code is appreciated also. 00018 * 00019 * 00020 */ 00021 00022 #ifndef _CHARTBALLOONLABEL_H_ 00023 #define _CHARTBALLOONLABEL_H_ 00024 00025 #include "ChartLabel.h" 00026 #include "ChartFont.h" 00027 00029 00034 template <class PointType> 00035 class CChartBalloonLabel : public CChartLabel<PointType> 00036 { 00037 friend CChartSerieBase<PointType>; 00038 00039 public: 00041 void SetBackgroundColor(COLORREF colBackground); 00043 COLORREF GetBackgroundColor() const { return m_colBackground; } 00045 void SetLineColor(COLORREF colArrow); 00047 COLORREF GetLineColor() const { return m_colLine; } 00049 void SetBorderColor(COLORREF colBorder); 00051 COLORREF GetBorderColor() const { return m_colBorder; } 00052 00054 void SetRoundedRect(bool bRounded); 00056 bool GetRoundedRect() const { return m_bRoundedRect; } 00057 00059 00065 void SetFont(int nPointSize, const TChartString& strFaceName); 00067 00073 void SetFont(const CChartFont& newFont); 00074 00076 CChartBalloonLabel(CChartCtrl* pParentCtrl, CChartSerieBase<PointType>* pParentSeries); 00078 ~CChartBalloonLabel(); 00079 00080 protected: 00082 void Draw(CDC* pDC, unsigned uPointIndex); 00083 00084 private: 00086 COLORREF m_colLine; 00088 COLORREF m_colBackground; 00090 COLORREF m_colBorder; 00091 00093 CChartFont m_Font; 00094 00096 bool m_bRoundedRect; 00097 }; 00098 00099 #include "ChartBalloonLabel.inl" 00100 00101 #endif // _CHARTBALLOONLABEL_H_