general_controlview.cpp

来自「关于使用VC编程的代码」· C++ 代码 · 共 91 行

CPP
91
字号
// General_ControlView.cpp : implementation of the CGeneral_ControlView class
//

#include "stdafx.h"
#include "General_Control.h"

#include "General_ControlDoc.h"
#include "General_ControlView.h"

#include "SampleDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CGeneral_ControlView

IMPLEMENT_DYNCREATE(CGeneral_ControlView, CView)

BEGIN_MESSAGE_MAP(CGeneral_ControlView, CView)
	//{{AFX_MSG_MAP(CGeneral_ControlView)
	ON_WM_LBUTTONDBLCLK()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGeneral_ControlView construction/destruction

CGeneral_ControlView::CGeneral_ControlView()
{
	// TODO: add construction code here

}

CGeneral_ControlView::~CGeneral_ControlView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CGeneral_ControlView drawing

void CGeneral_ControlView::OnDraw(CDC* pDC)
{
	CGeneral_ControlDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CGeneral_ControlView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CGeneral_ControlView message handlers

void CGeneral_ControlView::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
	CSampleDlg dlg;
	dlg.DoModal();
	AfxMessageBox(dlg.m_strCity + "\n" + dlg.m_strColor);
	CView::OnLButtonDblClk(nFlags, point);
}

⌨️ 快捷键说明

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