// FeatureDlg.cpp : implementation file
//

#include "stdafx.h"
#include "tctb.h"
#include "FeatureDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFeatureDlg

IMPLEMENT_DYNAMIC(CFeatureDlg, CPropertySheet)

CFeatureDlg::CFeatureDlg(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}

CFeatureDlg::CFeatureDlg(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
}

CFeatureDlg::~CFeatureDlg()
{
	delete FTab;
	delete PList;
}


BEGIN_MESSAGE_MAP(CFeatureDlg, CPropertySheet)
	//{{AFX_MSG_MAP(CFeatureDlg)
	ON_WM_CLOSE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFeatureDlg message handlers

BOOL CFeatureDlg::OnInitDialog() 
{
	BOOL bResult = CPropertySheet::OnInitDialog();
	int i;
	for(i=0;i<GetPageCount();i++)	SetActivePage(i);  //Make sure all the pages are initalized

	SetActivePage(0);
	
	 return bResult;
}

BOOL CFeatureDlg::Create( CWnd* pParentWnd, DWORD dwStyle, DWORD dwExStyle )
{
	 FTab=new CFeaturesTab;
	 PList=new CPathList ;
	FTab->SetPathList(PList);
	 AddPage(FTab);
	AddPage(PList);
return CPropertySheet::Create( pParentWnd , dwStyle , dwExStyle);
}


void CFeatureDlg::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	ShowWindow(SW_HIDE);

//	CPropertySheet::OnClose();
}


void CFeatureDlg::Init()
{
	 FTab->UpdateList(&PList->m_PList);

}

void CFeatureDlg::Update()
{
	SetActivePage(0);
}
