#include "pch.h"
#include "GenericBkMFC.h"
#include "DlgStaticST.h"

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

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

	m_pIconsDLL = m_pIcons;
}

void CDlgStaticST::DoDataExchange(CDataExchange* pDX)
{
	CBkDialogST::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgStaticST)
		// 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(CDlgStaticST, CBkDialogST)
	//{{AFX_MSG_MAP(CDlgStaticST)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CDlgStaticST::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_SET03_STAR, 48, 48));
	m_stcLine1.DrawTransparent();
	//
	m_stcLine2.SetFont(&m_fntBold, FALSE);
	m_stcLine2.DrawTransparent();
	//
	m_stcLine3.SetFont(&m_fntBold, FALSE);
	m_stcLine3.SetTooltipText(_T("This is a CStaticST tooltip!"));
	m_stcLine3.SetColors(RGB(255, 255, 255), RGB(128, 0, 0));

	return TRUE;
} // End of OnInitDialog

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

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

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