/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/NEWPROJ.CPP   1.6   20 Jun 1996 09:28:20   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/NEWPROJ.CPP  $
** 
**    Rev 1.6   20 Jun 1996 09:28:20   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.4   10 Jun 1996 10:22:58   ZJRD
** EasyPack/SLD Version 1.20
** 
**    Rev 1.2   29 May 1996 09:33:58   ZJRD
** EasyPack/SLD Version 1.95
** 
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
// newproj.cpp
//
// Roger Zhang
//                                                                           
// 5/7/96
//
/////////////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "resource.h"

#include "newproj.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CNewProjectDialog dialog


CNewProjectDialog::CNewProjectDialog(CWnd* pParent /*=NULL*/)
    : CDialog(CNewProjectDialog::IDD, pParent)
{
    //{{AFX_DATA_INIT(CNewProjectDialog)
    m_nCompiler = 0;
    m_strName = "";
    //}}AFX_DATA_INIT
}

void CNewProjectDialog::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CNewProjectDialog)
    DDX_CBIndex(pDX, IDC_PROJNEW_COMPILER, m_nCompiler);
    DDX_Text(pDX, IDC_PROJNEW_NAME, m_strName);
    //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CNewProjectDialog, CDialog)
    //{{AFX_MSG_MAP(CNewProjectDialog)
    ON_BN_CLICKED(IDC_PROJNEW_BROWSE, OnProjnewBrowse)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CNewProjectDialog message handlers

BOOL CNewProjectDialog::OnInitDialog()
{
    CDialog::OnInitDialog();
    
    // TODO: Add extra initialization here
    CenterWindow();
    
    return TRUE;  // return TRUE  unless you set the focus to a control
}
                   
static char BASED_CODE szFilter[] = 
    "Project (*.prj)|*.prj|All Files (*.*)|*.*||";
void CNewProjectDialog::OnProjnewBrowse()
{
    // TODO: Add your control notification handler code here
    CFileDialog dlg(TRUE, NULL, "*.prj", 
        OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter, this);                                      
    dlg.m_ofn.lpstrTitle = "Browse";
    if(dlg.DoModal() == IDOK) {
        m_strName = dlg.GetPathName();
        UpdateData(FALSE);
    }
}

void CNewProjectDialog::OnOK()
{
    // TODO: Add extra validation here
    UpdateData(TRUE);
    
    CDialog::OnOK();
}
