// EdIRBVwX.cpp : implementation file
//

#include "stdafx.h"

#include "Defines.hpp"

#ifdef D_ED_IR_ACTIVE

#include "EdIRBVwD.hpp"

#include "EdIRBVw.hpp"
#include "EdIRBeEn.hpp"
#include "EdIRBELs.hpp"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// class CPA_EdIR_UndoDeleteBehaviour
/////////////////////////////////////////////////////////////////////////////

/**********************************************************************************/
CPA_EdIR_UndoDeleteBehaviour::CPA_EdIR_UndoDeleteBehaviour(CPA_EdIR_DiagView *pclDiagView,
														   CPA_EdIR_MainBehaviour *pclMainBehaviour,
														   CPA_EdIR_MainBehaviourList *pclMainBehaviourList,
														   BOOL bBlock)
	:CPA_Modif(2,"Delete Behaviour",bBlock)
{
	m_pclDiagView=pclDiagView;
	m_pclMainBehaviour=pclMainBehaviour;
	m_pclMainBehaviourList=pclMainBehaviourList;
}

/**********************************************************************************/
CPA_EdIR_UndoDeleteBehaviour::~CPA_EdIR_UndoDeleteBehaviour()
{
}

/**********************************************************************************/
BOOL CPA_EdIR_UndoDeleteBehaviour::Do()
{
	BOOL bDeleted = m_pclDiagView->m_fn_bDeleteBehaviourFromList(m_pclMainBehaviour);
	
	m_pclMainBehaviourList->m_fn_vSetModified(bDeleted);

	return bDeleted;
}

/**********************************************************************************/
BOOL CPA_EdIR_UndoDeleteBehaviour::Undo()
{
	m_pclDiagView->m_fn_vAddOneBehaviourInList(m_pclMainBehaviour);
	m_pclMainBehaviourList->m_fn_vSetModified(TRUE);

	return TRUE;
}

#endif //D_ED_IR_ACTIVE
