/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/BTAB.CPP   1.2.1.5   17 Apr 1997 15:42:12   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/BTAB.CPP  $
** 
**    Rev 1.2.1.5   17 Apr 1997 15:42:12   ZJRD
** No change.
** 
**    Rev 1.2.1.4   16 Apr 1997 10:16:20   ZJRD
** No change.
** 
**    Rev 1.2.1.3   10 Apr 1997 15:28:12   ZJRD
** 2.09F
** 
**    Rev 1.2.1.1   03 Apr 1997 15:09:50   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:14:48   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:26:06   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:44:46   ZJRD
** Initial revision.
** 
**    Rev 1.4.1.0.1.2   09 Dec 1996 10:15:16   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.4.1.0.1.0   11 Nov 1996 12:58:32   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.4.1.4   09 Sep 1996 13:16:00   ZJRD
** No change.
** 
**    Rev 1.4.1.3   05 Sep 1996 11:27:34   ZJRD
** No change.
** 
**    Rev 1.4.1.2   02 Sep 1996 09:54:40   ZJRD
** No change.
** 
**    Rev 1.4.1.1   28 Aug 1996 15:48:52   ZJRD
** EasyPack/SLD Version 1.9b
** 
**    Rev 1.4.1.0   12 Aug 1996 10:53:12   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.1   29 May 1996 09:36:34   ZJRD
** EasyPack/SLD Version 1.95
** 
****************************************************************************/

/////////////////////////////////////////////////////////////////////////////
// btab.cpp
//
// Michael Long
//                                                                           
// 5/13/96
//
/////////////////////////////////////////////////////////////////////////////

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

#include "toolopt.h"    
#include "bc.h"
#include "bcoption.h"
#include "ba.h"
#include "baoption.h"
#include "bl.h"
#include "bloption.h"
#include "blib.h"
#include "bliboption.h"
#include "be.h"
#include "beoption.h"

#include "btab.h"

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

/////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CBTab, CPropertySheet)                                                

/////////////////////////////////////////////////////////////////////////////
// CBTab

CBTab::CBTab(BCTool * pbc, BATool * pba, BLTool * pbl,BLIBTool * plib,BETool * pe, CWnd *pParent)
 : CPropertySheet("ICC8051 Options", pParent),
    m_bcopt(pbc), m_baopt(pba), m_blopt(pbl), m_blibopt(plib),m_beopt(pe)
{
    AddPage(&m_bcopt);
    AddPage(&m_baopt);
    AddPage(&m_blopt);
    AddPage(&m_blibopt);
    AddPage(&m_beopt);
}

CBTab::~CBTab()
{
}

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

/////////////////////////////////////////////////////////////////////////////
// CBTab message handlers


int CBTab::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 CBTab::OnOK()
{
    GetActivePage()->UpdateData(TRUE);

    m_bcopt.SaveData();
    m_baopt.SaveData();
    m_blopt.SaveData();
    m_blibopt.SaveData();
    m_beopt.SaveData();
    
    CPropertySheet::OnOK();
}                           

void CBTab::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);
}
