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

📄 aaaview.cpp

📁 主要功能 企业仓库管理系统由基本信息管理模块、入库管理模块、库存管理模块、查询管理模块等几部分组成。 &#61553 基本信息管理模块 该模块主要包括操作员管理、商品信息管理、库存信息管理、供
💻 CPP
字号:
// aaaView.cpp : implementation of the CAaaView class
//

#include "stdafx.h"
#include "aaa.h"

#include "aaaDoc.h"
#include "aaaView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAaaView

IMPLEMENT_DYNCREATE(CAaaView, CListView)

BEGIN_MESSAGE_MAP(CAaaView, CListView)
	//{{AFX_MSG_MAP(CAaaView)
	ON_WM_CREATE()
	ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
	ON_NOTIFY_REFLECT(NM_CLICK, OnClick)
	ON_WM_PAINT()
	ON_WM_CTLCOLOR_REFLECT()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CListView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CListView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CListView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAaaView construction/destruction

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

}

CAaaView::~CAaaView()
{
}

BOOL CAaaView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	cs.style |= LVS_SHOWSELALWAYS | LVS_LIST;// LVS_REPORT;
	

	return CListView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAaaView drawing

void CAaaView::OnDraw(CDC* pDC)
{
	CAaaDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);

	// TODO: add draw code for native data here

}

void CAaaView::OnInitialUpdate()
{
	CListView::OnInitialUpdate();


	// TODO: You may populate your ListView with items by directly accessing
	//  its list control through a call to GetListCtrl().
}

/////////////////////////////////////////////////////////////////////////////
// CAaaView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CAaaView diagnostics

#ifdef _DEBUG
void CAaaView::AssertValid() const
{
	CListView::AssertValid();
}

void CAaaView::Dump(CDumpContext& dc) const
{
	CListView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CAaaView message handlers
void CAaaView::OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct)
{
	//TODO: add code to react to the user changing the view style of your window
}

int CAaaView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{

	if (CListView::OnCreate(lpCreateStruct) == -1)
		return -1;
	return 0;
}

void CAaaView::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult) 
{
	//NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
	// TODO: Add your control notification handler code here	
	*pResult = 0;
}

void CAaaView::OnClick(NMHDR* pNMHDR, LRESULT* pResult) 
{
	// TODO: Add your control notification handler code here
		
	
	*pResult = 0;
}



void CAaaView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here	
	CListCtrl &m_ListCtrl = GetListCtrl();
	CRect rect;
	GetClientRect(rect);	
	CRect rect1;
	m_ListCtrl.GetWindowRect(rect1);
	//视图中贴图
	CDC *pDisplayMemDC = new CDC;
	CDC *pdc = m_ListCtrl.GetDC();
	pDisplayMemDC->CreateCompatibleDC(pdc);
	CPoint point;
	CRect rtWnd;
	GetWindowRect(&rtWnd);
	point.x = rect.Width();
	point.y = rect.Height();
	CBitmap *pBitmap = new CBitmap;
	CBitmap *pOldBitmap;
	pBitmap->LoadBitmap(IDB_BITMAP27);
	pOldBitmap = (CBitmap *)pDisplayMemDC->SelectObject(pBitmap);
	pdc->BitBlt(0, 0, rect1.Width(), rect1.Height(), pDisplayMemDC, 0, 0, SRCCOPY);
	pDisplayMemDC->SelectObject(pOldBitmap);
	pBitmap->DeleteObject();
	delete(pBitmap);
	delete(pDisplayMemDC);

	// Do not call CListView::OnPaint() for painting messages
}

HBRUSH CAaaView::CtlColor(CDC* pDC, UINT nCtlColor) 
{
	// TODO: Change any attributes of the DC here
	
	
	// TODO: Return a non-NULL brush if the parent's handler should not be called
	return NULL;
}

⌨️ 快捷键说明

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