【VC开源代码栏目提醒】:网学会员,鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“CPropertyView.cpp”一文,供大家参考学习!
// CPropertyView.cpp : implementation of the CCPropertyView class
//
#include "stdafx.h"
#include "CProperty.h"
#include"PropSheet.h"
#include "CPropertyDoc.h"
#include "CPropertyView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCPropertyView
IMPLEMENT_DYNCREATE(CCPropertyView, CView)
BEGIN_MESSAGE_MAP(CCPropertyView, CView)
//{{AFX_MSG_MAP(CCPropertyView)
ON_COMMAND(IDM_PRIPORITY, OnPripority)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CCPropertyView construction/destruction
CCPropertyView::CCPropertyView()
{
// TODO: add construction code here
}
CCPropertyView::~CCPropertyView()
{
}
BOOL CCPropertyView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCPropertyView drawing
void CCPropertyView::OnDraw(CDC* pDC)
{
CCPropertyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CCPropertyView printing
BOOL CCPropertyView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CCPropertyView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CCPropertyView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CCPropertyView diagnostics
#ifdef _DEBUG
void CCPropertyView::AssertValid() const
{
CView::AssertValid();
}
void CCPropertyView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCPropertyDoc* CCPropertyView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCPropertyDoc)));
return (CCPropertyDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCPropertyView message handlers
void CCPropertyView::OnPripority()
{
// TODO: Add your command handler code here
CProp1 m_prop1;
CProp2 m_prop2;
CProp3 m_prop3;
CPropSheet pt1("属性对话框范例");
pt1.AddPage(&m_prop1);
pt1.AddPage(&m_prop2);
pt1.AddPage(&m_prop3);
pt1.DoModal();
}