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

📄 homeresview.cpp

📁 家庭财务管理系统毕业论文,含源码。基于ACCESS数据库的运用。用了VC++ 6.0 ADO。
💻 CPP
字号:
// HomeResView.cpp : implementation of the CHomeResView class
//

#include "stdafx.h"
#include "HomeRes.h"

#include "HomeResDoc.h"
#include "HomeResView.h"
#include "DataDlg.h"
#include "PeopleDlg.h"
#include "SystemDlg.h"
#include "ProductDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CHomeResView

IMPLEMENT_DYNCREATE(CHomeResView, CFormView)

BEGIN_MESSAGE_MAP(CHomeResView, CFormView)
	//{{AFX_MSG_MAP(CHomeResView)
	ON_BN_CLICKED(IDC_BUTTON_PEOPLE, OnButtonPeople)
	ON_BN_CLICKED(IDC_BUTTON_PRODUCT, OnButtonProduct)
	ON_BN_CLICKED(IDC_BUTTON_DATA, OnButtonData)
	ON_BN_CLICKED(IDC_BUTTON_SYSTEM, OnButtonSystem)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHomeResView construction/destruction

CHomeResView::CHomeResView()
	: CFormView(CHomeResView::IDD)
{
	//{{AFX_DATA_INIT(CHomeResView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// TODO: add construction code here

}

CHomeResView::~CHomeResView()
{
}

void CHomeResView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CHomeResView)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

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

	return CFormView::PreCreateWindow(cs);
}

void CHomeResView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();
	GetParentFrame()->RecalcLayout();
	ResizeParentToFit();
	
	CString strshow;
	strshow.Format("用户名为:%s          用户类型为:%s",theApp.strPeople,theApp.strModel);
	GetDlgItem(IDC_STATIC_SHOW)->SetWindowText(strshow);
	if(theApp.strModel != "管理员")
	{
		GetDlgItem(IDC_BUTTON_PEOPLE)->EnableWindow(FALSE);
		GetDlgItem(IDC_BUTTON_PRODUCT)->EnableWindow(FALSE);
		GetDlgItem(IDC_BUTTON_SYSTEM)->EnableWindow(FALSE);
	}
}

/////////////////////////////////////////////////////////////////////////////
// CHomeResView printing

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

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

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

void CHomeResView::OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)
{
	// TODO: add customized printing code here
}

/////////////////////////////////////////////////////////////////////////////
// CHomeResView diagnostics

#ifdef _DEBUG
void CHomeResView::AssertValid() const
{
	CFormView::AssertValid();
}

void CHomeResView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CHomeResView message handlers

void CHomeResView::OnButtonPeople() 
{
	// TODO: Add your control notification handler code here
	CPeopleDlg peopledlg;
	peopledlg.DoModal();
}

void CHomeResView::OnButtonProduct() 
{
	// TODO: Add your control notification handler code here
	CProductDlg productdlg;
	productdlg.DoModal();
}

void CHomeResView::OnButtonData() 
{
	// TODO: Add your control notification handler code here
	CDataDlg datadlg;
	datadlg.DoModal();
}

void CHomeResView::OnButtonSystem() 
{
	// TODO: Add your control notification handler code here
	CSystemDlg systemdlg;
	systemdlg.DoModal();
}

⌨️ 快捷键说明

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