www.pudn.com > NiHe > NiHeView.cpp


// NiHeView.cpp : implementation of the CNiHeView class 
// 
 
#include "stdafx.h" 
#include "NiHe.h" 
 
#include "NiHeDoc.h" 
#include "NiHeView.h" 
#include "ShuJuInput.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CNiHeView 
 
IMPLEMENT_DYNCREATE(CNiHeView, CView) 
 
BEGIN_MESSAGE_MAP(CNiHeView, CView) 
	//{{AFX_MSG_MAP(CNiHeView) 
	ON_COMMAND(ID_POINT_INPUT, OnPointInput) 
	ON_COMMAND(ID_POINTS_PREVIEW, OnPointsPreview) 
	ON_COMMAND(ID_RESULT_SHOW, OnResultShow) 
	ON_COMMAND(ID_QUXIANNIHE, OnQuXianNiHe) 
	//}}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() 
 
///////////////////////////////////////////////////////////////////////////// 
// CNiHeView construction/destruction 
 
CNiHeView::CNiHeView() 
{ 
	// TODO: add construction code here 
	count=0; 
} 
 
CNiHeView::~CNiHeView() 
{ 
} 
 
BOOL CNiHeView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CView::PreCreateWindow(cs); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CNiHeView drawing 
 
void CNiHeView::OnDraw(CDC* pDC) 
{ 
	CNiHeDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	int i; 
	char str[20]; 
	sprintf(str,"已经有离散点个数为:"); 
	pDC->TextOut(10,0,str); 
	sprintf(str,"%d",count); 
	pDC->TextOut(160,0,str); 
	for(i=1;i<=count;i++) 
	{ 
		; 
	} 
	// TODO: add draw code for native data here 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CNiHeView printing 
 
BOOL CNiHeView::OnPreparePrinting(CPrintInfo* pInfo) 
{ 
	// default preparation 
	return DoPreparePrinting(pInfo); 
} 
 
void CNiHeView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add extra initialization before printing 
} 
 
void CNiHeView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add cleanup after printing 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CNiHeView diagnostics 
 
#ifdef _DEBUG 
void CNiHeView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CNiHeView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
 
CNiHeDoc* CNiHeView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CNiHeDoc))); 
	return (CNiHeDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CNiHeView message handlers 
 
void CNiHeView::OnPointInput()  
{ 
	// TODO: Add your command handler code here 
	CNiHeDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	ShuJuInput dlg; 
	dlg.m_count=1;                         //初始化对话框计数值 
	count=0; 
	if(dlg.DoModal()!=IDOK) 
	{ 
		count++; 
		 
	} 
	Invalidate(true); 
} 
 
void CNiHeView::OnPointsPreview()  
{ 
	// TODO: Add your command handler code here	 
} 
 
void CNiHeView::OnResultShow()  
{ 
	// TODO: Add your command handler code here 
	 
} 
 
void CNiHeView::OnQuXianNiHe()  
{ 
	// TODO: Add your command handler code here 
	 
}