Chapter 18: Progress-Based Controls Visual C++ and MFC Fundamentals
Static Text IDC_VAL_LIVER 000 Center m_ValLiver
Static Text IDC_VAL_BLADDER 000 Center m_ValBladder
Static Text IDC_VAL_STOMACH 000 Center m_ValStomach
ProgressBar IDC_PRGR_BLOOD m_Blood
ProgressBar IDC_PRGR_HEART m_Heart
ProgressBar IDC_PRGR_KIDNEY m_Kidney
ProgressBar IDC_PRGR_BRAIN m_Brain
ProgressBar IDC_PRGR_LLUNG m_LLung
ProgressBar IDC_PRGR_RLUNG m_RLung
ProgressBar IDC_PRGR_PANCREAS m_Pancreas
ProgressBar IDC_PRGR_LIVER m_Liver
ProgressBar IDC_PRGR_BLADDER m_Bladder
ProgressBar IDC_PRGR_STOMACH m_Stomach
- Using the Resource Symbols dialog box, add ten new identifiers as IDT_BLOOD,
IDT_HEART, IDT_KIDNEY, IDT_BRAIN, IDT_LLUNG, IDT_RLUNG,
IDT_PANCREAS, IDT_LIVER, IDT_BLADDER, and IDT_STOMACH - In the OnInitDialog() event of the dialog class, create the following timers and
generate a random seed:
BOOL CBodyMonitorDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
SetTimer(IDT_BLOOD, 650, NULL);
SetTimer(IDT_HEART, 200, NULL);
SetTimer(IDT_KIDNEY, 450, NULL);
SetTimer(IDT_BRAIN, 1000, NULL);
SetTimer(IDT_LLUNG, 750, NULL);