// CompassPpg.cpp : Implementation of the CCompassPropPage property page class.

#include "stdafx.h"
#include "Compass.h"
#include "CompassPpg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


IMPLEMENT_DYNCREATE(CCompassPropPage, COlePropertyPage)


/////////////////////////////////////////////////////////////////////////////
// Message map

BEGIN_MESSAGE_MAP(CCompassPropPage, COlePropertyPage)
	//{{AFX_MSG_MAP(CCompassPropPage)
	// NOTE - ClassWizard will add and remove message map entries
	//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// Initialize class factory and guid

IMPLEMENT_OLECREATE_EX(CCompassPropPage, "COMPASS.CompassPropPage.1",
	0x979f82ce, 0xb680, 0x4152, 0xa6, 0x5e, 0xa3, 0x2c, 0x52, 0x25, 0x2e, 0x5f)


/////////////////////////////////////////////////////////////////////////////
// CCompassPropPage::CCompassPropPageFactory::UpdateRegistry -
// Adds or removes system registry entries for CCompassPropPage

BOOL CCompassPropPage::CCompassPropPageFactory::UpdateRegistry(BOOL bRegister)
{
	if (bRegister)
		return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
			m_clsid, IDS_COMPASS_PPG);
	else
		return AfxOleUnregisterClass(m_clsid, NULL);
}


/////////////////////////////////////////////////////////////////////////////
// CCompassPropPage::CCompassPropPage - Constructor

CCompassPropPage::CCompassPropPage() :
	COlePropertyPage(IDD, IDS_COMPASS_PPG_CAPTION)
{
	//{{AFX_DATA_INIT(CCompassPropPage)
	m_majorGridWidth = 0;
	m_majorGridIncrement = 0.0;
	m_minorGridIncrement = 0.0;
	m_minorGridWidth = 0;
	m_outerRingWidth = 0;
	//}}AFX_DATA_INIT
}


/////////////////////////////////////////////////////////////////////////////
// CCompassPropPage::DoDataExchange - Moves data between page and properties

void CCompassPropPage::DoDataExchange(CDataExchange* pDX)
{
	//{{AFX_DATA_MAP(CCompassPropPage)
	DDP_Text(pDX, IDC_MAJORGRIDWIDTH, m_majorGridWidth, _T("MajorGridWidth") );
	DDX_Text(pDX, IDC_MAJORGRIDWIDTH, m_majorGridWidth);
	DDV_MinMaxInt(pDX, m_majorGridWidth, 1, 5);
	DDP_Text(pDX, IDC_MAJORGRIDINCREMENT, m_majorGridIncrement, _T("MajorGridIncrement") );
	DDX_Text(pDX, IDC_MAJORGRIDINCREMENT, m_majorGridIncrement);
	DDV_MinMaxDouble(pDX, m_majorGridIncrement, 5., 45.);
	DDP_Text(pDX, IDC_MINORGRIDINCREMENT, m_minorGridIncrement, _T("MinorGridIncrement") );
	DDX_Text(pDX, IDC_MINORGRIDINCREMENT, m_minorGridIncrement);
	DDV_MinMaxDouble(pDX, m_minorGridIncrement, 1., 30.);
	DDP_Text(pDX, IDC_MINORGRIDWIDTH, m_minorGridWidth, _T("MinorGridWidth") );
	DDX_Text(pDX, IDC_MINORGRIDWIDTH, m_minorGridWidth);
	DDV_MinMaxInt(pDX, m_minorGridWidth, 1, 5);
	DDP_Text(pDX, IDC_OUTERRINGWIDTH, m_outerRingWidth, _T("OuterRingWidth") );
	DDX_Text(pDX, IDC_OUTERRINGWIDTH, m_outerRingWidth);
	DDV_MinMaxInt(pDX, m_outerRingWidth, 1, 20);
	//}}AFX_DATA_MAP
	DDP_PostProcessing(pDX);
}


/////////////////////////////////////////////////////////////////////////////
// CCompassPropPage message handlers
