// AlignDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MW4GameEd2.h"
#include "AlignDlg.h"
#include <Adept\Entity.hpp>

using namespace Adept;


/////////////////////////////////////////////////////////////////////////////
// CAlignDlg dialog


CAlignDlg::CAlignDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAlignDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAlignDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CAlignDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAlignDlg)
	DDX_Control(pDX, IDC_ALIGNLIST, m_Align);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CAlignDlg message handlers


BOOL CAlignDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	int i,itm;

	for(i=0;i<Entity::LastAlignment;i++)
	{
	itm=m_Align.AddString(Entity::AlignmentAsciiToText(i));
	m_Align.SetItemData(itm,i);
	}
	
	for(i=0;i<m_Align.GetCount();i++)
	if(m_Align.GetItemData(i)==m_alignment)
	{
	m_Align.SetCurSel(i);
	}
	

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

void CAlignDlg::OnOK() 
{
	// TODO: Add extra validation here
	
	m_alignment=m_Align.GetItemData(m_Align.GetCurSel());
	CDialog::OnOK();
}
