// VMode.cpp : implementation file
//

#include "stdafx.h"
#include "CDXCreator.h"
#include "VMode.h"

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

/////////////////////////////////////////////////////////////////////////////
// CVMode dialog


CVMode::CVMode(CWnd* pParent /*=NULL*/)
	: CDialog(CVMode::IDD, pParent)
{
	//{{AFX_DATA_INIT(CVMode)
	m_1024 = FALSE;
	m_16Bit = FALSE;
	m_24Bit = FALSE;
	m_320 = FALSE;
	m_32Bit = FALSE;
	m_640 = FALSE;
	m_800 = FALSE;
	//}}AFX_DATA_INIT
}


void CVMode::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CVMode)
	DDX_Check(pDX, IDC_1024_CHECK, m_1024);
	DDX_Check(pDX, IDC_16BIT_CHECK, m_16Bit);
	DDX_Check(pDX, IDC_24BIT_CHECK, m_24Bit);
	DDX_Check(pDX, IDC_320_CHECK, m_320);
	DDX_Check(pDX, IDC_32BIT_CHECK, m_32Bit);
	DDX_Check(pDX, IDC_640_CHECK, m_640);
	DDX_Check(pDX, IDC_800_CHECK, m_800);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CVMode, CDialog)
	//{{AFX_MSG_MAP(CVMode)
	ON_BN_CLICKED(IDC_1024_CHECK, On1024Check)
	ON_BN_CLICKED(IDC_16BIT_CHECK, On16bitCheck)
	ON_BN_CLICKED(IDC_24BIT_CHECK, On24bitCheck)
	ON_BN_CLICKED(IDC_320_CHECK, On320Check)
	ON_BN_CLICKED(IDC_32BIT_CHECK, On32bitCheck)
	ON_BN_CLICKED(IDC_640_CHECK, On640Check)
	ON_BN_CLICKED(IDC_800_CHECK, On800Check)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CVMode message handlers

void CVMode::On1024Check() 
{
	m_1024=TRUE;
	m_800=FALSE;
	m_640=FALSE;
	m_320=FALSE;
	UpdateData (FALSE);
}

void CVMode::On16bitCheck() 
{
	if (m_320==FALSE)
	{
		m_32Bit=FALSE;
		m_24Bit=FALSE;
		m_16Bit=TRUE;
	}
	UpdateData (FALSE);
}

void CVMode::On24bitCheck() 
{
	if (m_320==FALSE)
	{
		m_32Bit=FALSE;
		m_24Bit=TRUE;
		m_16Bit=FALSE;
	}
	UpdateData (FALSE);
}

void CVMode::On32bitCheck() 
{
	if (m_320==FALSE)
	{
		m_32Bit=TRUE;
		m_24Bit=FALSE;
		m_16Bit=FALSE;
	}
	UpdateData (FALSE);
}

void CVMode::On320Check() 
{
	m_1024=FALSE;
	m_800=FALSE;
	m_640=FALSE;
	m_320=TRUE;
	
	// 320x200 hat nur 8BPP!! Deswegen alles andere deaktivieren
	m_16Bit=FALSE;
	m_24Bit=FALSE;
	m_32Bit=FALSE;

	UpdateData (FALSE);
}

void CVMode::On640Check() 
{
	m_1024=FALSE;
	m_800=FALSE;
	m_640=TRUE;
	m_320=FALSE;
	UpdateData (FALSE);
}

void CVMode::On800Check() 
{
	m_1024=FALSE;
	m_800=TRUE;
	m_640=FALSE;
	m_320=FALSE;
	UpdateData (FALSE);
}
