示例#1
0
void CApplication::DuplicateNote(int nNoteId)
{
	CNoteWnd* pWnd = CreateNoteWnd(CalcNewNoteRect());
	if (pWnd && nNoteId)
	{
		CNote note = m_datafile->GetNote(nNoteId);
		note.SetId(0);
		UpdateNoteWnd(pWnd, note);
		pWnd->Unroll();
		pWnd->SetFocus();
	}
}
示例#2
0
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);
}
示例#3
0
void CApplication::MoveToNotebook(int nNoteId, LPCTSTR sFileName)
{
	if (GetDataFileName() != sFileName)
	{
		CNote note = m_datafile->GetNote(nNoteId);
		note.SetId(0);
		note.SetModifiedDate(dateutils::GetCurrentDateTime());
		CStorage target;
		target.SetDataFile(sFileName);
		target.SaveNote(note, NM_ALL);
		target.Release();
		m_state.SetLastDataFile(sFileName);
		m_local_storage.Write(m_state);
		DeleteNote(nNoteId, true);
	}
}