/*==========================================================================*/
/* Copyright (c) 1999 - Sykes Enterprises Inc. - All rights reserved        */
/*--------------------------------------------------------------------------*/
/* Sykes grants you ("Licensee") a non-exclusive, royalty free, license to  */
/* use, modify and redistribute this software in source and binary code     */
/* form, provided that i) this copyright notice and license appear on all   */
/* copies of the software; and ii) Licensee does not utilize the software   */
/* in a manner which is disparaging to Sykes.                               */
/*                                                                          */
/* This software is provided "AS IS", without a warranty of any kind. ALL   */
/* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING */
/* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR        */
/* PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SYKES AND ITS          */
/* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A  */
/* RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS           */
/* DERIVATIVES. IN NO EVENT WILL SYKES OR ITS LICENSORS BE LIABLE FOR ANY   */
/* LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,          */
/* CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND        */
/* REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR      */
/* INABILITY TO USE SOFTWARE, EVEN IF SYKES HAS BEEN ADVISED OF THE         */
/* POSSIBILITY OF SUCH DAMAGES.                                             */
/*==========================================================================*/

#include "stdafx.h"
#include "Waikoloa.h"
#include "DlgNewTM.h"

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


/*--------------------------------------------------------------------------*/

CDlgNewTM::CDlgNewTM(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgNewTM::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgNewTM)
	m_csSource = _T("EN-US");
	m_csTarget = _T("FR-FR");
	m_csPath = _T("C:\\Untitled.ltm");
	//}}AFX_DATA_INIT
}


/*--------------------------------------------------------------------------*/

void CDlgNewTM::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);

	//{{AFX_DATA_MAP(CDlgNewTM)
	DDX_Text(pDX, IDC_SOURCE, m_csSource);
	DDV_MaxChars(pDX, m_csSource, 5);
	DDX_Text(pDX, IDC_TARGET, m_csTarget);
	DDV_MaxChars(pDX, m_csTarget, 5);
	DDX_Text(pDX, IDC_PATH, m_csPath);
	DDV_MaxChars(pDX, m_csPath, 255);
	//}}AFX_DATA_MAP
}


/*--------------------------------------------------------------------------*/

BEGIN_MESSAGE_MAP(CDlgNewTM, CDialog)
	//{{AFX_MSG_MAP(CDlgNewTM)
	ON_BN_CLICKED(IDC_GETPATH, OnGetpath)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/*--------------------------------------------------------------------------*/

void CDlgNewTM::OnGetpath() 
{
	CString              csTitle;
	CString              csFilter;


	csTitle.LoadString(IDS_CREATEOPENTMTITLE);
	csFilter.LoadString(IDS_LTMFILTER);

	CFileDialog Dlg(TRUE, "ltm", NULL,
		OFN_EXPLORER | OFN_SHAREAWARE | OFN_HIDEREADONLY, csFilter);
	Dlg.m_ofn.lpstrTitle = csTitle;

	if ( Dlg.DoModal() != IDOK ) return;

	GetDlgItem(IDC_PATH)->SetWindowText(Dlg.GetPathName());
	PrevDlgCtrl();
}

