khanat-code-old/code/nel/tools/misc/data_mirror/progress_dialog.cpp
StudioEtrange 91e6b23d3f ** PCH Support for NMake with VS2012
NMAKE-VS2012 Error LNK2011
while NMAKE-VS2010 does not complain
we need to link the pch.obj file
see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx

** PCH Support for Ninja
Ninja need to add property
        OBJECT_DEPENDS for using PCH
        OBJECT_OUTPUTS for create PCH
see http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
2013-09-05 17:18:01 +02:00

60 lines
1.3 KiB
C++

// progress_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "data_mirror.h"
#include "progress_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CProgressDialog dialog
#define BAR_MAX 1000
CProgressDialog::CProgressDialog(CWnd* pParent /*=NULL*/)
: CDialog(CProgressDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CProgressDialog)
Text = _T("");
//}}AFX_DATA_INIT
}
void CProgressDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProgressDialog)
DDX_Control(pDX, IDC_PROGRESS, Bar);
DDX_Text(pDX, IDC_TEXT, Text);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProgressDialog, CDialog)
//{{AFX_MSG_MAP(CProgressDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CProgressDialog message handlers
void CProgressDialog::progress (float progressValue)
{
UpdateData ();
float value = getCropedValue (progressValue);
Text = DisplayString.c_str ();
Bar.SetPos ((uint) (value * (float)BAR_MAX));
UpdateData (FALSE);
}
BOOL CProgressDialog::OnInitDialog()
{
CDialog::OnInitDialog();
Bar.SetRange (0, BAR_MAX);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}