Menus

  1. Create an MFC project.
  2. Add a Draw Menu with the following items:
    1. Sine
    2. Cosine
    3. Clear
  3. Add an event handler for each item.
  4. The following code can easily erase the current window:
    
    InvalidateRect(NULL,TRUE) ;
    GetParent()->PostMessage(WM_PAINT);   // redraws the entire client area
    
    
  5. Sin() and Cos() can be drawn by MoveTo() and LineTo().
  6. Move the Draw Menu between the View Menu and the Window Menu.
  7. The texts "X", "Y", and "O" are drawn by TextOut(), but you may skip that part at this moment.
Menu items sin cos