Esempio n. 1
0
void fileNew()
{
	// document.purgeUnusedTracks();
	SyncDocument::MultiCommand *multiCmd = new SyncDocument::MultiCommand();
	for (size_t i = 0; i < document.num_tracks; ++i) {
		sync_track *t = document.tracks[i];
		for (size_t j = 0; j < t->num_keys; ++j)
			multiCmd->addCommand(new SyncDocument::DeleteCommand(i, t->keys[j].row));
	}
	document.exec(multiCmd);

	setWindowFileName(L"Untitled");
	fileName.clear();

	document.clearUndoStack();
	document.clearRedoStack();
}
Esempio n. 2
0
void loadDocument(const std::wstring &_fileName)
{
	fileNew();
	if (document.load(_fileName))
	{
		setWindowFileName(_fileName.c_str());
		fileName = _fileName;
		
		mruFileList.insert(_fileName);
		mruFileList.update();
		DrawMenuBar(hwnd);
		
		document.clearUndoStack();
		document.clearRedoStack();
		trackView->setDocument(&document);

		SendMessage(hwnd, WM_CURRVALDIRTY, 0, 0);
		InvalidateRect(trackViewWin, NULL, FALSE);
	}
	else
		error("failed to open file");
}