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

📄 mdlspropview.cpp

📁 讲mfc的书
💻 CPP
字号:
// mdlspropView.cpp : implementation of the CMdlspropView class
//

#include "stdafx.h"
#include "mdlsprop.h"

#include "mdlspropDoc.h"
#include "mdlspropView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMdlspropView

IMPLEMENT_DYNCREATE(CMdlspropView, CView)

BEGIN_MESSAGE_MAP(CMdlspropView, CView)
	//{{AFX_MSG_MAP(CMdlspropView)
	ON_WM_LBUTTONDOWN()
	ON_WM_MOUSEMOVE()
	ON_WM_RBUTTONDOWN()
	ON_WM_MBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMdlspropView construction/destruction

CMdlspropView::CMdlspropView() : psheet("Mouse Properties")
{
	// TODO: add construction code here

}

CMdlspropView::~CMdlspropView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMdlspropView drawing

void CMdlspropView::OnDraw(CDC* pDC)
{
	CMdlspropDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CMdlspropView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CMdlspropView message handlers

void CMdlspropView::OnLButtonDown(UINT nFlags, CPoint point) 
{
	if (::IsWindow(psheet.m_hWnd)) psheet.MouseDown(WM_LBUTTONDOWN);
	CView::OnLButtonDown(nFlags, point);
}

void CMdlspropView::OnMouseMove(UINT nFlags, CPoint point) 
{
	if (::IsWindow(psheet.m_hWnd)) psheet.SetXY(point.x,point.y);
	CView::OnMouseMove(nFlags, point);
}

void CMdlspropView::OnRButtonDown(UINT nFlags, CPoint point) 
{
	if (::IsWindow(psheet.m_hWnd)) psheet.MouseDown(WM_RBUTTONDOWN);
	CView::OnRButtonDown(nFlags, point);
}

void CMdlspropView::OnMButtonDown(UINT nFlags, CPoint point) 
{
    if (::IsWindow(psheet.m_hWnd)) psheet.MouseDown(WM_MBUTTONDOWN);	
	CView::OnMButtonDown(nFlags, point);
}

void CMdlspropView::OnInitialUpdate() 
{
	CView::OnInitialUpdate();
	  psheet.Create(this, DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP |
								DS_SETFONT | WS_CHILD | WS_VISIBLE | WS_CAPTION);
}

⌨️ 快捷键说明

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