ISAListTree.cpp
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:2k
- // ISAListTree.cpp : implementation file
- //
- #include "stdafx.h"
- #include "colorStatic.h"
- #include "ISAListTree.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CISAListTree dialog
- CISAListTree::CISAListTree(CWnd* pParent /*=NULL*/)
- : CDialog(CISAListTree::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CISAListTree)
- m_width = 0;
- //}}AFX_DATA_INIT
- m_nIndex = -1;
- }
- void CISAListTree::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CISAListTree)
- DDX_Control(pDX, IDC_LIST1, m_listctrl);
- DDX_Text(pDX, IDC_LINE_WIDTH, m_width);
- DDV_MinMaxInt(pDX, m_width, 20, 500);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CISAListTree, CDialog)
- //{{AFX_MSG_MAP(CISAListTree)
- ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST1, OnItemchangedList1)
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CISAListTree message handlers
- BOOL CISAListTree::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_pimageList = new CImageList();
- m_pimageList->Create(IDB_ISA_SYMBOL,32,53,RGB(255,255,255));
- m_color.SubclassDlgItem(IDC_COLOR,this);
- FillListCtrl();
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CISAListTree::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult)
- {
- NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
- // TODO: Add your control notification handler code here
- m_nIndex = pNMListView->iItem;
- *pResult = 0;
- }
- void CISAListTree::FillListCtrl()
- {
- LV_ITEM lvitem;
- int iIcon, iItem;
- char pText[7];
- m_listctrl.SetImageList(m_pimageList,LVSIL_NORMAL);
- for (iItem = 0; iItem < 53; iItem++)
- {
- iIcon = iItem;
- lvitem.mask = LVIF_TEXT | LVIF_IMAGE ;
- lvitem.iItem = iItem ;
- lvitem.iSubItem =0;
- sprintf(pText,"ISA: %d",iItem);
- lvitem.pszText = pText;
- lvitem.iImage = iIcon;
- m_listctrl.InsertItem(&lvitem);
- }
- }
- void CISAListTree::OnDestroy()
- {
- CDialog::OnDestroy();
-
- // TODO: Add your message handler code here
- if(m_pimageList != NULL)
- delete m_pimageList;
-
- }