| | |
| | | pComboBox->SetCurSel(cassetteStatus - 1); |
| | | } |
| | | |
| | | // 创建Job Existence Slots控件 |
| | | m_ctrlJobSlotGrid.Create(AfxRegisterWndClass(0), _T("JobSlotGrid"), |
| | | WS_CHILD | WS_VISIBLE, CRect(0, 0, 88, 32), this, 1001); |
| | | m_ctrlJobSlotGrid.SetGridSize(1, 8); |
| | | m_ctrlJobSlotGrid.SetColors(RGB(34, 177, 76), RGB(200, 200, 200)); |
| | | |
| | | auto statusMap = m_pPort->getScanCassetteMap(); |
| | | for (int i = 0; i < 8; ++i) { |
| | | bool isSet = (statusMap >> i) & 1; |
| | | m_ctrlJobSlotGrid.SetSlotStatus(0, i, isSet); |
| | | } |
| | | |
| | | return TRUE; // return TRUE unless you set the focus to a control |
| | | // 异常: OCX 属性页应返回 FALSE |
| | |
| | | void CPagePortStatus::OnSize(UINT nType, int cx, int cy) |
| | | { |
| | | CHMPropertyPage::OnSize(nType, cx, cy); |
| | | if (GetDlgItem(IDC_COMBO_PORT_STATUS) == nullptr) return; |
| | | |
| | | // TODO: 在此处添加消息处理程序代码 |
| | | |
| | | // 创建Job Existence Slots控件 |
| | | CRect rcLabel, rcComboBox, rcClient; |
| | | GetDlgItem(IDC_LABEL_JOB_EXISTENCE_SLOTS)->GetWindowRect(&rcLabel); |
| | | ScreenToClient(rcLabel); |
| | | GetDlgItem(IDC_COMBO_CASSETTE_STATUS)->GetWindowRect(&rcComboBox); |
| | | ScreenToClient(rcComboBox); |
| | | GetClientRect(rcClient); |
| | | |
| | | m_ctrlJobSlotGrid.MoveWindow(rcComboBox.left, rcLabel.top, |
| | | 34 * 8, 32); |
| | | } |