re: MFC CButton封装的问题 macoting 2007-03-06 18:38
// WordMyView.cpp : implementation of the CWordMyView class
//
#include "stdafx.h"
#include "WordMy.h"
#include "WordMyDoc.h"
#include "WordMyView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWordMyView
IMPLEMENT_DYNCREATE(CWordMyView, CEditView)
BEGIN_MESSAGE_MAP(CWordMyView, CEditView)
//{{AFX_MSG_MAP(CWordMyView)
// 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, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CEditView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWordMyView construction/destruction
CWordMyView::CWordMyView()
{
// TODO: add construction code here
}
CWordMyView::~CWordMyView()
{
}
BOOL CWordMyView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
BOOL bPreCreated = CEditView::PreCreateWindow(cs);
cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL); // Enable word-wrapping
return bPreCreated;
}
/////////////////////////////////////////////////////////////////////////////
// CWordMyView drawing
void CWordMyView::OnDraw(CDC* pDC)
{
CWordMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CWordMyView printing
BOOL CWordMyView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default CEditView preparation
return CEditView::OnPreparePrinting(pInfo);
}
void CWordMyView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView begin printing.
CEditView::OnBeginPrinting(pDC, pInfo);
}
void CWordMyView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// Default CEditView end printing
CEditView::OnEndPrinting(pDC, pInfo);
}
/////////////////////////////////////////////////////////////////////////////
// CWordMyView diagnostics
#ifdef _DEBUG
void CWordMyView::AssertValid() const
{
CEditView::AssertValid();
}
void CWordMyView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CWordMyDoc* CWordMyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CWordMyDoc)));
return (CWordMyDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CWordMyView message handlers