예제 #1
0
    void BatchCommand::Redo()
    {
        BBAssertDebug(CanRedo());

        for (RestorableCommandCollection::iterator it = restorableCommands.begin(); it != restorableCommands.end(); ++it)
            (*it)->Redo();
    }
예제 #2
0
// Redo the last command
void PaintModel::Redo() {
	if (CanRedo()) {
		mUndoStack.push(mRedoStack.top());
		mUndoStack.top()->Redo(shared_from_this());
		mRedoStack.pop();
	}
}
예제 #3
0
void wxTextCtrl::Redo()
{
    if (CanRedo())
    {
        ::SendMessage(GetBuddyHwnd(), EM_UNDO, 0, 0);
    }
}
예제 #4
0
void wxTextEntry::Redo()
{
    wxCHECK_RET( GetTextPeer(), "Must create the control first" );

    if (CanRedo())
        GetTextPeer()->Redo() ;
}
bool UTransBuffer::Redo()
{
	CheckState();

	if (!CanRedo())
	{
		RedoDelegate.Broadcast(FUndoSessionContext(), false);

		return false;
	}

	// Apply the redo changes.
	GIsTransacting = true;
	{
		FTransaction& Transaction = UndoBuffer[ UndoBuffer.Num() - UndoCount-- ];
		UE_LOG(LogEditorTransaction, Log,  TEXT("Redo %s"), *Transaction.GetTitle().ToString() );
		CurrentTransaction = &Transaction;

		BeforeRedoUndoDelegate.Broadcast(Transaction.GetContext());
		Transaction.Apply();
		RedoDelegate.Broadcast(Transaction.GetContext(), true);

		CurrentTransaction = nullptr;
	}
	GIsTransacting = false;

	CheckState();

	return true;
}
예제 #6
0
bool History::InternalRollForward(void)
{
	if(!CanRedo())return false;
	Undoable *u = *m_curpos;
	u->Run(true);
	m_curpos++;
	return true;
}
예제 #7
0
BString
UndoContext::RedoLabel() const
{
	if (CanRedo())
		return ((Action*)fHistory->ItemAt(fAt))->Label();
	else
		return "";
}
void CHistory::Redo()
{
	if (CanRedo())
	{
		m_commands[m_nextCommandIndex]->Execute(); // может выбросить исключение
		++m_nextCommandIndex;
	}
}
예제 #9
0
void
UndoContext::Redo()
{
	if (!CanRedo())
		return;

	((Action*)fHistory->ItemAt(fAt))->Do();
	fAt++;
}
예제 #10
0
파일: textctrl.cpp 프로젝트: EdgarTx/wx
void wxTextCtrl::Redo()
{
    if (CanRedo())
    {
        if (m_bIsMLE)
            ::WinSendMsg(GetHwnd(), MLM_UNDO, 0, 0);
        // Simple entryfields cannot be undone
    }
} // end of wxTextCtrl::Redo
예제 #11
0
void ProjectManager::OnMenuRedo()
{
	if(CanRedo())
	{
		projetConfig=configHistory[configHistory.size()-currentHistoryNavigation];
		currentHistoryNavigation--;
		LoadCurrentProject(false);
		Init();
	}
}
예제 #12
0
bool	cActionManager::Redo()
{ 
	if (CanRedo())
	{
		cAction* action = mRedoList.front();
		RemoveTopAction(REDO);
		action->Accept( cRedoActionVisitor::Global() );
		AddAction(UNDO, action);
		return true;
	}
	return false;
}
예제 #13
0
void CUICommandHistory::UICommandAction(CommandType type)
{
	CUICommandNode* pOldNode;
	CUICommandNode* pNewNode;

	if(type == cmdRedo)
	{
		if(!CanRedo())
			return;

		pOldNode = m_lstCommandNodes.GetAt(m_lstCommandNodes.FindIndex(m_nCommandIndex));
		pNewNode = new CUICommandNode(pOldNode->m_pBefore, pOldNode->m_pAfter, pOldNode->m_ActionType);
		m_nCommandIndex++;
	}
	else
	{
		if(!CanUndo())
			return;

		m_nCommandIndex--;
		pOldNode = m_lstCommandNodes.GetAt(m_lstCommandNodes.FindIndex(m_nCommandIndex));
		ActionType action;
		switch(pOldNode->m_ActionType)
		{
		case actionAdd:
			action = actionDelete;
			break;
		case actionModify:
			action = actionModify;
			break;
		case actionDelete:
			action = actionAdd;
			break;
		}
		pNewNode = new CUICommandNode(pOldNode->m_pAfter, pOldNode->m_pBefore, action);
	}

	switch(pNewNode->m_ActionType)
	{
	case actionAdd:
		ActionAdd(pNewNode->m_pAfter);
		break;
	case actionModify:
		ActionModify(pNewNode->m_pAfter);
		break;
	case actionDelete:
		ActionDelete(pNewNode->m_pBefore);
		break;
	}

	delete pNewNode;
}
예제 #14
0
FUndoSessionContext UTransBuffer::GetRedoContext()
{
	FUndoSessionContext Context;
	FText Title;
	if( !CanRedo( &Title ) )
	{
		Context.Title = Title;
		return Context;
	}

	const FTransaction* Transaction = &UndoBuffer[ UndoBuffer.Num() - UndoCount ];
	return Transaction->GetContext();
}
예제 #15
0
파일: EditWnd.cpp 프로젝트: kosfango/fips
void CEditWnd::Redo()
{
	if (!CanRedo()) return;
	CPoint ptCursorPos;
	if (m_pTextBuffer->Redo(ptCursorPos))
	{
		ASSERT_VALIDTEXTPOS(ptCursorPos);
		SetAnchor(ptCursorPos);
		SetSelection(ptCursorPos, ptCursorPos);
		SetCursorPos(ptCursorPos);
		EnsureVisible(ptCursorPos);
	}
}
예제 #16
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *exp - 
//-----------------------------------------------------------------------------
void CExpression::Redo( void )
{
	if ( !CanRedo() )
		return;

	Assert( m_nUndoCurrent >= 1 );
	Assert( m_nUndoCurrent <= undo.Size() );

	CExpUndoInfo *u = undo[ --m_nUndoCurrent ];
	Assert( u );
	
	memcpy( setting, u->redosetting, GLOBAL_STUDIO_FLEX_CONTROL_COUNT * sizeof( float ) );
	memcpy( weight, u->redoweight, GLOBAL_STUDIO_FLEX_CONTROL_COUNT * sizeof( float ) );
}
void CommandManager::Redo(){
	std::string feedback;
	if (CanRedo()){
		UndoRedoCount++;
		Command* pCommand = getLastRedoCommand();
		redoList.pop_back();
		if (pCommand->execute(_taskList,feedback)){
			AddUndo(pCommand);
		} else {
			delete pCommand;
			pCommand = NULL;
		}
	}
}
예제 #18
0
void wxCommandProcessor::SetMenuStrings()
{
#if wxUSE_MENUS
    if (m_commandEditMenu)
    {
        wxString undoLabel = GetUndoMenuLabel();
        wxString redoLabel = GetRedoMenuLabel();

        m_commandEditMenu->SetLabel(wxID_UNDO, undoLabel);
        m_commandEditMenu->Enable(wxID_UNDO, CanUndo());

        m_commandEditMenu->SetLabel(wxID_REDO, redoLabel);
        m_commandEditMenu->Enable(wxID_REDO, CanRedo());
    }
#endif // wxUSE_MENUS
}
예제 #19
0
bool	cActionManager::Redo(int id)
{ 
	while (42)
	{
		if (CanRedo())
		{
			cAction* action = mRedoList.front();
			RemoveTopAction(REDO);
			action->Accept( cRedoActionVisitor::Global() );
			AddAction(UNDO, action);
			if (action->m_Id == id)
				return true;
		}
		else
			return false;
	}
	return false;
}
예제 #20
0
bool UTransBuffer::Redo()
{
	CheckState();
	if( !CanRedo() )
	{
		return false;
	}

	// Apply the redo changes.
	FTransaction& Transaction = UndoBuffer[ UndoBuffer.Num() - UndoCount-- ];

	UE_LOG(LogEditorTransaction, Log,  TEXT("Redo %s"), *Transaction.GetTitle().ToString() );
	Transaction.Apply();

	CheckState();

	return true;
}
예제 #21
0
BOOL CCrystalTextBuffer::Redo(CPoint &ptCursorPos)
{
	ASSERT(CanRedo());
	ASSERT((m_aUndoBuf[0].m_dwFlags & UNDO_BEGINGROUP) != 0);
	ASSERT((m_aUndoBuf[m_nUndoPosition].m_dwFlags & UNDO_BEGINGROUP) != 0);
	for (;;)
	{
		const SUndoRecord &ur = m_aUndoBuf[m_nUndoPosition];
		if (ur.m_dwFlags & UNDO_INSERT)
		{
			int nEndLine, nEndChar;
			VERIFY(InternalInsertText(NULL, ur.m_ptStartPos.y, ur.m_ptStartPos.x, ur.m_pcText, nEndLine, nEndChar));
	#ifdef _ADVANCED_BUGCHECK
			ASSERT(ur.m_ptEndPos.y == nEndLine);
			ASSERT(ur.m_ptEndPos.x == nEndChar);
	#endif
			ptCursorPos = ur.m_ptEndPos;
		}
		else
		{
	#ifdef _ADVANCED_BUGCHECK
			CString text;
			GetText(ur.m_ptStartPos.y, ur.m_ptStartPos.x, ur.m_ptEndPos.y, ur.m_ptEndPos.x, text);
			ASSERT(lstrcmp(text, ur.m_pcText) == 0);
	#endif
			VERIFY(InternalDeleteText(NULL, ur.m_ptStartPos.y, ur.m_ptStartPos.x, ur.m_ptEndPos.y, ur.m_ptEndPos.x));
			ptCursorPos = ur.m_ptStartPos;
		}
		m_nUndoPosition ++;
		if (m_nUndoPosition == m_aUndoBuf.GetSize())
			break;
		if ((m_aUndoBuf[m_nUndoPosition].m_dwFlags & UNDO_BEGINGROUP) != 0)
			break;
	}
	if (m_bModified && m_nSyncPosition == m_nUndoPosition)
		SetModified(FALSE);
	if (! m_bModified && m_nSyncPosition != m_nUndoPosition)
		SetModified(TRUE);
	return TRUE;
}
예제 #22
0
파일: fb_frame.cpp 프로젝트: bihai/fbide
void FB_Frame::OnMenuOpen ( wxMenuEvent& event )
{
    if ( event.GetMenu() == m_EditMenu )
    {
        FB_STC * stc = 0;
        if( m_Code_areaTab != 0 )
            stc = reinterpret_cast<FB_STC *>( m_Code_areaTab->GetCurrentPage() );

        #define _ENABLE( id, func ) m_EditMenu->Enable( id, ( stc != 0 ) ? stc -> func : false )
            _ENABLE( wxID_UNDO,                 CanUndo() );
            _ENABLE( wxID_REDO,                 CanRedo() );
            _ENABLE( wxID_COPY,                 HasSelection() );
            _ENABLE( wxID_CUT,                  HasSelection() );
            _ENABLE( wxID_PASTE,                CanPaste() );
            _ENABLE( wxID_SELECTALL,            GetLength() );
            _ENABLE( fbideID_SelectLine,        GetLength() );
            _ENABLE( fbideID_CommentBlock,      CanComment() );
            _ENABLE( fbideID_UncommentBlock,    CanComment() );
        #undef _ENABLE
        m_EditMenu->Enable(wxID_JUSTIFY_RIGHT,    ( stc ) ? true : false );
        m_EditMenu->Enable(wxID_JUSTIFY_LEFT,     ( stc ) ? true : false );
    }
}
예제 #23
0
void CPWL_EditCtrl::Redo() {
  if (CanRedo())
    m_pEdit->Redo();
}
예제 #24
0
void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event)
{
    event.Enable( CanRedo() );
}
예제 #25
0
파일: edit.cpp 프로젝트: jfiguinha/Regards
// edit event handlers
void Edit::OnEditRedo (wxCommandEvent &WXUNUSED(event)) {
    if (!CanRedo()) return;
    Redo ();
}
예제 #26
0
void wxWebFrame::Redo()
{
    if (m_impl->frame && m_impl->frame->editor() && CanRedo())
        return m_impl->frame->editor()->redo();
}
예제 #27
0
void wxComboBox::OnUpdateRedo(wxUpdateUIEvent& event)
{
    event.Enable( CanRedo() );
}
예제 #28
0
파일: fb_stc.cpp 프로젝트: bihai/fbide
void FB_STC::OnRedo ( wxCommandEvent& event ) {
    if (!CanRedo()) return;
    Redo ();
}
예제 #29
0
파일: Undo.cpp 프로젝트: AJH16/TortoiseGit
bool CUndo::Redo(CBaseView * pLeft, CBaseView * pRight, CBaseView * pBottom)
{
	if (!CanRedo())
		return false;

	if (m_redogroups.size() && m_redogroups.back() == m_redocaretpoints.size())
	{
		m_redogroups.pop_back();
		std::list<int>::size_type b = m_redogroups.back();
		m_groups.push_back(b);
		m_groups.push_back(m_redocaretpoints.size());
		m_redogroups.pop_back();
		while (b < m_redocaretpoints.size())
			RedoOne(pLeft, pRight, pBottom);
	}
	else
		RedoOne(pLeft, pRight, pBottom);

	CBaseView * pActiveView = NULL;

	if (pBottom && pBottom->IsTarget())
	{
		pActiveView = pBottom;
	}
	else
		if (pRight && pRight->IsTarget())
		{
			pActiveView = pRight;
		}
		else
			//if (pLeft && pLeft->IsTarget())
		{
			pActiveView = pLeft;
		}


	if (pActiveView)
	{
		pActiveView->ClearSelection();
		pActiveView->BuildAllScreen2ViewVector();
		pActiveView->RecalcAllVertScrollBars();
		pActiveView->RecalcAllHorzScrollBars();
		pActiveView->EnsureCaretVisible();
		pActiveView->UpdateCaret();

		// TODO reduce code duplication
		if (m_redoviewstates.size() < m_originalstateLeft)
		{
			// Left can never get back to original state now
			m_originalstateLeft = (size_t)-1;
		}
		if (pLeft)
		{
			bool bModified = (m_originalstateLeft == (size_t)-1);
			if (!bModified)
			{
				std::list<allviewstate>::iterator i = m_redoviewstates.begin();
				std::advance(i, m_originalstateLeft);
				for (; i != m_redoviewstates.end(); ++i)
				{
					if (i->left.modifies)
					{
						bModified = true;
						break;
					}
				}
			}
			pLeft->SetModified(bModified);
			pLeft->ClearStepModifiedMark();
		}
		if (m_redoviewstates.size() < m_originalstateRight)
		{
			// Right can never get back to original state now
			m_originalstateRight = (size_t)-1;
		}
		if (pRight)
		{
			bool bModified = (m_originalstateRight == (size_t)-1);
			if (!bModified)
			{
				std::list<allviewstate>::iterator i = m_redoviewstates.begin();
				std::advance(i, m_originalstateRight);
				for (; i != m_redoviewstates.end() && !i->right.modifies; ++i);
				bModified = i != m_redoviewstates.end();
			}
			pRight->SetModified(bModified);
			pRight->ClearStepModifiedMark();
		}
		if (m_redoviewstates.size() < m_originalstateBottom)
		{
			// Bottom can never get back to original state now
			m_originalstateBottom = (size_t)-1;
		}
		if (pBottom)
		{
			bool bModified = (m_originalstateBottom == (size_t)-1);
			if (!bModified)
			{
				std::list<allviewstate>::iterator i = m_redoviewstates.begin();
				std::advance(i, m_originalstateBottom);
				for (; i != m_redoviewstates.end(); ++i)
				{
					if (i->bottom.modifies)
					{
						bModified = true;
						break;
					}
				}
			}
			pBottom->SetModified(bModified);
			pBottom->ClearStepModifiedMark();
		}
		pActiveView->RefreshViews();
	}

	return true;
}
예제 #30
0
파일: textctrl.cpp 프로젝트: EdgarTx/wx
void wxTextCtrl::OnUpdateRedo( wxUpdateUIEvent& rEvent )
{
    rEvent.Enable(CanRedo());
} // end of wxTextCtrl::OnUpdateRedo