Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

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


{
// TODO: Add your control notification handler code here
// The first radio button was selected
Selected = 0;

// Get the rectangle that holds the picture
CRect PictArea;
m_Picture.GetWindowRect(&PictArea);
// Repaint the picture
InvalidateRect(&PictArea);
}

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

// Get the rectangle that holds the picture
CRect PictArea;
m_Picture.GetWindowRect(&PictArea);
// Repaint the picture
InvalidateRect(&PictArea);
}

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

// Get the rectangle that holds the picture
CRect PictArea;
m_Picture.GetWindowRect(&PictArea);
// Repaint the picture
InvalidateRect(&PictArea);
}


  1. Execute the application and test the Container radio buttons

  2. To process an order, add a new Member Function to the CIceScreamOrderDlg
    class. Set its type as void and its name as ProcessOrder

  3. Implement the method as follows:


// This is the central function that the other controls will refer to
Free download pdf