biographctrl.h

来自「人体生命曲线 根据科学理论」· C头文件 代码 · 共 100 行

H
100
字号

#pragma once

#define WM_BIO_SELECTCHANGING	WM_USER+1000
#define WM_BIO_SELECTCHANGED	WM_USER+1001

class BioGraphCtrl : public CWnd
{
public:
	CTime	m_bornDate;
	CTime	m_curDate;
	CTime	m_startDate;
	CTime	m_endDate;

	COLORREF m_topColor;
	COLORREF m_bottomColor;

	COLORREF m_focusColor;
	CTime m_focusDate;

public:
	void SetBornDate (CTime bornDate);
	CTime GetBornDate ();

	void SetCurDate (CTime curDate);
	CTime GetCurDate ();

	void SetStartDate (CTime startDate);
	CTime GetStartDate ();

	void SetEndDate (CTime endDate = NULL);
	CTime GetEndDate ();

	void SetFocusDate (CTime focusDate);
	CTime GetFocusDate ();

	void SetTopColor(COLORREF topColor);
	COLORREF GetTopColor();

	void SetBottomColor(COLORREF bottomColor);
	COLORREF GetBottomColor();

	void SetFocusColor(COLORREF focusColor);
	COLORREF GetFocusColor();

	float Eval (CTime testDate, int cycle);
	CString EvalString(CTime testDate);

	void GotoNextMonth();
	void GotoPrevMonth();
	void GotoCurrentMonth();
	//播放背景音乐
	void PlayMusic ();

protected:
	//画渐变颜色背景
	void DrawBackground (CDC* pDC);

	//画网格	
	void DrawGrid (CDC* pDC);

	void DrawGuage (CDC* pDC);

	//画生命曲线
	void DrawLifeCurve (CDC* pDC);
	void DrawLifeCurve (CDC* pDC, int cycle, float range, int width, COLORREF color);

	//
	void DrawLabel (CDC* pDC);

	//画焦点区域
	void DrawFocus (CDC* pDC);

	//计算时间差
	int CalcDays ();


public:

	// 重写
public:

	// 实现
public:
	BioGraphCtrl();
	virtual ~BioGraphCtrl();

protected:

	// 生成的消息映射函数
protected:

public:
	DECLARE_MESSAGE_MAP()
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnPaint();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);

};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?