#include "pch.h"
#include "GenericBkMFC.h"
#include "DlgBlendedButtonST.h"

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

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

	m_pIconsDLL = m_pIcons;
}

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

	DDX_Control(pDX, IDC_STCTITLE1, m_stcTitle1);
	DDX_Control(pDX, IDC_STCTITLE2, m_stcTitle2);
	DDX_Control(pDX, IDC_BUTTON7, m_btnButton1);
	DDX_Control(pDX, IDC_BUTTON8, m_btnButton2);
	DDX_Control(pDX, IDC_BUTTON9, m_btnButton3);
	DDX_Control(pDX, IDC_BUTTON10, m_btnButton4);
}

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

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

	// Create font
	m_fontTitle.CreateFont(-20, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, 0, 0, 0, 0, 0, _T("Verdana"));

	// Statics
	m_stcTitle1.SetFont(&m_fontTitle);
	m_stcTitle1.SetWindowText(_T("Normal CButtonST buttons"));
	m_stcTitle1.SetBackgroundColor(RGB(145, 156, 187), FALSE);
	m_stcTitle1.SetOpacityPercentage(50, FALSE);
	m_stcTitle1.DrawTransparent(FALSE);
	//
	m_stcTitle2.SetFont(&m_fontTitle);
	m_stcTitle2.SetWindowText(_T("CBlendedButtonST buttons"));
	m_stcTitle2.SetBackgroundColor(RGB(145, 156, 187), FALSE);
	m_stcTitle2.SetOpacityPercentage(50, FALSE);
	m_stcTitle2.DrawTransparent(FALSE);

	// Buttons
	m_btnButton1.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET04_OK, 48, 48));
	m_btnButton1.DrawTransparent();
	//
	m_btnButton2.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET04_CANCEL, 48, 48));
	m_btnButton2.DrawTransparent();
	//
	m_btnButton3.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET04_OK, 48, 48));
	m_btnButton3.SetBackgroundColor(RGB(69, 162, 54), FALSE);
	m_btnButton3.SetBorderColors(RGB(255, 255, 255), RGB(10, 36, 106), FALSE);
	m_btnButton3.SetOpacityPercentage(50, FALSE);
	m_btnButton3.DrawTransparent();
	//
	m_btnButton4.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET04_CANCEL, 48, 48));
	m_btnButton4.SetBackgroundColor(RGB(196, 60, 63), FALSE);
	m_btnButton4.SetBorderColors(RGB(255, 255, 255), RGB(10, 36, 106), FALSE);
	m_btnButton4.SetOpacityPercentage(50, FALSE);
	m_btnButton4.DrawTransparent();

	return TRUE;
} // End of OnInitDialog

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

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

void CDlgBlendedButtonST::OnPostEraseBkgnd(CDC* pDC)
{
	m_btnButton1.SetBk(pDC);
	m_btnButton2.SetBk(pDC);
	m_btnButton3.SetBk(pDC);
	m_btnButton4.SetBk(pDC);
	m_stcTitle1.SetBk(pDC);
	m_stcTitle2.SetBk(pDC);
} // End of OnPostEraseBkgnd
