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_CHARTLEGEND_H__CD72E5A0_8F52_472A_A611_C588F642080B__INCLUDED_)
00023 #define AFX_CHARTLEGEND_H__CD72E5A0_8F52_472A_A611_C588F642080B__INCLUDED_
00024
00025 #if _MSC_VER > 1000
00026 #pragma once
00027 #endif // _MSC_VER > 1000
00028
00029 #include "ChartCtrl.h"
00030
00031 #include "ChartString.h"
00032
00033 class CChartSerie;
00034
00036
00041 class CChartLegend
00042 {
00043 friend CChartCtrl;
00044
00045 public:
00047 void SetFont(int iPointSize, const TChartString& strFaceName);
00048
00050 enum DockSide
00051 {
00052 dsDockRight,
00053 dsDockLeft,
00054 dsDockTop,
00055 dsDockBottom
00056 };
00057
00059 void DockLegend(DockSide dsSide);
00061
00070 void UndockLegend(int iLeftPos, int iTopPos);
00071
00073 void SetTransparent(bool bTransparent);
00075
00079 void SetHorizontalMode(bool bHorizontal);
00080
00082 void SetVisible(bool bVisible);
00084 bool IsVisible() const { return m_bIsVisible; }
00085
00087 COLORREF GetBackColor() const { return m_BackColor; }
00089 void SetBackColor(COLORREF NewColor);
00091 COLORREF GetShadowColor() const { return m_ShadowColor; }
00093 void SetShadowColor(COLORREF NewColor);
00095 void EnableShadow(bool bEnable);
00097 void SetShadowDepth(int Depth);
00098
00100 BOOL IsPointInside(const CPoint& screenPoint) const;
00101
00102 private:
00104 CChartLegend(CChartCtrl* pParent);
00106 virtual ~CChartLegend();
00107
00109 void Draw(CDC* pDC);
00111 void ClipArea(CRect& rcControl, CDC* pDC);
00113 void UpdatePosition(CDC* pDC, const CRect& rcControl);
00114
00116 CChartCtrl* m_pParentCtrl;
00118 CRect m_LegendRect;
00119
00121 TChartString m_strFontName;
00123 int m_iFontSize;
00124
00126 bool m_bDocked;
00128 DockSide m_DockSide;
00129
00131 int m_iLeftPos;
00133 int m_iTopPos;
00134
00136 bool m_bIsVisible;
00138 bool m_bIsTransparent;
00140 bool m_bIsHorizontal;
00142 bool m_bShadow;
00144 int m_iShadowDepth;
00145
00147 COLORREF m_BackColor;
00149 COLORREF m_ShadowColor;
00150
00152 CSize m_BitmapSize;
00153 };
00154
00155 #endif // !defined(AFX_CHARTLEGEND_H__CD72E5A0_8F52_472A_A611_C588F642080B__INCLUDED_)