Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Visual C++ and MFC Fundamentals Chapter 20: List-Based Controls


InvalidateRect(&PictArea);

CButton *rdoThree;

rdoThree = reinterpret_cast<CButton *>(GetDlgItem(IDC_SCOOPS_THREE));
rdoThree->EnableWindow(FALSE);

// Check whether it is checked
int CheckedButton = rdoThree->GetCheck();

// If it is checked
if( CheckedButton == 1 ) // then select the One radio button
CheckRadioButton(IDC_SCOOPS, IDC_SCOOPS_THREE, IDC_SCOOPS);

ProcessOrder();
}

void CIceScreamOrderDlg::OnBnClickedRdoCone()
{
// TODO: Add your control notification handler code here
// The second radio button was selected
Selected = 1;
// Let the UpdatePicture() method change the picture

CRect PictArea;
m_Picture.GetWindowRect(&PictArea);
InvalidateRect(&PictArea);

CButton *rdoThree;

rdoThree = reinterpret_cast<CButton *>(GetDlgItem(IDC_SCOOPS_THREE));
rdoThree->EnableWindow(FALSE);

// Check whether it is checked
int CheckedButton = rdoThree->GetCheck();

// If it is checked
if( CheckedButton == 1 ) // then select the One radio button
CheckRadioButton(IDC_SCOOPS, IDC_SCOOPS_THREE, IDC_SCOOPS);

ProcessOrder();
}

void CIceScreamOrderDlg::OnBnClickedRdoBowl()
{
// TODO: Add your control notification handler code here
// The third radio button was selected
Selected = 2;

CRect PictArea;
m_Picture.GetWindowRect(&PictArea);
InvalidateRect(&PictArea);

CButton *rdoThree;

// Get a handle to the Three radio button
rdoThree = reinterpret_cast<CButton *>(GetDlgItem(IDC_SCOOPS_THREE));
Free download pdf