void CApplication::SetNoteLabel(int nNoteId, LPCTSTR label) { CNote note = FindNote(nNoteId); note.SetLabel(label); note.SetModifiedDate(dateutils::GetCurrentDateTime()); m_datafile->SaveNote(note, NM_LABEL | NM_MODIFIED); CNoteWnd* pWnd = FindNoteWnd(nNoteId); if (pWnd) { pWnd->SetLabel(label); } }
int CApplication::SaveNote(CNoteWnd* pWnd, UINT nMask) { CNote note; note.SetId(pWnd->GetId()); note.SetText(pWnd->GetText()); note.SetPos(pWnd->GetRealNoteRect() /*CWindowRect(pWnd->m_hWnd)*/); note.SetCreatedDate(pWnd->GetCreatedDate()); if (nMask & NM_MODIFIED) { note.SetModifiedDate(dateutils::GetCurrentDateTime()); } note.SetDeletedDate(pWnd->GetDeletedDate()); note.SetLabel(pWnd->GetLabel().c_str()); return m_datafile->SaveNote(note, nMask); }