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

📄 supermarketcahsierview.cpp

📁 实现超市收银管理.能实现超市的正常收银情况........
💻 CPP
字号:
// SupermarketCahsierView.cpp : implementation of the CSupermarketCahsierView class
//

#include "stdafx.h"
#include "SupermarketCahsier.h"

#include "SupermarketCahsierDoc.h"
#include "SupermarketCahsierView.h"
#include "MainFrm.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSupermarketCahsierView

IMPLEMENT_DYNCREATE(CSupermarketCahsierView, CListView)

BEGIN_MESSAGE_MAP(CSupermarketCahsierView, CListView)
	//{{AFX_MSG_MAP(CSupermarketCahsierView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CSupermarketCahsierView construction/destruction

CSupermarketCahsierView::CSupermarketCahsierView()
{
	// TODO: add construction code here
	ctl = &GetListCtrl();

}

CSupermarketCahsierView::~CSupermarketCahsierView()
{
}

BOOL CSupermarketCahsierView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	//  set the style
	cs.style|=LVS_REPORT|LVS_SINGLESEL;
	return CListView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CSupermarketCahsierView drawing

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

void CSupermarketCahsierView::OnInitialUpdate()
{
	CListView::OnInitialUpdate();
	
	CMainFrame *m_Frm = (CMainFrame *)::AfxGetMainWnd();
	m_Frm->m_ListView = this;

	//CDC *pDC = GetDC();
	//SetBkColor(pDC->m_hDC, COLORREF(RGB(0, 256, 0)));
	ctl->SetBkColor(COLORREF(RGB(100, 192, 100)));
	ctl->SetTextBkColor(COLORREF(RGB(100, 192, 100)));
	// TODO: You may populate your ListView with items by directly accessing
	//  its list control through a call to GetListCtrl().
}

/////////////////////////////////////////////////////////////////////////////
// CSupermarketCahsierView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CSupermarketCahsierView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CSupermarketCahsierView message handlers

//DEL void CSupermarketCahsierView::RemoveAll()
//DEL {
//DEL // 	CListCtrl * ctl;
//DEL // 	ctl = &GetListCtrl();
//DEL 	ctl->DeleteAllItems();
//DEL }

//DEL void CSupermarketCahsierView::ListTable(CString strTable,CString strNO)
//DEL {
//DEL 	RemoveAll();
//DEL 	CString strSQL;
//DEL 	CListCtrl * ctl;
//DEL 	ctl = &GetListCtrl();
//DEL 
//DEL 	strSQL.Format("select * from")
//DEL 
//DEL 
//DEL }

//DEL void CSupermarketCahsierView::ctlInsertItem(int i,CString str)
//DEL {
//DEL 	CListCtrl * ctl;
//DEL  	ctl = &GetListCtrl();
//DEL 	ctl->InsertItem(i,str);
//DEL }

//DEL void CSupermarketCahsierView::ctlSetItemText(int i,int j,CString str)
//DEL {
//DEL 	CListCtrl * ctl;
//DEL  	ctl = &GetListCtrl();
//DEL 	ctl->SetItemText(i,j,str);
//DEL }

⌨️ 快捷键说明

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