I am to add a CONTENT VIEWER to the Recycle bin of the application.It is a preview feature for the messages stored in the recycle bin that are to be restored.I am to add another frame to display the actual content of a note when the user clicks on the note from the listof the messages to be restored."
BOOL CDlgRecycleBin::OnInitDialog() { CDialog::OnInitDialog();// Language stuff ((CStatic *) GetDlgItem (IDC_STATIC1))->SetWindowText (CTranslate::ReadString (146, _T("Title"))); ((CButton *) GetDlgItem (IDC_DELETE))->SetWindowText (CTranslate::ReadString (147, _T("Delete"))); ((CButton *) GetDlgItem (IDC_RESTORE))->SetWindowText (CTranslate::ReadString (148, _T("Restore"))); ((CButton *) GetDlgItem (IDOK))->SetWindowText (CTranslate::ReadString (149, _T("Close"))); SetWindowText (CTranslate::ReadString (150, _T("Recycle bin")));
CDialog::OnInitDialog();
BEGIN_MESSAGE_MAP(CDlgRecycleBin, CDialog) //{{AFX_MSG_MAP(CDlgRecycleBin) ON_BN_CLICKED(IDC_DELETE, OnDelete) ON_BN_CLICKED(IDC_RESTORE, OnRestore) ON_LBN_DBLCLK(IDC_TITLES, OnDblclkTitles) //}}AFX_MSG_MAPEND_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CDlgRecycleBin, CDialog) //{{AFX_MSG_MAP(CDlgRecycleBin) ON_BN_CLICKED(IDC_DELETE, OnDelete) ON_BN_CLICKED(IDC_RESTORE, OnRestore) ON_BN_CLICKED(IDC_PREVIEW, OnPreview) /// Added this line for preview ON_LBN_DBLCLK(IDC_TITLES, OnDblclkTitles) //}}AFX_MSG_MAPEND_MESSAGE_MAP()
void CRecycleBin::SaveDeletedNote(void *pNote){// The note will be deleted and therefore the note// and its data will be saved in the file// \..\A Note\deleted notes.xml// Read all the notes that are in the file deleted notes.xml ::CoInitialize(NULL); HRESULT hr = m_plDomDocument.CreateInstance(::CLSID_DOMDocument); if (FAILED(hr)) { CErrorLog::CErrorLog (ERR, "Could not initialize the xml parser"); return; } ParseXML ();// Add the note that wants to be deleted AddDeletedNote (pNote);// Find out if we have hit the total limit -> if so delete the first one if (_ttoi (theApp.m_szRecycleBinNumberOfNotes) != 0 && m_pNote.GetCount () > _ttoi (theApp.m_szRecycleBinNumberOfNotes)) m_pNote.RemoveHead ();// Save the notes in the file deleted notes.xml SaveDeletedNotes ();}
BEGIN_MESSAGE_MAP(CDlgRecycleBin, CDialog) //{{AFX_MSG_MAP(CDlgRecycleBin) ON_BN_CLICKED(IDC_DELETE, OnDelete) ON_BN_CLICKED(IDC_RESTORE, OnRestore) ON_BN_CLICKED(IDC_PREVIEW, OnPreview) /// added this ON_LBN_DBLCLK(IDC_TITLES, OnDblclkTitles) //}}AFX_MSG_MAPEND_MESSAGE_MAP()
BOOL CDlgRecycleBin::OnInitDialog() { CDialog::OnInitDialog();// Language stuff ((CStatic *) GetDlgItem (IDC_STATIC1))->SetWindowText (CTranslate::ReadString (146, _T("Title"))); ((CButton *) GetDlgItem (IDC_DELETE))->SetWindowText (CTranslate::ReadString (147, _T("Delete"))); ((CButton *) GetDlgItem (IDC_RESTORE))->SetWindowText (CTranslate::ReadString (148, _T("Restore"))); ((CButton *) GetDlgItem (IDC_PREVIEW))->SetWindowText (CTranslate::ReadString (145, _T("Preview"))); /// added this ((CButton *) GetDlgItem (IDOK))->SetWindowText (CTranslate::ReadString (149, _T("Close"))); SetWindowText (CTranslate::ReadString (149, _T("Recycle bin")));