📄 drawdlg.cpp
字号:
// DrawDlg.cpp : implementation file
//
#include "stdafx.h"
#include "S2009072032.h"
#include "DrawDlg.h"
#include "Graph.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDrawDlg dialog
CDrawDlg::CDrawDlg(CWnd* pParent /*=NULL*/)
: CDialog(CDrawDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CDrawDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_strTitle="成绩分布图";
m_nMode=0;
}
void CDrawDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDrawDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDrawDlg, CDialog)
//{{AFX_MSG_MAP(CDrawDlg)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDrawDlg message handlers
CGraph graph;
BOOL CDrawDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetWindowText(m_strTitle);
graph.DelAllData();
for(int i=0; i<m_uData.GetSize(); i++)
graph.AddData(m_uData[i]);
graph.SetDrawMode(m_nMode);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDrawDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
UpdateWindow();
CRect rc;
GetClientRect(rc);
graph.SetDrawRect(rc);
graph.Draw(&dc,TRUE);
// Do not call CDialog::OnPaint() for painting messages
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -