📄 exam6_1view.cpp
字号:
// Exam6_1View.cpp : implementation of the CExam6_1View class
//
#include "stdafx.h"
#include "Exam6_1.h"
#include "Exam6_1Doc.h"
#include "Exam6_1View.h"
#include "ModelessDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExam6_1View
IMPLEMENT_DYNCREATE(CExam6_1View, CView)
BEGIN_MESSAGE_MAP(CExam6_1View, CView)
//{{AFX_MSG_MAP(CExam6_1View)
ON_COMMAND(ID_CIRCLE, OnCircle)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExam6_1View construction/destruction
CExam6_1View::CExam6_1View()
{
// TODO: add construction code here
m_pDlg=NULL;
}
CExam6_1View::~CExam6_1View()
{
}
BOOL CExam6_1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CExam6_1View drawing
void CExam6_1View::OnDraw(CDC* pDC)
{
CExam6_1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->TextOut(0,0,"高等数学 大学物理 大学英语 哲学 计算机基础 总分") ;//输出表头
CString str;//将int型数据转换为格式字符串
str.Format("%10d%16d%16d%16d%16d%18d",pDoc->score[0],pDoc->score[1],
pDoc->score[2],pDoc->score[3],pDoc->score[4],pDoc->TScore );
pDC->TextOut(0,20,str); //输出成绩
}
/////////////////////////////////////////////////////////////////////////////
// CExam6_1View printing
BOOL CExam6_1View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CExam6_1View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CExam6_1View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CExam6_1View diagnostics
#ifdef _DEBUG
void CExam6_1View::AssertValid() const
{
CView::AssertValid();
}
void CExam6_1View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CExam6_1Doc* CExam6_1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CExam6_1Doc)));
return (CExam6_1Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CExam6_1View message handlers
void CExam6_1View::OnCircle()
{
// TODO: Add your command handler code here
if (m_pDlg)
m_pDlg->SetActiveWindow();//激活对话框
else
{
// 创建对话框
m_pDlg=new CModelessDlg(this); //创建对话框对象
m_pDlg->m_parent=this; //对话框对象获取主窗口视图指针
m_pDlg->Create (IDD_DIALOG2,this); //创建对话框窗口
m_pDlg->ShowWindow(SW_SHOW);//显示对话框
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -