// ExportToEfDlg.cpp : implementation file
//

#include "stdafx.h"
#include "psm.h"
#include "ExportToEfDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CExportToEfDlg dialog

BOOL CExportToEfDlg::m_exp_doc=FALSE;
BOOL CExportToEfDlg::m_exp_geom=FALSE;
BOOL CExportToEfDlg::m_map_qacu_to_nauo=TRUE;
BOOL CExportToEfDlg::m_add_ass_axis_to_part=FALSE;

CExportToEfDlg::CExportToEfDlg(CWnd* pParent /*=NULL*/)
	: CaplTranslateDialog(CExportToEfDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CExportToEfDlg)
	m_prd_id = _T("");
	m_prd_name = _T("");
	m_prd_ver = _T("");
	m_FileName = _T("");
	m_text_coding_idx = 0;
	m_add_ass_axis_to_part = TRUE;
	//}}AFX_DATA_INIT
}


void CExportToEfDlg::DoDataExchange(CDataExchange* pDX)
{
	CaplTranslateDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CExportToEfDlg)
	DDX_Control(pDX, IDC_EXP_GEOM, m_exp_geom_ctrl);
	DDX_Control(pDX, IDC_FILE, m_file);
	DDX_Control(pDX, IDC_TEXT_CODING, m_text_coding);
	DDX_Text(pDX, IDC_PRD_ID, m_prd_id);
	DDX_Text(pDX, IDC_PRD_NAME, m_prd_name);
	DDX_Text(pDX, IDC_PRD_VER, m_prd_ver);
	DDX_Text(pDX, IDC_FILE, m_FileName);
	DDX_CBIndex(pDX, IDC_TEXT_CODING, m_text_coding_idx);
	DDX_Check(pDX, IDC_EXP_DOC, m_exp_doc);
	DDX_Check(pDX, IDC_EXP_GEOM, m_exp_geom);
	DDX_Check(pDX, IDC_MAP_QACU_TO_NAUO, m_map_qacu_to_nauo);
	DDX_Check(pDX, IDC_ADD_AXIS_IN_PART, m_add_ass_axis_to_part);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CExportToEfDlg, CaplTranslateDialog)
	//{{AFX_MSG_MAP(CExportToEfDlg)
	ON_BN_CLICKED(IDC_SELECT_FILE, OnSelectFile)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CExportToEfDlg message handlers

void CExportToEfDlg::OnSelectFile() 
{
	CString FileName;
	m_file.GetWindowText(FileName);
	TCHAR*  lpszDefExt=_T("");
	TCHAR* szStepFilter = _T("STEP Files (*.stp;*.p21)|*.stp; *.p21|")
		_T("All Files (*.*)|*.*||");

	CFileDialog dlgFile(FALSE, _T("std"),LPCTSTR(FileName),
		OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_EXTENSIONDIFFERENT,szStepFilter);

	if(dlgFile.DoModal() == IDOK)
	{
		CString ext=dlgFile.GetFileExt();
		FileName=dlgFile.GetPathName();
		m_file.SetWindowText(LPCTSTR(FileName));
	}

}
