// checkzones.cpp : implementation file
//

#include "stdafx.h"

#include "ACP_Base.h"

#include "TFA.h"        // Family dll include

#define HieFriend
#include "IncGAM.h"
#include "DPT.h"
#include "..\Main\Inc\_EditID.h"

// personal include
#include "ozo.h"
//#include "Ozo\_zQuery.hpp"
#include "_zInterf.hpp"
#include "_zObject.hpp"
#include "_zModif.hpp"
#include "_zWEdit.hpp"
#include "_zWList1.hpp"
#include "_zWList2.hpp"

#include "OGD.h"        // 3dGeom dll include
#include "OAC.h"        // Actors dll include
#include "OPD.h"        // Physical Object dll include
#include "TUT.h"        // Tutorial dll include

#include "..\inc\checkzones.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCheckZones dialog


CCheckZones::CCheckZones(CPA_Actor *pActor, CStringList  *pZonesList, CWnd* pParent /*=NULL*/)
	: CDialog(CCheckZones::IDD, pParent)
{
	m_pActor = pActor;
	m_pZonesList = pZonesList;
	//{{AFX_DATA_INIT(CCheckZones)
	//}}AFX_DATA_INIT
}


void CCheckZones::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCheckZones)
	DDX_Control(pDX, IDC_LIST_ZONES, m_ctrlZonesList);
	DDX_Control(pDX, IDC_CHECK_YES, m_ctrlYes);
	DDX_Control(pDX, IDC_CHECK_ZONES, m_ctrlCheckZonesAgainstBV);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCheckZones, CDialog)
	//{{AFX_MSG_MAP(CCheckZones)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCheckZones message handlers

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Method	: OnOK
// Date		: 98-06
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Description	:
// Author		: Stegaru Cristian - CPA
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Modification	: 
// Date			:
// By			:
//////////////////////////////////////////////////////////////////////////////////////////////////////
void CCheckZones::OnOK() 
{
	UpdateData (TRUE);
	m_pActor->mfn_bSet_CheckZonesAgainstBV (m_ctrlCheckZonesAgainstBV.GetCheck ());

	if (m_ctrlYes.GetCheck ())
		CDialog::OnOK();
	else
		CDialog::OnCancel ();
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
// Method	: OnInitDialog
// Date		: 98-06
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Description	:
// Author		: Stegaru Cristian - CPA
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Modification	: 
// Date			:
// By			:
//////////////////////////////////////////////////////////////////////////////////////////////////////
BOOL CCheckZones::OnInitDialog() 
{
	if (!m_pActor || !m_pZonesList)
		CDialog::OnCancel ();

	CDialog::OnInitDialog();

	POSITION pos = m_pZonesList->GetHeadPosition ();
	while (pos)
	{
		CString csZoneName = m_pZonesList->GetNext (pos);
		m_ctrlZonesList.AddString (csZoneName);
	}
	m_ctrlCheckZonesAgainstBV.SetCheck (m_pActor->mfn_bGet_CheckZonesAgainstBV ());

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
