Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// In the progress bar object, initialize the "upper limit" value
// and the "step" value.
void CProgress::SetParameters(int iUpperLimit)
{
m_iCurrentPosition = 0;
m_iUpperLimit = iUpperLimit;
if (iUpperLimit >= 100) {
m_iStep = (int)(iUpperLimit * .01 + .5);
}
else {
m_iStep = 1;
}
m_SaveProgress.SetPos(0);
m_SaveProgress.SetStep(m_iStep);
m_SaveProgress.SetRange32(0, iUpperLimit);
}
// within the work loop in your main code, call the increment function each time.
void CProgress::Increment()
{
m_iCurrentPosition++;
// only update the progress bar display at "step" value increments
// or when the upper limit is reached
if ((m_iCurrentPosition % m_iStep == 0) || (m_iCurrentPosition >= m_iUpperLimit)) {
m_SaveProgress.StepIt();
int iProgress = (m_SaveProgress.GetPos() * 100) / m_iUpperLimit;
CString sText;
sText.Format("%3i", iProgress);
m_SaveText.SetWindowText(sText);
}
}
// hope this helps!