/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/ACOPTION.CPP   1.6   20 Jun 1996 09:30:20   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/ACOPTION.CPP  $
** 
**    Rev 1.6   20 Jun 1996 09:30:20   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.4   10 Jun 1996 10:25:00   ZJRD
** EasyPack/SLD Version 1.20
** 
**    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);
    //}}AFX_DATA_MAP
}

void ACOption::SaveData(void)
{                                  
//  UpdateData(TRUE);

    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;
}

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;
}

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
