Esempio n. 1
0
void CGeorgesEditDoc::OnEditRedo() 
{
	if (!_RedoBuffer.empty ())
	{
		// Get an action
		IAction *action = _RedoBuffer.back ();
		_RedoBuffer.pop_back ();

		// Undo it
		bool modified;
		action->doAction (*this, true, modified, false);

		// Put in the redo list
		_UndoBuffer.push_back (action);

		((CMainFrame*)(theApp.m_pMainWnd))->RecalcLayout ();

		_UndoModify++;
		if ( (_UndoModify == 0) && IsModified () )
		{
			setModifiedState (false);
		}
		else if ( (_UndoModify != 0) && !IsModified () )
		{
			setModifiedState (true);
		}
	}
}
Esempio n. 2
0
void CGeorgesEditDoc::OnEditUndo() 
{
	if (!_UndoBuffer.empty ())
	{
		// Get an action
		IAction *action = _UndoBuffer.back ();
		_UndoBuffer.pop_back ();

		// Undo it
		bool modified;
		action->doAction (*this, false, modified, false);

		// Put in the redo list
		_RedoBuffer.push_back (action);

		CMDIFrameWnd* pMainWnd = (CMDIFrameWnd*)AfxGetMainWnd();

		// Get the active MDI child window.
		CMDIChildWnd* pChild = (CMDIChildWnd*)pMainWnd->MDIGetActive();
		pChild->RecalcLayout();
		pChild->UpdateWindow();

		_UndoModify--;
		if ( (_UndoModify == 0) && IsModified () )
		{
			setModifiedState (false);
		}
		else if ( (_UndoModify != 0) && !IsModified () )
		{
			setModifiedState (true);
		}
	}
}