/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/ATAB.CPP   1.2.1.5   17 Apr 1997 15:41:28   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/ATAB.CPP  $
** 
**    Rev 1.2.1.5   17 Apr 1997 15:41:28   ZJRD
** No change.
** 
**    Rev 1.2.1.4   16 Apr 1997 10:15:26   ZJRD
** No change.
** 
**    Rev 1.2.1.3   10 Apr 1997 15:27:16   ZJRD
** 2.09F
** 
**    Rev 1.2.1.1   03 Apr 1997 15:09:12   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:14:12   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:25:30   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:44:26   ZJRD
** Initial revision.
** 
**    Rev 1.5.1.0.1.2   09 Dec 1996 10:17:20   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.5.1.0.1.0   11 Nov 1996 13:00:36   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.5.1.4   09 Sep 1996 13:21:28   ZJRD
** No change.
** 
**    Rev 1.5.1.3   05 Sep 1996 11:32:56   ZJRD
** No change.
** 
**    Rev 1.5.1.2   02 Sep 1996 10:00:00   ZJRD
** No change.
** 
**    Rev 1.5.1.1   28 Aug 1996 15:49:46   ZJRD
** EasyPack/SLD Version 1.9b
** 
**    Rev 1.5.1.0   12 Aug 1996 10:53:58   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.2   29 May 1996 09:37:42   ZJRD
** EasyPack/SLD Version 1.95
** 
****************************************************************************/

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

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

#include "toolopt.h"    
#include "ac.h"
#include "acoption.h"
#include "aa.h"
#include "aaoption.h"
#include "al.h"
#include "aloption.h"
#include "ae.h"
#include "aeoption.h"
#include "alib.h"
#include "aliboption.h"
#include "atab.h"

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

/////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CATab, CPropertySheet)                                                

/////////////////////////////////////////////////////////////////////////////
// CATab

CATab::CATab(ACTool * pc, AATool * pa, ALTool * pl,ALIBTool * plib,AETool * pe, CWnd *pParent)
 : CPropertySheet("ICC51 Options", pParent),
    m_copt(pc), m_aopt(pa), m_lopt(pl) , m_libopt(plib), m_eopt(pe)
{
    AddPage(&m_copt);
    AddPage(&m_aopt);
    AddPage(&m_lopt);
    AddPage(&m_libopt);
    AddPage(&m_eopt);
}

CATab::~CATab()
{
}

BEGIN_MESSAGE_MAP(CATab, CPropertySheet)
    //{{AFX_MSG_MAP(CATab)
    ON_WM_CREATE()
    ON_COMMAND(IDOK, OnOK)
	ON_WM_SYSCOMMAND()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CATab message handlers


int CATab::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
        return -1;
    
    // TODO: Add your specialized creation code here
    CenterWindow();
    
    GetDlgItem(ID_APPLY_NOW)->ShowWindow(SW_HIDE);
    
    return 0;
}

void CATab::OnOK()
{
    GetActivePage()->UpdateData(TRUE);

    m_copt.SaveData();
    m_aopt.SaveData();
    m_lopt.SaveData(); 
    m_libopt.SaveData();
    m_eopt.SaveData();
    
    CPropertySheet::OnOK();
}                           

void CATab::OnSysCommand(UINT nID, LPARAM lParam)
{
	// TODO: Add your message handler code here and/or call default
	
    // Disable to move or restore main frame window.
    switch ( nID & 0x0FFF0 ) {
        case SC_MOVE:
            return;
        default:
            break;
    }

	CPropertySheet::OnSysCommand(nID, lParam);
}
