void CBibitemView::OnSelchangeComboType() { CString strType; CString k; k = m_TmpItem->GetKey(); m_ComboType.GetWindowText(strType); // In case there are added Fields CFieldList oldlst; oldlst.Assign(m_TmpItem); oldlst.DeleteEmpty(); if (m_NewDialog) { CBibItem *bi = m_BibDef->FindType(strType); m_TmpItem->Clear(); if (bi) { m_TmpItem->Assign(bi); m_TmpItem->ClearValues(); } } else { m_TmpItem->Clear(); m_TmpItem->Assign(m_BibItem); m_TmpItem->SetType(strType); } // Append old Fields m_TmpItem->Append(&oldlst); m_TmpItem->SetKey(k); PopulateFields(); UpdateMissing(); if (!m_Updating) SetModified(TRUE); }
void CBibitemView::OnPopupFilter() { CApplyFilterDialog dlg; dlg.SetFilter(GetDocument()->m_BibFile->GetFilter()); if (dlg.DoModal() == IDOK && dlg.m_SelFilter != NULL) { m_TmpItem->ApplyFilter(dlg.m_SelFilter); SetModified(); PopulateFields(); } }
void pawsChildhoodWindow::Draw() { pawsWidget::Draw(); // Check to see if we are waiting for data from the server. Should have a waiting // cursor if this fails. if (!dataLoaded && createManager->HasChildhoodData()) { PopulateFields(); dataLoaded = true; } }
void pawsCharBirth::Draw() { pawsWidget::Draw(); // Check to see if we are waiting for data from the server. Should have a waiting // cursor if this fails. if (!dataLoaded && createManager->HasChildhoodData()) { PopulateFields(); //set first item in month and day months->Select(0); days->Select(0); dataLoaded = true; } }
void CBibitemView::UpdateItem() { m_ListFields.CancelEdit(FALSE); if (m_BibItem) { m_TmpItem->Assign(m_BibItem); m_TmpItem->SetModified(m_BibItem->GetModified()); } else { m_TmpItem->Clear(); m_TmpItem->SetKey(_T("")); m_TmpItem->SetValue(_T("")); m_TmpItem->SetModified(FALSE); } m_ComboType.ResetContent(); POSITION h = m_BibDef->GetHeadPosition(); while (h) { CBibItem* bi = (CBibItem*)m_BibDef->GetNext(h); ASSERT(bi); if (bi->IsRegularItem()) m_ComboType.AddString(bi->GetType()); } int i; PopulateFields(); if (!m_BibItem) { m_EditKey.SetWindowText(NULL); i = m_ComboType.SelectString(-1, m_BibDef->GetDefault()->GetType()); if (i == LB_ERR) { i = m_ComboType.AddString(m_BibDef->GetDefault()->GetType()); m_ComboType.SetCurSel(i); } return; } i = m_ComboType.SelectString(-1, m_BibItem->GetType()); if (i == LB_ERR) { i = m_ComboType.AddString(m_BibItem->GetType()); m_ComboType.SetCurSel(i); } // Missing fields UpdateMissing(); BeginUpdate(); m_EditKey.SetWindowText(m_BibItem->GetKey()); EndUpdate(); }
void CBibitemView::OnPopupLocalurl() { CString f, fn; f.Format(_T("%s||"), AfxLoadString(IDS_STRING_ALLFILTER)); CFileDialogEx dlg(TRUE, NULL, fn, OFN_HIDEREADONLY | OFN_ENABLESIZING, f, this); if (dlg.DoModal() == IDOK) { CField *fi = m_TmpItem->Find(STR_LOCALURL); if (fi == NULL) { fi = m_TmpItem->New(); fi->SetName(STR_LOCALURL); fi->SetValue(EncodeFilename(dlg.GetPathName())); } else { CString val = fi->GetValue(); if (!val.IsEmpty()) val += _T("; ") + EncodeFilename(dlg.GetPathName()); else val = EncodeFilename(dlg.GetPathName()); fi->SetValue(val); } SetModified(); PopulateFields(); } }