// ViewOptions.cpp : implementation file
//

#include "stdafx.h"
#include "Noughts.h"
#include "ViewOptions.h"

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

/////////////////////////////////////////////////////////////////////////////
// ViewOptions dialog


ViewOptions::ViewOptions(CWnd* pParent /*=NULL*/)
	: CDialog(ViewOptions::IDD, pParent)
{
	//{{AFX_DATA_INIT(ViewOptions)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void ViewOptions::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Check(pDX, IDC_ROUNDED, rounded);
	DDX_Check(pDX, IDC_RAISED, raised);
	DDX_Check(pDX, IDC_AUTO, autostart);

	//{{AFX_DATA_MAP(ViewOptions)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(ViewOptions, CDialog)
	//{{AFX_MSG_MAP(ViewOptions)
	ON_BN_CLICKED(IDC_OK, OnOk)
	ON_BN_CLICKED(IDC_ROUNDED, OnRounded)
	ON_BN_CLICKED(IDC_CANCEL, OnCancel)
	ON_CBN_EDITCHANGE(IDC_COMBO1, OnGridColour)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// ViewOptions message handlers

void ViewOptions::OnOk() 
{
	CDialog::OnOK();
	CSliderCtrl*  slider = (CSliderCtrl*) GetDlgItem (IDC_SLIDER1);
	dwidth = slider->GetPos();
	EndDialog(IDOK);
}

void ViewOptions::OnCancel() 
{
	CDialog::OnCancel();
	EndDialog(IDCANCEL);
}

void ViewOptions::OnRounded() 
{
	// TODO: Add your control notification handler code here
	
}

BOOL ViewOptions::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CSliderCtrl*	slider = (CSliderCtrl*) GetDlgItem (IDC_SLIDER1);

	slider->SetRange(1,4, TRUE);
	slider->SetPos(dwidth);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void ViewOptions::OnGridColour() 
{
	// TODO: Add your control notification handler code here
	
}
