#include "pch.h"
#include "GenericBkMFC.h"
#include "DlgShowSelected.h"

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

CDlgShowSelected::CDlgShowSelected(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgShowSelected::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgShowSelected)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_nIndex = LB_ERR;
	m_crColor = RGB(0, 0, 0);
}


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

	DDX_Control(pDX, IDOK, m_btnOk);
	DDX_Control(pDX, IDC_COLOR, m_btnColor);
}

BEGIN_MESSAGE_MAP(CDlgShowSelected, CDialog)
	//{{AFX_MSG_MAP(CDlgShowSelected)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CDlgShowSelected::OnInitDialog() 
{
	TCHAR		szTemp[256];

	CDialog::OnInitDialog();

	// Button Ok
	m_btnOk.SetThemeHelper(&m_Theme);
	m_btnOk.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET03_CANCEL, 32, 32));

	// Button color
	m_btnColor.SetWindowText(m_sText);
	m_btnColor.DrawBorder(FALSE, FALSE);
	m_btnColor.SetColor(CButtonST::BTNST_COLOR_BK_IN, m_crColor);
	m_btnColor.SetColor(CButtonST::BTNST_COLOR_BK_OUT, m_crColor);
	m_btnColor.SetColor(CButtonST::BTNST_COLOR_BK_FOCUS, m_crColor);

	// Static text
	::wsprintf(szTemp, _T("You have double-clicked item n. %d"), m_nIndex);
	SetDlgItemText(IDC_STCTEXT, szTemp);

	return TRUE;
} // End of OnInitDialog

BOOL CDlgShowSelected::SetProperties(int nIndex, LPCTSTR lpszText, COLORREF crColor, CResourceServerST* m_pIcons)
{
	m_nIndex = nIndex;
	m_crColor = crColor;
	m_sText = lpszText;
	m_pIconsDLL = m_pIcons;

	return TRUE;
} // End of SetProperties
