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

/////////////////////////////////////////////////////////////////////////////
// dtab.cpp
//
// Michael Long
//                                                                           
// 5/16/96
//
/////////////////////////////////////////////////////////////////////////////

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

#include "toolopt.h"    
#include "dc.h"
#include "dcoption.h"
#include "da.h"
#include "daoption.h"
#include "dl.h"
#include "dloption.h"
#include "dlib.h"
#include "dlibopti.h"
#include "de.h"
#include "deoption.h"

#include "dtab.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CDTab, CPropertySheet)                                                

/////////////////////////////////////////////////////////////////////////////
// CDTab

CDTab::CDTab(DCTool * pc, DATool * pa, DLTool * pl,DLIBTool *plib,DETool * pe, CWnd *pParent)
 : CPropertySheet("OMF51 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);
}                                                                  


CDTab::~CDTab()
{
}

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

/////////////////////////////////////////////////////////////////////////////
// CDTab message handlers


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

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

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