// YtvAlarmPropertySheet.cpp : implementation file
//

#include "stdafx.h"
#include "YtvAlarm.h"
#include "YtvAlarmPropertySheet.h"

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

/////////////////////////////////////////////////////////////////////////////
// YtvAlarmPropertySheet

IMPLEMENT_DYNAMIC(YtvAlarmPropertySheet, CPropertySheet)

YtvAlarmPropertySheet::YtvAlarmPropertySheet()
{
}

YtvAlarmPropertySheet::YtvAlarmPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
}

YtvAlarmPropertySheet::~YtvAlarmPropertySheet()
{
}
BOOL YtvAlarmPropertySheet::Init()
{
m_clrDialBack=RGB(0,0,0);
	m_clrDialFront=RGB(0,0,0);
	m_clrDialBrush=RGB(0,255,255);    
   	m_hbrDialBrush=CreateSolidBrush(m_clrDialBrush);
	m_clrButtonsBrush=RGB(255,0,0); 
	m_hbrButtonsBrush=CreateSolidBrush(m_clrButtonsBrush);
	m_clrButtonsBack=RGB(255,0,0);
	m_clrButtonsFront=RGB(255,255,255);
	m_clrStaticBrush=RGB(0,0,255); 
	m_clrStaticBack=RGB(0,0,255);
	m_clrStaticFront=RGB(255,255,255);
	m_hbrStaticBrush=CreateSolidBrush(m_clrStaticBrush);
	m_clrMsgBoxesBrush=RGB(255,0,0); 
	m_hbrMsgBoxesBrush=CreateSolidBrush(m_clrButtonsBrush);
	m_clrMsgBoxesBack=RGB(255,0,0);
	m_clrMsgBoxesFront=RGB(255,255,255);
	m_clrEditBoxesBrush=RGB(255,0,0); 
	m_hbrEditBoxesBrush=CreateSolidBrush(m_clrButtonsBrush);
	m_clrEditBoxesBack=RGB(255,0,0);
	m_clrEditBoxesFront=RGB(255,255,255);
	m_clrScrollBarsBrush=RGB(255,0,0); 
	m_hbrScrollBarsBrush=CreateSolidBrush(m_clrButtonsBrush);
	m_clrScrollBarsBack=RGB(255,0,0);
	m_clrScrollBarsFront=RGB(255,255,255);
	m_clrListBoxesBrush=RGB(255,0,0); 
	m_hbrListBoxesBrush=CreateSolidBrush(m_clrButtonsBrush);
	m_clrListBoxesBack=RGB(255,0,0);
	m_clrListBoxesFront=RGB(255,255,255);
	return TRUE;
}

BEGIN_MESSAGE_MAP(YtvAlarmPropertySheet, CPropertySheet)
	//{{AFX_MSG_MAP(YtvAlarmPropertySheet)
	ON_WM_CTLCOLOR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// YtvAlarmPropertySheet message handlers

HBRUSH YtvAlarmPropertySheet::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
		switch(nCtlColor)
		{
		default:
			return CPropertySheet::OnCtlColor(pDC, pWnd, nCtlColor);
			
		case CTLCOLOR_BTN: //  Button control
            SetTextColor(pDC->m_hDC,m_clrButtonsFront);
			SetBkColor(pDC->m_hDC,m_clrButtonsBack); 
            return m_hbrButtonsBrush;
						            
        case CTLCOLOR_DLG://   Dialog box
            SetTextColor(pDC->m_hDC,m_clrDialFront);
			SetBkColor(pDC->m_hDC,m_clrDialBack); 
            return m_hbrDialBrush;               
case CTLCOLOR_EDIT://   Edit control
            SetTextColor(pDC->m_hDC,m_clrEditBoxesFront);
			SetBkColor(pDC->m_hDC,m_clrEditBoxesBack);  
            return m_hbrEditBoxesBrush;
case CTLCOLOR_LISTBOX://   List-box control
            SetTextColor(pDC->m_hDC,m_clrListBoxesFront);
			SetBkColor(pDC->m_hDC,m_clrListBoxesBack);  
            return m_hbrListBoxesBrush;
case CTLCOLOR_MSGBOX://   Message box
            SetTextColor(pDC->m_hDC,m_clrMsgBoxesFront);
			SetBkColor(pDC->m_hDC,m_clrMsgBoxesBack); 
			return m_hbrMsgBoxesBrush;
case CTLCOLOR_SCROLLBAR://   Scroll-bar control
            SetTextColor(pDC->m_hDC,m_clrScrollBarsFront);
			SetBkColor(pDC->m_hDC,m_clrScrollBarsBack);  
            return m_hbrScrollBarsBrush;
case CTLCOLOR_STATIC://   Static control 
            SetTextColor(pDC->m_hDC,m_clrStaticFront); 
            SetBkColor(pDC->m_hDC,m_clrStaticBack); 
            return m_hbrStaticBrush;
	}
	HBRUSH hbr = CPropertySheet::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	
	// TODO: Return a different brush if the default is not desired
	return hbr;
}
