/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/ACOPTION.CPP   1.2.1.5   17 Apr 1997 15:40:54   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/ACOPTION.CPP  $
** 
**    Rev 1.2.1.5   17 Apr 1997 15:40:54   ZJRD
** No change.
** 
**    Rev 1.2.1.4   16 Apr 1997 10:11:08   ZJRD
** No change.
** 
**    Rev 1.2.1.3   10 Apr 1997 15:26:40   ZJRD
** 2.09F
** 
**    Rev 1.2.1.1   03 Apr 1997 15:08:46   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:13:46   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:25:04   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:44:12   ZJRD
** Initial revision.
** 
**    Rev 1.5.1.0.1.2   09 Dec 1996 10:15:02   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.5.1.0.1.0   11 Nov 1996 12:58:18   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.5.1.4   09 Sep 1996 13:15:36   ZJRD
** No change.
** 
**    Rev 1.5.1.3   05 Sep 1996 11:27:08   ZJRD
** No change.
** 
**    Rev 1.5.1.2   02 Sep 1996 09:54:14   ZJRD
** No change.
** 
**    Rev 1.5.1.1   28 Aug 1996 15:48:28   ZJRD
** No change.
** 
**    Rev 1.5.1.0   12 Aug 1996 10:52:58   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.2   29 May 1996 09:37:40   ZJRD
** EasyPack/SLD Version 1.95
** 
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
// ac.cpp
//
// Roger Zhang
//                                                                           
// 5/2/96
//
/////////////////////////////////////////////////////////////////////////////

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

#include "toolopt.h"
#include "ac.h"
#include "acoption.h"

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

/////////////////////////////////////////////////////////////////////////////
// ACOption dialog


ACOption::ACOption(ACTool * pTool)
    : CPropertyPage(ACOption::IDD)
{                                
    ASSERT(pTool);
    
    m_pTool = pTool;          
    
    LoadData();

    //{{AFX_DATA_INIT(ACOption)

	//}}AFX_DATA_INIT
}

void ACOption::DoDataExchange(CDataExchange* pDX)
{
    CPropertyPage::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(ACOption)
    DDX_CBIndex(pDX, IDC_ACOPT_BANK, m_nRegBank);
    DDX_CBIndex(pDX, IDC_ACOPT_MODEL, m_nMemoryModel);
    DDX_CBIndex(pDX, IDC_ACOPT_OPTIMIZE, m_nOptimize);
    DDX_Text(pDX, IDC_ACOPT_MORE, m_strMore);
    DDX_Check(pDX, IDC_ACOPT_ROM, m_fStrInRom);
    DDX_Check(pDX, IDC_ACOPT_UCHAR, m_fUChar);
    DDX_Check(pDX, IDC_ACOPT_WARN, m_fNoWarn);
    DDX_Text(pDX, IDC_ACOPT_PATH_EDIT, m_strPath);
	DDX_Text(pDX, IDC_AAOPT_PATH_EDITINC, m_incPath);
	//}}AFX_DATA_MAP
}

void ACOption::SaveData(void)
{                                  
//  UpdateData(TRUE);
    m_strPath.TrimLeft();
    m_strPath.TrimRight();
    m_strMore.TrimLeft();
    m_strMore.TrimRight(); 
    m_incPath.TrimLeft();
    m_incPath.TrimRight();
    m_pTool->m_nRegBank     = m_nRegBank;
    m_pTool->m_nMemoryModel = m_nMemoryModel;
    m_pTool->m_nOptimize    = m_nOptimize;
    m_pTool->m_strMore      = m_strMore;
    m_pTool->m_fStrInRom    = m_fStrInRom;
    m_pTool->m_fUChar       = m_fUChar;
    m_pTool->m_fNoWarn      = m_fNoWarn;
    m_pTool->m_strPath      = m_strPath;  
    m_pTool->m_incPath      = m_incPath;
}

void ACOption::LoadData(void)
{
    m_nRegBank     = m_pTool->m_nRegBank;
    m_nMemoryModel = m_pTool->m_nMemoryModel;
    m_nOptimize    = m_pTool->m_nOptimize;
    m_strMore      = m_pTool->m_strMore;
    m_fStrInRom    = m_pTool->m_fStrInRom;
    m_fUChar       = m_pTool->m_fUChar;
    m_fNoWarn      = m_pTool->m_fNoWarn;
    m_strPath      = m_pTool->m_strPath; 
    m_incPath      = m_pTool->m_incPath;
}

BEGIN_MESSAGE_MAP(ACOption, CPropertyPage)
    //{{AFX_MSG_MAP(ACOption)
        // NOTE: the ClassWizard will add message map macros here
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// ACOption message handlers
