#include "pch.h"
#include "GenericBkMFC.h"
#include "DlgProgressCtrlST.h"

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

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

	m_pIconsDLL = m_pIcons;
}

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

	DDX_Control(pDX, IDC_CFS, m_progressCFS);
	DDX_Control(pDX, IDC_TILED, m_progressTiled);
	DDX_Control(pDX, IDC_VERTICAL, m_progressVertical);
	DDX_Control(pDX, IDC_STANDARD, m_progressStandard);

	DDX_Control(pDX, IDC_BTNSTEP, m_btnStep);
}

BEGIN_MESSAGE_MAP(CDlgProgressCtrlST, CDialog)
	//{{AFX_MSG_MAP(CDlgProgressCtrlST)
	ON_BN_CLICKED(IDC_BTNSTEP, OnBtnStep)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BOOL CDlgProgressCtrlST::OnInitDialog() 
{
	CDialog::OnInitDialog();

	// Create progress bar like Microsoft's Combat Flight Simulator
	m_progressCFS.SetBitmap(IDB_CFS);
	m_progressCFS.SetRange32(0, 1000);
	m_progressCFS.SetStep(50);
	m_progressCFS.SetPos(200);
	// Tiled
	m_progressTiled.SetBitmap(IDB_TILE);
	m_progressTiled.SetRange32(-1000, 1000);
	m_progressTiled.SetStep(100);
	// Vertical
	m_progressVertical.SetBitmap(IDB_AQUARIUM);
	m_progressVertical.SetRange32(-1000, 1000);
	m_progressVertical.SetStep(50);

	// Button Step-it
	m_btnStep.SetThemeHelper(&m_Theme);
	m_btnStep.SetIcon(m_pIconsDLL->LoadIcon(DLL_IDI_SET04_RIGHT, 32, 32));
	m_btnStep.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, 30);
	m_btnStep.SetTooltipText(_T("Step progress bars"));
	//m_btnStep.SetAutofire(TRUE);

	return TRUE;
} // End of OnInitDialog

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

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

void CDlgProgressCtrlST::OnBtnStep()
{
	m_progressCFS.StepIt();
	m_progressTiled.StepIt();
	m_progressVertical.StepIt();
	m_progressStandard.StepIt();
} // End of OnBtnStep
