// BCGControlsPropSheet.cpp : implementation file
//

#include "stdafx.h"
#include "bcgpcontrols.h"
#include "AboutDialog.h"
#include "BCGControlsPropSheet.h"

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

/////////////////////////////////////////////////////////////////////////////
// BCGControlsPropSheet

IMPLEMENT_DYNAMIC(BCGControlsPropSheet, CBCGPPropertySheet)

BCGControlsPropSheet::BCGControlsPropSheet(CWnd* pParentWnd)
	:CBCGPPropertySheet (IDS_CAPTION, pParentWnd)
{
	SetLook (CBCGPPropertySheet::PropSheetLook_OutlookBar);
	SetIconsList (IDB_ICONS, 32);

	AddPage(&m_Page1);
	AddPage(&m_Page2);
	AddPage(&m_Page3);
	AddPage(&m_Page4);
	AddPage(&m_Page5);
	AddPage(&m_Page6);

	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

BCGControlsPropSheet::~BCGControlsPropSheet()
{
}


BEGIN_MESSAGE_MAP(BCGControlsPropSheet, CBCGPPropertySheet)
	//{{AFX_MSG_MAP(BCGControlsPropSheet)
	ON_WM_QUERYDRAGICON()
	ON_WM_SYSCOMMAND()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// BCGControlsPropSheet message handlers


BOOL BCGControlsPropSheet::OnInitDialog() 
{
	BOOL bResult = CBCGPPropertySheet::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	return bResult;
}

HCURSOR BCGControlsPropSheet::OnQueryDragIcon() 
{
	return (HCURSOR) m_hIcon;
}

void BCGControlsPropSheet::OnSysCommand(UINT nID, LPARAM lParam) 
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDialog dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CBCGPPropertySheet::OnSysCommand(nID, lParam);
	}
}
