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

📄 tblst.cpp

📁 打印数据生成和模拟
💻 CPP
字号:


#include "stdafx.h"
#include "..\Search.h"
#include "..\ToolSoftForPrint.h"
//#include <SuperFileProc.h>
#include "tblst.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "..\ChildFrm.h"
/////////////////////////////////////////////////////////////////////////////
// CTbLst property page

IMPLEMENT_DYNCREATE(CTbLst, CPropertyPage)

CTbLst::CTbLst() : CPropertyPage(CTbLst::IDD),m_listInf(FALSE)
{
	//{{AFX_DATA_INIT(CTbLst)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_frmChild=NULL;
}

CTbLst::~CTbLst()
{
}

void CTbLst::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTbLst)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}
//点击之后需要刷新右边的详细信息面板
BOOL CTbLst::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
	NMHDR* pHdr=(NMHDR*)lParam;
	if(!pHdr)	return TRUE;
	if(pHdr->code == LVN_ITEMCHANGED)
	{
		NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)lParam;
	    if (pNMListView && pNMListView->uOldState != pNMListView->uNewState)
		  if ((pNMListView->uNewState & LVIS_SELECTED) == LVIS_SELECTED)
			{			
			    int nIndex=pNMListView->iItem;
				
			}
	}	
	return CWnd::OnNotify(wParam, lParam, pResult);
}

BEGIN_MESSAGE_MAP(CTbLst, CPropertyPage)
	//{{AFX_MSG_MAP(CTbLst)
	ON_WM_CREATE()
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTbLst message handlers

int CTbLst::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CPropertyPage::OnCreate(lpCreateStruct) == -1)
		return -1;
	DWORD dwExStyle,dwStyle;
    dwExStyle=LVS_EX_CHECKBOXES | LVS_EX_FLATSB | LVS_EX_FULLROWSELECT;
	dwStyle =(LVS_REPORT | LVS_OWNERDRAWFIXED | LVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE);	
	
	m_listInf.EnableDragDrop(FALSE);
	m_listInf.EnableSelChecked();
	//GetClientRect(m_Rect);
	if (!m_listInf.CreateEx(dwExStyle,WC_LISTVIEW,_T(""),dwStyle,CRect(0,0,80,80),this,2000))
	{
		TRACE0("Failed to create outlook bar.");
		return -1;
	}	// TODO: Add your specialized creation code here
	m_listInf.ExpandHeader();
	m_listInf.ViewGridLines();	
	m_listInf.InsertColumn(0,_T("名称"),LVCFMT_LEFT,100);
	m_listInf.InsertColumn(1,_T("描述"),LVCFMT_LEFT,200);	


	
	return 0;
}

void CTbLst::OnSize(UINT nType, int cx, int cy) 
{
	CPropertyPage::OnSize(nType, cx, cy);
		m_listInf.MoveWindow(0,0,cx,cy);
	// TODO: Add your message handler code here
	
}

BOOL CTbLst::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
    CString strIni =CUtilityClass::getIniValueString("FileSet","DataPath","",CUtilityClass::getAppPath()+"\\conf\\conf.ini");
	Search m_search(strIni,"*.prt");
	m_search.Start(m_arr);
	m_listInf.DeleteAllItems();
	if (m_arr.GetSize())
	{	
		for (int iTmp=1;iTmp<=m_arr.GetSize();iTmp++)
		{
			CString strPath(m_arr.GetAt(iTmp-1));
			int iPos = strPath.ReverseFind('\\');
			strPath=strPath.Mid(iPos+1,strPath.GetLength()-iPos);
			m_listInf.InsertItem(m_listInf.GetItemCount(),strPath);
			m_listInf.SetItemText(m_listInf.GetItemCount()-1,1,m_arr.GetAt(iTmp-1));	
			m_listInf.SetCheck(m_listInf.GetItemCount()-1,FALSE);
		}

	}	
	if (0 < m_listInf.GetItemCount())
	{
		m_listInf.SetCheck(0,TRUE);
		m_frmChild->refreshDataToView(m_listInf.GetItemText(0,1));
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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