// NewProjectDlg.cpp : implementation file
//

#include "stdafx.h"
#include "mapeditor.h"
#include "NewProjectDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CNewProjectDlg dialog


CNewProjectDlg::CNewProjectDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CNewProjectDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CNewProjectDlg)
	m_editFieldIP = _T("");
	m_editFieldPort = 0;
	m_editMapName = _T("");
	m_editNPCIP = _T("");
	m_editNPCPort = 0;
	m_editXSize = 100;
	m_editYSize = 100;
	m_editFieldPortUDP = 0;
	m_editNPCPortUDP = 0;
	m_editTileSetIndex = 0;
	m_editHeightMax = 0.0f;
	m_editHeightMin = 0.0f;
	m_editWaterHeight = 0.0f;
	//}}AFX_DATA_INIT
}


void CNewProjectDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CNewProjectDlg)
	DDX_Text(pDX, IDC_EDIT_FIELDIP, m_editFieldIP);
	DDX_Text(pDX, IDC_EDIT_FIELDPORT, m_editFieldPort);
	DDX_Text(pDX, IDC_EDIT_MAPNAME, m_editMapName);
	DDX_Text(pDX, IDC_EDIT_NPCIP, m_editNPCIP);
	DDX_Text(pDX, IDC_EDIT_NPCPORT, m_editNPCPort);
	DDX_Text(pDX, IDC_EDIT_X, m_editXSize);
	DDX_Text(pDX, IDC_EDIT_Y, m_editYSize);
	DDX_Text(pDX, IDC_EDIT_FIELDPORT3, m_editFieldPortUDP);
	DDX_Text(pDX, IDC_EDIT_NPCPORT3, m_editNPCPortUDP);
	DDX_Text(pDX, IDC_EDIT_TILESETINDEX, m_editTileSetIndex);
	DDX_Text(pDX, IDC_EDIT_HEIGHTMAX, m_editHeightMax);
	DDX_Text(pDX, IDC_EDIT_HEIGHTMIN, m_editHeightMin);
	DDX_Text(pDX, IDC_EDIT_WATERHEIGHT, m_editWaterHeight);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CNewProjectDlg, CDialog)
	//{{AFX_MSG_MAP(CNewProjectDlg)
	ON_EN_CHANGE(IDC_EDIT_HEIGHTMAX, OnChangeEditHeightmax)
	ON_EN_CHANGE(IDC_EDIT_HEIGHTMIN, OnChangeEditHeightmin)
	ON_EN_CHANGE(IDC_EDIT_WATERHEIGHT, OnChangeEditWaterheight)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CNewProjectDlg message handlers

void CNewProjectDlg::OnChangeEditHeightmax() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	UpdateData();
}

void CNewProjectDlg::OnChangeEditHeightmin() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	UpdateData();	
}

void CNewProjectDlg::OnChangeEditWaterheight() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function and call CRichEditCtrl().SetEventMask()
	// with the ENM_CHANGE flag ORed into the mask.
	
	// TODO: Add your control notification handler code here
	UpdateData();	
}
