void CBibitemView::OnEndlabeleditListFields(NMHDR* pNMHDR, LRESULT* pResult) { if (!m_Updating) { LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR; if (pDispInfo->item.pszText != NULL) { int i = pDispInfo->item.iItem; CField* f = (CField*)m_ListFields.GetItemData(i); if (pDispInfo->item.iSubItem == 0) { // It's the field name f->SetName(pDispInfo->item.pszText); m_ListFields.SetItem(i, pDispInfo->item.iSubItem, LVIF_IMAGE, NULL, m_BibDef->GetRequired(m_BibItem->GetType(), pDispInfo->item.pszText), 0, 0, 0); } else if (pDispInfo->item.iSubItem == 1) { // It's the field value f->SetValue(pDispInfo->item.pszText); } m_ListFields.SetItemText(i, pDispInfo->item.iSubItem, pDispInfo->item.pszText); UpdateMissing(); *pResult = 1; SetModified(m_Modified || f->GetModified()); } else *pResult = 0; } else *pResult = 0; }
void CBibitemView::OnFieldlistPopupEdit() { CSourceDialog dlg; CField* fi = (CField*)m_ListFields.GetItemData(m_SelField); dlg.SetSource(fi->GetValue()); if (dlg.DoModal() == IDOK) { fi->SetValue(dlg.GetSource()); SetModified(m_Modified || fi->GetModified()); m_ListFields.SetItemText(m_SelField, 1, dlg.GetSource()); } }
void CBibitemView::OnPopupBrowse() { CString f; CString fn; CField* fi = (CField*)m_ListFields.GetItemData(m_SelField); fn = DecodeFilename(fi->GetValue()); CFileFind finder; if (!finder.FindFile(fn)) // Dialog will not show when file does not exist fn.Empty(); finder.Close(); f.Format(_T("%s||"), AfxLoadString(IDS_STRING_ALLFILTER)); CFileDialogEx dlg(TRUE, NULL, fn, OFN_HIDEREADONLY | OFN_ENABLESIZING, f, this); if (dlg.DoModal() == IDOK) { m_ListFields.SetItemText(m_SelField, 1, EncodeFilename(dlg.GetPathName())); fi->SetValue(EncodeFilename(dlg.GetPathName())); SetModified(fi->GetModified()); } }