www.pudn.com > ManyControl.rar > MyDialogView.cpp


// MyDialogView.cpp : implementation of the CMyDialogView class 
// 
 
#include "stdafx.h" 
#include "MyDialog.h" 
 
#include "MyDialogDoc.h" 
#include "MyDialogView.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
// 
//#include "MyPropertySheet.h" 
///////////////////////////////////////////////////////////////////////////// 
// CMyDialogView 
 
IMPLEMENT_DYNCREATE(CMyDialogView, CView) 
 
BEGIN_MESSAGE_MAP(CMyDialogView, CView) 
	//{{AFX_MSG_MAP(CMyDialogView) 
	ON_WM_LBUTTONDOWN() 
	//}}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() 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyDialogView construction/destruction 
 
CMyDialogView::CMyDialogView() 
{ 
	// TODO: add construction code here 
 
} 
 
CMyDialogView::~CMyDialogView() 
{ 
} 
 
BOOL CMyDialogView::PreCreateWindow(CREATESTRUCT& cs) 
{ 
	// TODO: Modify the Window class or styles here by modifying 
	//  the CREATESTRUCT cs 
 
	return CView::PreCreateWindow(cs); 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyDialogView drawing 
 
void CMyDialogView::OnDraw(CDC* pDC) 
{ 
	CMyDialogDoc* pDoc = GetDocument(); 
	ASSERT_VALID(pDoc); 
	// TODO: add draw code for native data here 
}   
 
///////////////////////////////////////////////////////////////////////////// 
// CMyDialogView printing 
 
BOOL CMyDialogView::OnPreparePrinting(CPrintInfo* pInfo) 
{ 
	// default preparation 
	return DoPreparePrinting(pInfo); 
} 
 
void CMyDialogView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add extra initialization before printing 
} 
 
void CMyDialogView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) 
{ 
	// TODO: add cleanup after printing 
} 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyDialogView diagnostics 
 
#ifdef _DEBUG 
void CMyDialogView::AssertValid() const 
{ 
	CView::AssertValid(); 
} 
 
void CMyDialogView::Dump(CDumpContext& dc) const 
{ 
	CView::Dump(dc); 
} 
 
CMyDialogDoc* CMyDialogView::GetDocument() // non-debug version is inline 
{ 
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMyDialogDoc))); 
	return (CMyDialogDoc*)m_pDocument; 
} 
#endif //_DEBUG 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyDialogView message handlers 
 
//DEL void CMyDialogView::OnDialogFile() 
//DEL { 
//DEL 	CFileDialog fileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY||OFN_OVERWRITEPROMPT,NULL,NULL); 
//DEL 	fileDlg.DoModal(); 
//DEL } 
 
void CMyDialogView::OnLButtonDown(UINT nFlags, CPoint point)  
{ 
	// TODO: Add your message handler code here and/or call default 
//	CColorDialog crDlg(0,0,NULL); 
//	crDlg.DoModal(); 
 
	CView::OnLButtonDown(nFlags, point); 
} 
 
//DEL void CMyDialogView::OnProperties() 
//DEL { 
//DEL 	// TODO: The property sheet attached to your project 
//DEL 	// via this function is not hooked up to any message 
//DEL 	// handler.  In order to actually use the property sheet, 
//DEL 	// you will need to associate this function with a control 
//DEL 	// in your project such as a menu item or tool bar button. 
//DEL  
//DEL 	CMyPropertySheet propSheet; 
//DEL  
//DEL 	propSheet.DoModal(); 
//DEL  
//DEL 	// This is where you would retrieve information from the property 
//DEL 	// sheet if propSheet.DoModal() returned IDOK.  We aren't doing 
//DEL 	// anything for simplicity. 
//DEL }