#if !defined(AFX_COMPASSCTL_H__895498FB_626D_475E_B523_51C7FF50F7B4__INCLUDED_)
#define AFX_COMPASSCTL_H__895498FB_626D_475E_B523_51C7FF50F7B4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// CompassCtl.h : Declaration of the CCompassCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CCompassCtrl : See CompassCtl.cpp for implementation.

class CCompassCtrl : public COleControl
{
	DECLARE_DYNCREATE(CCompassCtrl)

// Constructor
public:
	CCompassCtrl();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCompassCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	virtual DWORD GetControlFlags();
	//}}AFX_VIRTUAL

// Implementation
protected:
	void GetDrawRect(CRect* rc);
	~CCompassCtrl();

	// My functions
	void MyOnDraw(CDC* pdc, const CRect& rcBounds,const CRect& rcInvalid);
	void GetHeadingGridEndpoints(CRect* rc,POINT *p1,POINT *p2,POINT *p3, 
		double angle,double range1,double range2);	
	void GetVehicleBounds(CRect* rc, CRect* vehicle,double height,double width);
	void GetTailconeBounds(CRect* rc, CRect* tailcone,double height,double width,
		int offset);
	void GetReferencePointer(CRect* rc,CPoint points[]);
	void GetCenter(CRect *rc, POINT *p);
	double GetRadius(CRect *rc);
	void Reckon(double range, double azimuth, POINT *p1, POINT *p2);
	long int MyRound(double num_in);

	// My attributes
	CFontHolder m_directionFont;

	DECLARE_OLECREATE_EX(CCompassCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CCompassCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CCompassCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CCompassCtrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(CCompassCtrl)
		// NOTE - ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CCompassCtrl)
	double m_heading;
	afx_msg void OnHeadingChanged();
	BOOL m_circleShape;
	afx_msg void OnCircleShapeChanged();
	OLE_COLOR m_outerRingColor;
	afx_msg void OnOuterRingColorChanged();
	OLE_COLOR m_compassColor;
	afx_msg void OnCompassColorChanged();
	OLE_COLOR m_gridColor;
	afx_msg void OnGridColorChanged();
	short m_outerRingWidth;
	afx_msg void OnOuterRingWidthChanged();
	short m_majorGridWidth;
	afx_msg void OnMajorGridWidthChanged();
	short m_minorGridWidth;
	afx_msg void OnMinorGridWidthChanged();
	double m_majorGridIncrement;
	afx_msg void OnMajorGridIncrementChanged();
	double m_minorGridIncrement;
	afx_msg void OnMinorGridIncrementChanged();
	OLE_COLOR m_textColor;
	afx_msg void OnTextColorChanged();
	short m_vehicleWidth;
	afx_msg void OnVehicleWidthChanged();
	OLE_COLOR m_vehicleColor;
	afx_msg void OnVehicleColorChanged();
	OLE_COLOR m_tailconeColor;
	afx_msg void OnTailconeColorChanged();
	OLE_COLOR m_referenceMarkColor;
	afx_msg void OnReferenceMarkColorChanged();
	afx_msg LPFONTDISP GetDirectionFont();
	afx_msg void SetDirectionFont(LPFONTDISP newValue);
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CCompassCtrl)
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(CCompassCtrl)
	dispidHeading = 1L,
	dispidCircleShape = 2L,
	dispidOuterRingColor = 3L,
	dispidCompassColor = 4L,
	dispidGridColor = 5L,
	dispidOuterRingWidth = 6L,
	dispidMajorGridWidth = 7L,
	dispidMinorGridWidth = 8L,
	dispidMajorGridIncrement = 9L,
	dispidMinorGridIncrement = 10L,
	dispidTextColor = 11L,
	dispidDirectionFont = 16L,
	dispidVehicleWidth = 12L,
	dispidVehicleColor = 13L,
	dispidTailconeColor = 14L,
	dispidReferenceMarkColor = 15L,
	//}}AFX_DISP_ID
	};
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_COMPASSCTL_H__895498FB_626D_475E_B523_51C7FF50F7B4__INCLUDED)
