// PrjColorLegendDlg.cpp : implementation file
//

#include "stdafx.h"
#include "PrjColorLegendDlg.h"
#include "aplProjectMgr.h"


// CPrjColorLegendDlg dialog

IMPLEMENT_DYNAMIC(CPrjColorLegendDlg, CaplTranslateDialog)

CPrjColorLegendDlg::CPrjColorLegendDlg(CWnd* pParent /*=NULL*/)
	: CaplTranslateDialog(CPrjColorLegendDlg::IDD, pParent)
{

}

CPrjColorLegendDlg::~CPrjColorLegendDlg()
{
}

void CPrjColorLegendDlg::DoDataExchange(CDataExchange* pDX)
{
	CaplTranslateDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_STATIC_DEFAULT, m_st_default);
	DDX_Control(pDX, IDC_STATIC_POFIG, m_st_pofig);
	DDX_Control(pDX, IDC_STATIC_ENDET, m_st_endet);
	DDX_Control(pDX, IDC_STATIC_NOTSTART_OVERDUE, m_st_nostart_overdue);
	DDX_Control(pDX, IDC_STATIC_NOTSTART_NOOVERDUE, m_st_nostart_nooverdue);
	DDX_Control(pDX, IDC_STATIC_WORK_OVERDUE, m_st_work_overdue);
	DDX_Control(pDX, IDC_STATIC_WORK_GOOD_PROGN, m_st_work_good_progn);
	DDX_Control(pDX, IDC_STATIC_WORK_BAD_PROGN, m_st_work_bad_progn);

	DDX_Control(pDX, IDC_STATIC_DEFAULT2, m_st_default2);
	DDX_Control(pDX, IDC_STATIC_POFIG2, m_st_pofig2);
	DDX_Control(pDX, IDC_STATIC_ENDET2, m_st_endet2);
	DDX_Control(pDX, IDC_STATIC_NOTSTART_OVERDUE2, m_st_nostart_overdue2);
	DDX_Control(pDX, IDC_STATIC_NOTSTART_NOOVERDUE2, m_st_nostart_nooverdue2);
	DDX_Control(pDX, IDC_STATIC_WORK_OVERDUE2, m_st_work_overdue2);
	DDX_Control(pDX, IDC_STATIC_WORK_GOOD_PROGN2, m_st_work_good_progn2);
	DDX_Control(pDX, IDC_STATIC_WORK_BAD_PROGN2, m_st_work_bad_progn2);
}


BEGIN_MESSAGE_MAP(CPrjColorLegendDlg, CaplTranslateDialog)

END_MESSAGE_MAP()


// CPrjColorLegendDlg message handlers

COLORREF convert(COLORREF color)
{
	return aplColor_GetHilightColor(color,60);
}

BOOL CPrjColorLegendDlg::OnInitDialog()
{
	CaplTranslateDialog::OnInitDialog();

	m_st_default2.SetBackgroundColor(CaplProjectManager::RGB_DEFAULT);
	m_st_pofig2.SetBackgroundColor(CaplProjectManager::RGB_POFIG);
	m_st_endet2.SetBackgroundColor(CaplProjectManager::RGB_ENDED);
	m_st_nostart_overdue2.SetBackgroundColor(CaplProjectManager::RGB_NOTSTART_OVERDUE);
	m_st_nostart_nooverdue2.SetBackgroundColor(CaplProjectManager::RGB_NOTSTART_NO_OVERDUE);
	m_st_work_good_progn2.SetBackgroundColor(CaplProjectManager::RGB_WORK_GOOD_PROGN);
	m_st_work_bad_progn2.SetBackgroundColor(CaplProjectManager::RGB_WORK_BAD_PROGN);
	m_st_work_overdue2.SetBackgroundColor(CaplProjectManager::RGB_WORK_OVERDUE);
	
	m_st_default.SetBackgroundColor(convert(CaplProjectManager::RGB_DEFAULT));
	m_st_pofig.SetBackgroundColor(convert(CaplProjectManager::RGB_POFIG));
	m_st_endet.SetBackgroundColor(convert(CaplProjectManager::RGB_ENDED));
	m_st_nostart_overdue.SetBackgroundColor(convert(CaplProjectManager::RGB_NOTSTART_OVERDUE));
	m_st_nostart_nooverdue.SetBackgroundColor(convert(CaplProjectManager::RGB_NOTSTART_NO_OVERDUE));
	m_st_work_good_progn.SetBackgroundColor(convert(CaplProjectManager::RGB_WORK_GOOD_PROGN));
	m_st_work_bad_progn.SetBackgroundColor(convert(CaplProjectManager::RGB_WORK_BAD_PROGN));
	m_st_work_overdue.SetBackgroundColor(convert(CaplProjectManager::RGB_WORK_OVERDUE));


	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

