Пример #1
0
void CApplication::GetAllNotesPositions(CNote::List& notes)
{
	m_datafile->GetAllNotes(notes, NM_POS);
	for (std::list<CNoteWnd*>::iterator it = m_listNotes.begin(); it != m_listNotes.end(); ++it)
	{
		if ((*it)->GetId() == 0) // new not saved note
		{
			CNote note;
			note.SetPos(CWindowRect((*it)->m_hWnd));
			notes.push_back(note);
		}
	}
}
Пример #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);
}