// DlgProgressBar.cpp : _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

#include "stdafx.h"
#include "DynamicDraw.h"
#include "UtilGraph.h"		// For OptiColor.
#include "DlgProgressBar.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProgressBar _xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_

CFCDlgProgressBar::CFCDlgProgressBar (CWnd* pParent /*=NULL*/)
	: BASE_CLASS(CFCDlgProgressBar::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFCDlgProgressBar)
		// _xZkqqHx_iDiBiDiC_xHqqkZx_ - ClassWizard _xZkqqHx_iCmNiClBiCmMiImKjChFiCmJiDhNiDgCiDhDiDjDiDePjHhAiCmMiDhNiDeOiDiNiCpAjCmHiJmBiCnMiClNiCmNiNoNiPjMiClFiCnMiClHiBeC_xHqqkZx_
	//}}AFX_DATA_INIT

	// _xZkqqHx_iDiGiBfLiDfFjFmPjAjEiCpAiPiJiKpKiJlLiBeC_xHqqkZx_
	m_dProgressValue = 0.0;
	// _xZkqqHx_iDiGiBfLiDfFiBfLjHhGiLiBiBeC_xHqqkZx_
	m_eRequest = NONE;
} // CFCDlgProgressBar::CFCDlgProgressBar.

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProgressBar _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProgressBar::GetProgressValue
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAgJjClLjCgMiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAgJjClLjCgMiBeC_xHqqkZx_0.0_xZkqqHx_iBgA_xHqqkZx_1.0_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.11.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
double CFCDlgProgressBar::GetProgressValue () const
{
	return m_dProgressValue;
} // CFCDlgProgressBar::GetProgressValue.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProgressBar::SetProgressValue
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAgJjClLjCgMiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dValue	:_xZkqqHx_jAgJjClLjCgMiCpAjAnNjCoIiBeC_xHqqkZx_0.0_xZkqqHx_iBgA_xHqqkZx_1.0_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiGiBfLiDfFiBfLjHhGiLiBiBeCjHoBiBeGjCiGiOhOiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiPoKiNiHiCmN_xHqqkZx_ STOP_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDeFiDeCiDjDiDgIiDeFjFfMiOkGiOjOiCmNiBeBiNmEjFgAiJoGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.11.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCDlgProgressBar::Request CFCDlgProgressBar::SetProgressValue (double dValue)
{
	m_dProgressValue = dValue;
	m_stcProgressBar.SetProgressValue(m_dProgressValue);
	// WM_PAINT _xZkqqHx_iCpAiDgGiDeCiDfIiDhAiDgCiDgAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
	return DispatchRedraw();
} // CFCDlgProgressBar::SetProgressValue.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProgressBar::DispatchRedraw
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	WM_PAINT _xZkqqHx_iCpAiDgGiDeCiDfIiDhAiDgCiDgAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiGiBfLiDfFiBfLjHhGiLiBiBeCjHoBiBeGjCiGiOhOiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiPoKiNiHiCmN_xHqqkZx_ STOP_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.12.08 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
CFCDlgProgressBar::Request CFCDlgProgressBar::DispatchRedraw ()
{
	if (IsWindowVisible())
	//----- _xZkqqHx_iDeFiDeCiDjDiDgIiDeFjFfMiOkGjCiGiCmMiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iNmEjFgAiJoGiDiBiDgCiDfKiBfLiDfHiCpAiPiIjHjNiClHiCoJiBeC_xHqqkZx_
		// _xZkqqHx_iClBiCoKiCmJiCoGiCmBiCmEiBeBjGhLjBmMiCmMjBiAiNoMiCpAiLnGiOhOiClFiBeBiCmIiCkIiCkJiCmC_xHqqkZx_
		// _xZkqqHx_iDhEiDeAiDeDiDiLiPiIjHjNjCiGiCmFiCoAiNmEjFgAiJoGiCkKiClDiCoKiCoJiCoGiCkEiCmJiCmIiCoJiBeC_xHqqkZx_
		MSG msg;
		while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
			// _xZkqqHx_iDhNiDeFiDfIiNlGiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiPoKiNiHiBeBjCiGiOhOiDhLiDfOiDjDiCmMiPoDiCmF_xHqqkZx_
			// _xZkqqHx_iCmMiCnNiPiIjHjNiCpAiClHiCoJiBeC_xHqqkZx_
			// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeBiNlGiDhLiDfOiDjDiChEiCgPiCmNiBeBjCiGiOhOiDhLiDfOiDjDiImIiKePiCmF_xHqqkZx_
			// _xZkqqHx_jEkNjAlGiClHiCoJiDfAiBfLiDfIiCoAjFnPiCoHiCkGiCoJjFeLjHhGiCkKiCkAiCoJiCmMiCmFiBeBjGlDiPpAiMiPiCmJiPiIjHjNiBeC_xHqqkZx_
			// _xZkqqHx_iNlGiDhLiDfOiDjDiCpAiJjPiClHiDfAiBfLiDfIiCpAiMmAjCoIiClFiCmEiCkAiCoJiCmMiCmFiOmAiKfBiCmNjGlDiCkCiBeC_xHqqkZx_
			switch (msg.message)
			{
			case WM_PAINT:			// _xZkqqHx_iNmEjFgAiJoGiDiBiDgCiDfKiBfLiDfHiBeC_xHqqkZx_
			case WM_MOUSEMOVE:		// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
			case WM_LBUTTONUP:		// _xZkqqHx_iDhNiDeFiDfIiNlGiDhLiDfOiDjDiChEiCgPiBeC_xHqqkZx_
				TranslateMessage(&msg);
				DispatchMessage(&msg);
				break;
			case WM_LBUTTONDOWN:	// _xZkqqHx_iDhNiDeFiDfIiNlGiDhLiDfOiDjDiCgDiCgOiChGiCgNiBeC_xHqqkZx_
				if (msg.hwnd == GetDlgItem(IDC_PBR_BTN_STOP)->m_hWnd)
				//----- _xZkqqHx_jCiGiOhOiDhLiDfOiDjDiCmMiPoDiCmFiJjPiClDiCoKiClNiPoKiNiH_xHqqkZx_ -----
				{
					TranslateMessage(&msg);
					DispatchMessage(&msg);
				}
				break;
			}
		}
	}
	return m_eRequest;
} // CFCDlgProgressBar::DispatchRedraw.

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProgressBar _xZkqqHx_iDiBiDgCiDfKiBfLiDfHiPiIjHjNiBeC_xHqqkZx_

void CFCDlgProgressBar::DoDataExchange(CDataExchange* pDX)
{
	BASE_CLASS::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFCDlgProgressBar)
	DDX_Control(pDX, IDC_PBR_STC_PROGRESS_BAR, m_stcProgressBar);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CFCDlgProgressBar, BASE_CLASS)
	//{{AFX_MSG_MAP(CFCDlgProgressBar)
	ON_BN_CLICKED(IDC_PBR_BTN_STOP, OnPbrBtnStop)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFCDlgProgressBar _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiJ_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProgressBar::OnInitDialog
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfPiDeDiDeBiDiNiDePiPiJiKpKiJlLiOjOiCmJiOmAiNhDiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	04.11.25 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL CFCDlgProgressBar::OnInitDialog ()
{
	// Superclass_xZkqqHx_iKnGjAjEiBeC_xHqqkZx_
	BASE_CLASS::OnInitDialog();

	// _xZkqqHx_iDhGiDiNiDePiDiMiDfIiDgPiBfLiDfCiDjDiDgHiDiNiBfLiDiLiCpAiPiJiKpKiJlLiBeC_xHqqkZx_
	m_stcProgressBar.Initialize(::OptiColor(FD_COLREF_MIDNIGHT_BLUE), ::OptiColor(FD_COLREF_BLUE), m_dProgressValue);
	// _xZkqqHx_iDiGiBfLiDfFiBfLjHhGiLiBiBeC_xHqqkZx_
	m_eRequest = NONE;

	return TRUE;  // _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiCmJiDhEiDeIiBfLiDeKiDfIiCpAjAnNjCoIiClFiCmIiCkCiCmGiCkLiBeBjGnPiCoIjCgMiCmN_xHqqkZx_ TRUE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
	              // _xZkqqHx_jHoBiKeP_xHqqkZx_: OCX _xZkqqHx_iDhGiDiNiDhAiDgFiDeC_xHqqkZx_ _xZkqqHx_iDhJiBfLiDfHiCmMjGnPiCoIjCgMiCmN_xHqqkZx_ FALSE _xZkqqHx_iCmGiCmIiCoIiCnMiClH_xHqqkZx_
} // CFCDlgProgressBar::OnInitDialog.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CFCDlgProgressBar::OnPbrBtnStop
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jCiGiOhOiDhLiDfOiDjDiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.04.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CFCDlgProgressBar::OnPbrBtnStop ()
{
	// _xZkqqHx_iDiGiBfLiDfFiBfLjHhGiLiBiBeC_xHqqkZx_
	m_eRequest = STOP;
} // CFCDlgProgressBar::OnPbrBtnStop.
