#if !defined(AFX_GRIDVIEW_H__94D752D8_CA51_11D2_8D7D_00104B11A479__INCLUDED_)
#define AFX_GRIDVIEW_H__94D752D8_CA51_11D2_8D7D_00104B11A479__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GridView.h : header file
//

#include "ViewOptions.h"
#include "NoughtsDoc.h"

/////////////////////////////////////////////////////////////////////////////
// CGridView view

class CGridView : public CView
{
protected:
	CGridView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CGridView)

// Attributes
public:

// Operations
public:
	void OnSuggestion();
	void setdivider();
	CString comment();
	int selectbox(int box);
	int boxhit(int x, int y);
	CNoughtsDoc*	pDoc;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGridView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation

	bool	startnew;
	int		commentcount;
	int		gridleft, gridtop, gridright, gridbottom;
	int		cx, cy;
	int		dividerwidth, dividerheight;
	int		boxwidth, boxheight;
	int		menux, menuy;
	int		dwidth;
	float	dividerfraction;

	CBitmap	nought;
	CBitmap	cross;
	CMenu	m_floatmenu;

private:
	void ResetComments();
	void calcsize();
	CString lasttext;
	bool redrawgrid;

protected:
	virtual ~CGridView();
	int		testvertical(int y, int box);
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CGridView)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnUndo();
	afx_msg void OnMark();
	afx_msg void OnOptions();
	afx_msg void OnStatistics();
	afx_msg void OnNew();
	afx_msg void OnViewOptions();
	afx_msg void OnClearAll();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	int boxx(int box);
	int boxy(int box);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GRIDVIEW_H__94D752D8_CA51_11D2_8D7D_00104B11A479__INCLUDED_)
