【VC开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VC开源代码-Ex05_7View.cpp的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
// Ex05_7View.cpp : implementation of the CEx05_7View class
//
#include "stdafx.h"
#include "Ex05_7.h"
#include "Ex05_7Doc.h"
#include "Ex05_7View.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx05_7View
IMPLEMENT_DYNCREATE(CEx05_7View, CView)
BEGIN_MESSAGE_MAP(CEx05_7View, CView)
//{{AFX_MSG_MAP(CEx05_7View)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}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)
ON_BN_CLICKED(IDC_CHECK,OnClick)// 复选按钮的消息映射说明
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEx05_7View construction/destruction
CEx05_7View::CEx05_7View()
{
// TODO: add construction code here
}
CEx05_7View::~CEx05_7View()
{
}
BOOL CEx05_7View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_7View drawing
void CEx05_7View::OnDraw(CDC* pDC)
{
CEx05_7Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CString clickmsg;
if(((CMainFrame*)(AfxGetApp()->m_pMainWnd))->m_check.GetCheck())
clickmsg="复选框被选中!";
else
clickmsg="复选框未被选中!";
pDC->TextOut(10,10,clickmsg);
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_7View printing
BOOL CEx05_7View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CEx05_7View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CEx05_7View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CEx05_7View diagnostics
#ifdef _DEBUG
void CEx05_7View::AssertValid() const
{
CView::AssertValid();
}
void CEx05_7View::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CEx05_7Doc* CEx05_7View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx05_7Doc)));
return (CEx05_7Doc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx05_7View message handlers
void CEx05_7View::OnClick()//单击复选框的消息响应函数
{
Invalidate();
}
上一篇:
Ex05_7Doc.cpp
下一篇:
关于听觉掩蔽的语音增强算法及DSP实现