#if !defined(AFX_EIGHTBALL2CTL_H__C8256BED_9F0E_4CFF_BF7E_AFC2FDF6C290__INCLUDED_)
#define AFX_EIGHTBALL2CTL_H__C8256BED_9F0E_4CFF_BF7E_AFC2FDF6C290__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// EightBall2Ctl.h : Declaration of the CEightBall2Ctrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// CEightBall2Ctrl : See EightBall2Ctl.cpp for implementation.

class CEightBall2Ctrl : public COleControl
{
	DECLARE_DYNCREATE(CEightBall2Ctrl)

// Constructor
public:
	CEightBall2Ctrl();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEightBall2Ctrl)
	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:
	~CEightBall2Ctrl();

	// My functions
	void MyOnDraw(CDC* pdc, const CRect& rcBounds,const CRect& rcInvalid);
	void GetChordEndpoints(CRect* rc,POINT* p1,POINT* p2);
	void GetReferenceMarks(CRect* rc,POINT* p1,POINT* p2,POINT* p3,POINT* p4,
		POINT* p5);
	void GetReferencePointer(CRect* rc,CPoint points[]);
	void GetRollGridEndpoints(CRect* rc,POINT *p1,POINT *p2,double angle,
		double startRange);
	void GetPitchGridEndpoints(CRect* rc,POINT *p1,POINT *p2,double angle,
		double startRange);
	void GetDrawRect(CRect *rc);
	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);

	// member variables
	double m_roll;
	double m_pitch;

	DECLARE_OLECREATE_EX(CEightBall2Ctrl)    // Class factory and guid
	DECLARE_OLETYPELIB(CEightBall2Ctrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(CEightBall2Ctrl)     // Property page IDs
	DECLARE_OLECTLTYPE(CEightBall2Ctrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(CEightBall2Ctrl)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(CEightBall2Ctrl)
	BOOL m_circleShape;
	afx_msg void OnCircleShapeChanged();
	OLE_COLOR m_groundColor;
	afx_msg void OnGroundColorChanged();
	OLE_COLOR m_skyColor;
	afx_msg void OnSkyColorChanged();
	OLE_COLOR m_horizonColor;
	afx_msg void OnHorizonColorChanged();
	OLE_COLOR m_outerRingColor;
	afx_msg void OnOuterRingColorChanged();
	short m_outerRingWidth;
	afx_msg void OnOuterRingWidthChanged();
	OLE_COLOR m_referenceMarkColor;
	afx_msg void OnReferenceMarkColorChanged();
	OLE_COLOR m_gridColor;
	afx_msg void OnGridColorChanged();
	short m_majorGridWidth;
	afx_msg void OnMajorGridWidthChanged();
	short m_minorGridWidth;
	afx_msg void OnMinorGridWidthChanged();
	double m_maxRollAngle;
	afx_msg void OnMaxRollAngleChanged();
	double m_majorRollGridIncrement;
	afx_msg void OnMajorRollGridIncrementChanged();
	double m_minorRollGridIncrement;
	afx_msg void OnMinorRollGridIncrementChanged();
	double m_majorPitchGridIncrement;
	afx_msg void OnMajorPitchGridIncrementChanged();
	double m_minorPitchGridIncrement;
	afx_msg void OnMinorPitchGridIncrementChanged();
	double m_maxPitchAngle;
	afx_msg void OnMaxPitchAngleChanged();
	double m_maxPitchGridAngle;
	afx_msg void OnMaxPitchGridAngleChanged();
	afx_msg double GetRoll();
	afx_msg void SetRoll(double newValue);
	afx_msg double GetPitch();
	afx_msg void SetPitch(double newValue);
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

	afx_msg void AboutBox();

// Event maps
	//{{AFX_EVENT(CEightBall2Ctrl)
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(CEightBall2Ctrl)
	dispidRoll = 18L,
	dispidPitch = 19L,
	dispidCircleShape = 1L,
	dispidGroundColor = 2L,
	dispidSkyColor = 3L,
	dispidHorizonColor = 4L,
	dispidOuterRingColor = 5L,
	dispidOuterRingWidth = 6L,
	dispidReferenceMarkColor = 7L,
	dispidGridColor = 8L,
	dispidMajorGridWidth = 9L,
	dispidMinorGridWidth = 10L,
	dispidMaxRollAngle = 11L,
	dispidMajorRollGridIncrement = 12L,
	dispidMinorRollGridIncrement = 13L,
	dispidMajorPitchGridIncrement = 14L,
	dispidMinorPitchGridIncrement = 15L,
	dispidMaxPitchAngle = 16L,
	dispidMaxPitchGridAngle = 17L,
	//}}AFX_DISP_ID
	};
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EIGHTBALL2CTL_H__C8256BED_9F0E_4CFF_BF7E_AFC2FDF6C290__INCLUDED)
