LAPTOP-SNT8I5JK\Boounion
2025-08-21 c5ef06019f738d92e01a664e7b1354ba2accb9a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// CControlJobDlg.cpp: 实现文件
//
 
#include "stdafx.h"
#include "Servo.h"
#include "CControlJobDlg.h"
#include "afxdialogex.h"
 
 
// CControlJobDlg 对话框
 
IMPLEMENT_DYNAMIC(CControlJobDlg, CDialogEx)
 
CControlJobDlg::CControlJobDlg(CWnd* pParent /*=nullptr*/)
    : CDialogEx(IDD_DIALOG_CONTROL_JOB, pParent)
{
 
}
 
CControlJobDlg::~CControlJobDlg()
{
}
 
void CControlJobDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialogEx::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_LIST1, m_listCtrl);
}
 
 
BEGIN_MESSAGE_MAP(CControlJobDlg, CDialogEx)
END_MESSAGE_MAP()
 
 
// CControlJobDlg 消息处理程序
 
 
BOOL CControlJobDlg::OnInitDialog()
{
    CDialogEx::OnInitDialog();
 
    HIMAGELIST imageList = ImageList_Create(24, 24, ILC_COLOR24, 1, 1);
    ListView_SetImageList(m_listCtrl.GetSafeHwnd(), imageList, LVSIL_SMALL);
 
    // m_list 已经是对话框上的 CExpandableListCtrl 成员(拖控件改类)
    m_listCtrl.ModifyStyle(0, LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS);
    m_listCtrl.InsertColumn(0, _T("名称"), LVCFMT_LEFT, 260);
    m_listCtrl.InsertColumn(1, _T("状态"), LVCFMT_LEFT, 120);
    m_listCtrl.InsertColumn(2, _T("描述"), LVCFMT_LEFT, 260);
 
    auto* root1 = m_listCtrl.InsertRoot({ _T("EFEM"), _T("Ready"), _T("Front End Module") });
    m_listCtrl.InsertChild(root1, { _T("Slot #1"), _T("OK"), _T("150mm wafer") });
    m_listCtrl.InsertChild(root1, { _T("Slot #2"), _T("Empty"), _T("") });
 
    auto* root2 = m_listCtrl.InsertRoot({ _T("Bonder"), _T("Run"), _T("G1+G2 Process") });
    auto* ch21 = m_listCtrl.InsertChild(root2, { _T("Job A"), _T("Proc"), _T("Step 1") });
    m_listCtrl.InsertChild(ch21, { _T("SubStep A1"), _T("Done"), _T("Align") });
    m_listCtrl.InsertChild(ch21, { _T("SubStep A2"), _T("Run"),  _T("Bond") });
 
    // 初始让顶层展开
    root1->expanded = true;
    root2->expanded = true;
 
    m_listCtrl.RebuildVisible();
 
    return TRUE;  // return TRUE unless you set the focus to a control
                  // 异常: OCX 属性页应返回 FALSE
}