资源简介
vc 柱形图 CBarChart
http://blog./akof1314/archive/2010/07/10/5725301.aspx
http://blog./akof1314/archive/2010/07/10/5725301.aspx
代码片段和文件信息
/*********************************************************************
* BarChart.cpp
* implementation of
* CChartBar
* CChartData
* CChartPrinter
* CChartGCalc
* CGDIGrid
*
* Auther: Hamed.M.
* EMail : HamedMosavi @ gmail.com
*
* CAUTION Disclaimer:
* This code is provided as is without any warranty of
* any kind. The author is not responsible for whatever
* problem or damages that may occur as aresault of using
* this code. Use this entirely at your own risk.
* So don‘t try to find me if this code made your dog
* Sound like a frog or burned your car or even made your
* girl/boy friend shout on you. I am not responsible ;)
*
*
********************************************************************/
/********************************************************************
* History:
*
* Released : 2007/01/11
*
* BugFixes:
* 2007/01/11
* unsigned long double converted to -> double
* Some scaling bugs fixed
* Tooltips added
*
* 2007/01/15
* Some function changed.
* Tooltip updated.
* Some comments added.
*
* 2007/01/20
* Tooltips now behave much like tooltips(!)
*
* 2007/01/24
* Database connectivity added.
*
* 2007/01/26
* Tooltip bug fixed (SetCapture added).
********************************************************************/
#include “stdafx.h“
#include “BarChart.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
///////////////////////////////////////////////////////////////////////
// CBarChart Class
//
// Represents a chart control. The chart shows some bars
// Each bar has a value. Bars heights will be calculated
// Regarding other bars. The bars are able to show a percentage
// Instead of a value. The bar with maximum value has 100% and
// Percentage of other bars will be calculated in accordance to
// This maximum value.
//
///////////////////////////////////////////////////////////////////////
CBarChart::CBarChart()
{
m_rctClient = CRect(0 0 0 0);
SetBKColor(RGB(240 240 240));
m_pBmpBars = NULL;
m_pBmpOld = NULL;
ShowLabel(TRUE);
ShowGrid(TRUE);
ShowBarText(1 TRUE);
SetAutoScale(FALSE);
ShowTooltip(TRUE);
m_sztitle = ““;
m_szLastErr = ““;
}
CBarChart::~CBarChart()
{
if (m_brframe.GetSafeHandle())
{
m_brframe.Deleteobject();
}
if (m_pBmpOld)
{
m_dcMem.Selectobject(m_pBmpOld);
}
if (m_pBmpBars)
{
m_pBmpBars->Deleteobject();
delete m_pBmpBars;
m_pBmpBars = NULL;
}
if (m_dcMem.GetSafeHdc())
{
m_dcMem.DeleteDC();
}
}
BEGIN_MESSAGE_MAP(CBarChart CWnd)
//{{AFX_MSG_MAP(CBarChart)
ON_WM_ERASEBKGND()
ON_WM_PAINT()
ON_WM_MOUSEMOVE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5552 2010-07-10 15:29 Bar_Test\Bar_Test\Bar_Test.vcproj
文件 2755 2010-07-10 10:20 Bar_Test\Bar_Test\ReadMe.txt
文件 457 2010-07-10 10:20 Bar_Test\Bar_Test\Bar_Test.h
文件 1679 2010-07-10 10:20 Bar_Test\Bar_Test\Bar_Test.cpp
文件 610 2010-07-10 10:24 Bar_Test\Bar_Test\Bar_TestDlg.h
文件 4121 2010-07-10 11:09 Bar_Test\Bar_Test\Bar_TestDlg.cpp
文件 1854 2010-07-10 10:20 Bar_Test\Bar_Test\stdafx.h
文件 1030 2010-07-10 10:20 Bar_Test\Bar_Test\targetver.h
文件 141 2010-07-10 10:20 Bar_Test\Bar_Test\stdafx.cpp
文件 522 2010-07-10 10:20 Bar_Test\Bar_Test\Resource.h
文件 364 2010-07-10 10:20 Bar_Test\Bar_Test\res\Bar_Test.rc2
....... 67777 2007-11-28 16:21 Bar_Test\Bar_Test\res\Bar_Test.ico
文件 1417 2010-07-10 15:31 Bar_Test\Bar_Test\Bar_Test.vcproj.JianShe-PC.JianShe.user
文件 55319 2010-07-10 10:50 Bar_Test\Bar_Test\BarChart.cpp
文件 14426 2010-07-10 10:27 Bar_Test\Bar_Test\BarChart.h
文件 6994 2010-07-10 11:09 Bar_Test\Bar_Test\Debug\BuildLog.htm
文件 104772 2010-07-10 11:09 Bar_Test\Bar_Test\Bar_Test.aps
文件 5076 2010-07-10 11:09 Bar_Test\Bar_Test\Bar_Test.rc
文件 9496 2010-07-10 15:30 Bar_Test\Bar_Test\Release\BuildLog.htm
文件 16526336 2010-07-10 15:31 Bar_Test\Bar_Test.ncb
文件 890 2010-07-10 10:20 Bar_Test\Bar_Test.sln
..A..H. 17408 2010-07-10 15:31 Bar_Test\Bar_Test.suo
文件 1758208 2010-07-10 15:30 Bar_Test\Bar_Test.exe
文件 11100 2010-07-06 00:58 Sample_Access_Databa
文件 40845 2010-07-06 00:57 BarChart_demo.zip
文件 122477 2010-07-05 23:18 BarChart_exe.zip
目录 0 2010-07-10 10:20 Bar_Test\Bar_Test\res
目录 0 2010-07-10 10:24 Bar_Test\Bar_Test\Debug
目录 0 2010-07-10 15:29 Bar_Test\Bar_Test\Release
目录 0 2010-07-10 10:20 Bar_Test\Bar_Test
............此处省略4个文件信息
- 上一篇:组态软件IFIX 学习 教程
- 下一篇:汇编语言实例
评论
共有 条评论