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

📄 vc13view.cpp

📁 Visual C++ 6.0编程基础与范例
💻 CPP
字号:
// vc13View.cpp : implementation of the CVc13View class
//

#include "stdafx.h"
#include "vc13.h"

#include "vc13Set.h"
#include "vc13Doc.h"
#include "vc13View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CVc13View

IMPLEMENT_DYNCREATE(CVc13View, CRecordView)

BEGIN_MESSAGE_MAP(CVc13View, CRecordView)
	//{{AFX_MSG_MAP(CVc13View)
	ON_COMMAND(ID_RecDelete, OnRecDelete)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CVc13View construction/destruction

CVc13View::CVc13View()
	: CRecordView(CVc13View::IDD)
{
	//{{AFX_DATA_INIT(CVc13View)
	m_pSet = NULL;
	m_xm = _T("");
	m_dz = _T("");
	m_bg = _T("");
	m_jt = _T("");
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CVc13View::~CVc13View()
{
}

void CVc13View::DoDataExchange(CDataExchange* pDX)
{
	CRecordView::DoDataExchange(pDX);
	m_xm = m_pSet->m_column1;
	m_dz = m_pSet->m_column5;
	m_bg = m_pSet->m_column11;
	m_jt = m_pSet->m_column12;

	//{{AFX_DATA_MAP(CVc13View)
	DDX_Text(pDX, IDC_EDIT1, m_xm);
	DDV_MaxChars(pDX, m_xm, 10);
	DDX_Text(pDX, IDC_EDIT2, m_dz);
	DDX_Text(pDX, IDC_EDIT3, m_bg);
	DDX_Text(pDX, IDC_EDIT4, m_jt);
	//}}AFX_DATA_MAP

	m_pSet->m_column1 = m_xm;
	m_pSet->m_column5 = m_dz;
	m_pSet->m_column11 = m_bg;
	m_pSet->m_column12 = m_jt;
}

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

	return CRecordView::PreCreateWindow(cs);
}

void CVc13View::OnInitialUpdate()
{
	m_pSet = &GetDocument()->m_vc13Set;
	CRecordView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();

}

/////////////////////////////////////////////////////////////////////////////
// CVc13View printing

BOOL CVc13View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CVc13View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CVc13View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CVc13View diagnostics

#ifdef _DEBUG
void CVc13View::AssertValid() const
{
	CRecordView::AssertValid();
}

void CVc13View::Dump(CDumpContext& dc) const
{
	CRecordView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CVc13View database support
CRecordset* CVc13View::OnGetRecordset()
{
	return m_pSet;
}




void CVc13View::OnRecDelete() 
{
	// TODO: Add your command handler code here
	if(m_pSet->IsEOF() || !m_pSet->CanTransact() || !m_pSet->CanUpdate())
		 return;

	m_pSet->Delete( );   
}

⌨️ 快捷键说明

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