⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exam7_3view.cpp

📁 This is Visual C++ basis operation. Using that you can fast go in study.
💻 CPP
字号:
// exam7_3View.cpp : implementation of the CExam7_3View class
//

#include "stdafx.h"
#include "exam7_3.h"

#include "exam7_3Doc.h"
#include "exam7_3View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CExam7_3View

IMPLEMENT_DYNCREATE(CExam7_3View, CView)

BEGIN_MESSAGE_MAP(CExam7_3View, CView)
	//{{AFX_MSG_MAP(CExam7_3View)
		// 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)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExam7_3View construction/destruction

CExam7_3View::CExam7_3View()
{
	// TODO: add construction code here

}

CExam7_3View::~CExam7_3View()
{
}

BOOL CExam7_3View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CExam7_3View drawing

void CExam7_3View::OnDraw(CDC* pDC)
{
	CExam7_3Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	int i=0;
	CString radstr;
	radstr.Format(" 选择了第%d个单选按钮",pDoc->m_radsel+1 ); 
	pDC->TextOut (0,0,radstr);
	
	if(pDoc->m_check1 )
	{i=i+20;pDC->TextOut (0,i,"选中了第1个复选框");}
	if(pDoc->m_check2 )
	{i=i+20;pDC->TextOut (0,i,"选中了第2个复选框");}
	if(pDoc->m_check3 )
	{i=i+20;pDC->TextOut (0,i,"选中了第3个复选框");}
	
	i=i+20;
	pDC->TextOut(0,i,pDoc->m_strList ); 
	
	
	CString liststr="";
	
	for( int j=0;j<pDoc->m_selCount ;j++)
	switch(pDoc->m_selItem [i])
	{ case 0: liststr+="item01 ";break;
	  case 1: liststr+="item02 ";break;
	  case 2: liststr+="item03 ";break;
	  case 3: liststr+="item04 ";break;
	  case 4: liststr+="item05 ";break;
	  case 5: liststr+="item06 ";break;
	  case 6: liststr+="item07 ";break;
	  case 7: liststr+="item08 ";break;
	  case 8: liststr+="item09 ";break;
	  case 9: liststr+="item10 ";break;
	  case 10: liststr+="item11 ";break;
	  case 11: liststr+="item12 ";break;

	}  
	i=i+20;
	pDC->TextOut(0,i,liststr ); 

	i=i+20;
	CString combostr="";
	switch(pDoc->m_index )
	{ case 0: combostr="item11 ";break;
	  case 1: combostr="item12 ";break;
	  case 2: combostr="item13 ";break;
	  case 3: combostr="item14 ";break;
	 	}  
      pDC->TextOut(0,i,combostr); 	

}


/////////////////////////////////////////////////////////////////////////////
// CExam7_3View printing

BOOL CExam7_3View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CExam7_3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CExam7_3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CExam7_3View diagnostics

#ifdef _DEBUG
void CExam7_3View::AssertValid() const
{
	CView::AssertValid();
}

void CExam7_3View::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CExam7_3Doc* CExam7_3View::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CExam7_3Doc)));
	return (CExam7_3Doc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CExam7_3View message handlers

⌨️ 快捷键说明

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