Course list http://www.c-jump.com/bcc/
This project is Part II of the Lab 30. We add the logic to animate the progress bar according to the timer event notifications:
The prototype for this project is Lab 30, the window with a progress bar and a button:
c255labs\labs\c255_lab30_timer
Make a copy of Lab 30 subfolder, or download and unzip c255_lab30_timer.zip
Rename the new folder as c255_lab31_progress.
Open solution file in Visual Studio and finish the usual steps to rename the project.
Download the new versions of
Compile and test the program.
Open CMainWindow.h in the text editor and examine the code:
The progress bar label needs text, whereas our calculations use integer numbers. To convert numbers to text we use the standard library string and string stream:
#include <string> #include <sstream>
The class also has new CMainWindow::progress_label string, which stores the text label for the progress bar widget.
Open CMainWindow.cpp in the text editor and examine the code:
CMainWindow::show() hides the progress bar widget. When the application starts, only the "Animate" button is shown on the screen. The progress bar is configured for its range and component colors.
CMainWindow::callback_btn_animate() is invoked by the "Animate" button. The function resets the initial progress bar label and numeric value to zero.
CMainWindow::animate() updates the progress bar label and computes the value according to the m_progress_count value.
This is a self-learning lab. There are no files to submit. Make sure to complete all required steps to build and test the project on your own home computer.