// ExportTextures.cpp : implementation file
//

#include "stdafx.h"
#include "fontedit.h"
#include "ExportTextures.h"
#include "choosedir.h"

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

/////////////////////////////////////////////////////////////////////////////
// CExportTextures dialog


CExportTextures::CExportTextures(CWnd* pParent /*=NULL*/)
	: CDialog(CExportTextures::IDD, pParent)
{
	//{{AFX_DATA_INIT(CExportTextures)
	m_FileTag = _T("");
	m_OutputDir = _T("");
	//}}AFX_DATA_INIT
}


void CExportTextures::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CExportTextures)
	DDX_Text(pDX, IDC_FILETAG, m_FileTag);
	DDX_Text(pDX, IDC_OUPUTDIR, m_OutputDir);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CExportTextures, CDialog)
	//{{AFX_MSG_MAP(CExportTextures)
	ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExportTextures message handlers

void CExportTextures::OnOK() 
{
	UpdateData(true);
	if (m_FileTag.GetLength() < 1)
	{
		MessageBox("You must enter a tag.","Hello!",MB_OK);
		return;
	}
	if (m_OutputDir.GetLength() < 1)
	{
		MessageBox("You must enter a directory to write the exported files into.","Hello!",MB_OK);
		return;
	}
	CDialog::OnOK();
}

void CExportTextures::OnCancel() 
{
	CDialog::OnCancel();
}

void CExportTextures::OnBrowse() 
{
	CChooseDir dlg;
	dlg.DoModal();
	
}
