| | |
| | | ON_WM_CTLCOLOR() |
| | | ON_WM_DESTROY() |
| | | ON_WM_SIZE() |
| | | ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST1, &CPageCollectionEvent::OnLvnItemchangedList1) |
| | | END_MESSAGE_MAP() |
| | | |
| | | |
| | |
| | | CHMPropertyPage::OnSize(nType, cx, cy); |
| | | if (GetDlgItem(IDC_LIST1) == nullptr) return; |
| | | |
| | | CWnd* pItem; |
| | | CRect rcClient, rcItem; |
| | | GetClientRect(&rcClient); |
| | | m_listCtrl.MoveWindow(12, 12, rcClient.Width() - 24, rcClient.Height() - 24); |
| | |
| | | m_listCtrl.SetItemText(index, 4, item->getReportIdsText().c_str()); |
| | | } |
| | | } |
| | | |
| | | void CPageCollectionEvent::OnCreateBtns() |
| | | { |
| | | const int BTN_W = 80; |
| | | const int BTN_H = 28; |
| | | CreateBtn(_T("新增"), BTN_W, BTN_H, 3001); |
| | | CreateBtn(_T("删除"), BTN_W, BTN_H, 3002)->EnableWindow(FALSE); |
| | | CreateBtn(_T("编辑"), BTN_W, BTN_H, 3003)->EnableWindow(FALSE); |
| | | } |
| | | |
| | | void CPageCollectionEvent::OnLvnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult) |
| | | { |
| | | LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); |
| | | int nSelCount = m_listCtrl.GetSelectedCount(); |
| | | if (CButton* pDel = GetBtnByName("删除")) { |
| | | pDel->EnableWindow(nSelCount > 0); |
| | | } |
| | | if (CButton* pEdit = GetBtnByName("编辑")) { |
| | | pEdit->EnableWindow(nSelCount > 0); |
| | | } |
| | | *pResult = 0; |
| | | } |
| | | |
| | | void CPageCollectionEvent::OnClickedBtn(const char* btnName) |
| | | { |
| | | // 暂留:后续实现增删改逻辑 |
| | | } |