00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_CHARTTITLE_H__49972787_6D28_4F81_A12F_420947456913__INCLUDED_)
00023 #define AFX_CHARTTITLE_H__49972787_6D28_4F81_A12F_420947456913__INCLUDED_
00024
00025 #if _MSC_VER > 1000
00026 #pragma once
00027 #endif // _MSC_VER > 1000
00028
00029 #include <vector>
00030 #include <map>
00031 #include "ChartString.h"
00032 #include "ChartFont.h"
00033
00034 class CChartCtrl;
00035
00037
00042 class CChartTitle
00043 {
00044 friend CChartCtrl;
00045
00046 public:
00048 size_t GetStringCount() const;
00050 TChartString GetString(size_t Index) const;
00052 void AddString(const TChartString& NewString);
00054 void RemoveAll();
00055
00057
00063 void SetFont(int iPointSize, const TChartString& strFaceName);
00065
00071 void SetFont(const CChartFont& newFont);
00073
00081 void SetLineFont(int iLineIndex, int iPointSize, const TChartString& strFaceName);
00083
00091 void SetLineFont(int iLineIndex, const CChartFont& newFont);
00092
00094 void SetVisible(bool bVisible) { m_bIsVisible = bVisible; }
00096 bool IsVisible() const { return m_bIsVisible; }
00097
00099 COLORREF GetColor() const { return m_TextColor; }
00101 void SetColor(COLORREF NewColor);
00102
00104 BOOL IsPointInside(const CPoint& screenPoint) const;
00105
00106 private:
00108 CChartTitle(CChartCtrl* pParent);
00110 virtual ~CChartTitle();
00111
00113 void SetTitleRect(const CRect& newRect) { m_TitleRect = newRect; }
00115 CSize GetSize(CDC* pDC);
00117 void Draw(CDC *pDC);
00118
00120 CChartCtrl* m_pParentCtrl;
00122 std::vector<TChartString> m_StringArray;
00124 std::map<int, CChartFont> m_mapLineFonts;
00125
00127 bool m_bIsVisible;
00129 CChartFont m_DefaultFont;
00131 COLORREF m_TextColor;
00133 CRect m_TitleRect;
00134 };
00135
00136 #endif // !defined(AFX_CHARTTITLE_H__49972787_6D28_4F81_A12F_420947456913__INCLUDED_)