/***************************************************************************
**
**    $Header:   D:/EP196/SRC/LOG/SRCDLL/SRCSHT.CPP   1.0   15 Aug 1997 14:03:38   ZJRD  $
**
**    $Log:   D:/EP196/SRC/LOG/SRCDLL/SRCSHT.CPP  $
** 
**    Rev 1.0   15 Aug 1997 14:03:38   ZJRD
** Initial revision.
** 
**    Rev 1.1.7.0   19 Jun 1997 14:49:10   ZJRD
** 1.0c
** 
****************************************************************************/

// srcopt.cpp : implementation file
//

#include "stdafx.h"
#include "srcdll.h"
#include "srcgbl.h"
#include "srcsht.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSourceSheet property sheet

IMPLEMENT_DYNAMIC(CSourceSheet, CPropertySheet)

CSourceSheet::CSourceSheet(CWnd *pParent /* = NULL */, UINT iSelectPage /* = 0 */)
    : CPropertySheet(IDS_SOURCE_GROUP, pParent, iSelectPage)
{
    // Add pages to the property sheet
    AddPage(&m_pageLoadOption);
    AddPage(&m_pageExtName);
    AddPage(&m_pagePath);
    AddPage(&m_pageBrowseModule);
    AddPage(&m_pageBp);
    AddPage(&m_pageInfo);
}

CSourceSheet::~CSourceSheet()
{
}


BEGIN_MESSAGE_MAP(CSourceSheet, CPropertySheet)
	//{{AFX_MSG_MAP(CSourceSheet)
	ON_WM_CREATE()
	ON_WM_NCLBUTTONDOWN()
	ON_WM_NCRBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CSourceSheet message handlers

int CSourceSheet::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CPropertySheet::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	
    // Centering dialog box.
    CenterWindow();

	// Gray the Apply button
//	GetDlgItem(ID_APPLY_NOW)->ShowWindow(SW_HIDE);

	return 0;
}

void CSourceSheet::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
	// TODO: Add your message handler code here and/or call default

	// Avoid Combo-box bug
	if ( HTCAPTION == nHitTest ) {
		GetPage(pagePath)->NextDlgCtrl();
		GetPage(pagePath)->PrevDlgCtrl();
		GetPage(pageBp)->NextDlgCtrl();
		GetPage(pageBp)->PrevDlgCtrl();
	}
		
	CPropertySheet::OnNcLButtonDown(nHitTest, point);
}

void CSourceSheet::OnNcRButtonDown(UINT nHitTest, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	
	// Avoid Combo-box bug
	if ( HTCAPTION == nHitTest ) {
		GetPage(pagePath)->NextDlgCtrl();
		GetPage(pagePath)->PrevDlgCtrl();
		GetPage(pageBp)->NextDlgCtrl();
		GetPage(pageBp)->PrevDlgCtrl();
	}
		
	CPropertySheet::OnNcRButtonDown(nHitTest, point);
}
