#include "pch.h"
#include "GenericBkMFC.h"
#include "DlgBlendedStaticST.h"

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

CDlgBlendedStaticST::CDlgBlendedStaticST(CWnd* pParent, CResourceServerST*	m_pIcons)
	: CBkDialogST(CDlgBlendedStaticST::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgBlendedStaticST)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_pIconsDLL = m_pIcons;
}

void CDlgBlendedStaticST::DoDataExchange(CDataExchange* pDX)
{
	CBkDialogST::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgBlendedStaticST)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP

	DDX_Control(pDX, IDC_STCLINE1, m_stcLine1);
	DDX_Control(pDX, IDC_STCLINE2, m_stcLine2);
	DDX_Control(pDX, IDC_STCLINE3, m_stcLine3);
}

BEGIN_MESSAGE_MAP(CDlgBlendedStaticST, CBkDialogST)
	//{{AFX_MSG_MAP(CDlgBlendedStaticST)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CDlgBlendedStaticST::OnInitDialog() 
{
	CBkDialogST::OnInitDialog();
	
	//SetMode(BKDLGST_MODE_STRETCH, FALSE);
	SetBitmap(m_pIconsDLL->LoadBitmap(DLL_IDB_BACKGROUND14, LR_SHARED));

	// Bold font
	LOGFONT lf;
	::GetObject((HFONT)GetStockObject(DEFAULT_GUI_FONT), sizeof(lf), &lf);
	lf.lfWeight = FW_BOLD;
	m_fntBold.CreateFontIndirect(&lf);

	// Static
	m_stcLine1.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET04_ADD, 32, 32));
	m_stcLine1.SetTextColor(RGB(255, 255, 255), FALSE);
	m_stcLine1.SetBackgroundColor(RGB(69, 162, 54), FALSE);
	m_stcLine1.SetOpacityPercentage(50, FALSE);
	m_stcLine1.DrawTransparent();
	//
	m_stcLine2.SetFont(&m_fntBold, FALSE);
	m_stcLine2.SetBackgroundColor(RGB(255, 255, 255), FALSE);
	m_stcLine2.SetOpacityPercentage(30, FALSE);
	m_stcLine2.DrawTransparent();
	//
	m_stcLine3.SetFont(&m_fntBold, FALSE);
	m_stcLine3.SetTooltipText(_T("This is a CBlendedStaticST tooltip!"));
	m_stcLine3.SetTextColor(RGB(0, 0, 0));
	m_stcLine3.SetBackgroundColor(RGB(196, 60, 63), FALSE);
	m_stcLine3.SetOpacityPercentage(50, FALSE);
	m_stcLine3.DrawTransparent();

	return TRUE;
} // End of OnInitDialog

void CDlgBlendedStaticST::OnOK()
{
} // End of OnOK

void CDlgBlendedStaticST::OnCancel()
{
} // End of OnCancel

void CDlgBlendedStaticST::OnPostEraseBkgnd(CDC* pDC)
{
	m_stcLine1.SetBk(pDC);
	m_stcLine2.SetBk(pDC);
	m_stcLine3.SetBk(pDC);
} // End of OnPostEraseBkgnd
