Windows Systems Programming: Spring 2002

[ Home | Syllabus | Course Notes | Assignments | Search]


Assignment 2: Dialog Box

Description: This program will allow the user to display shapes with text inside, delete those shapes or move any rectangle to a new location on the screen. To create or delete a shape, the user makes a selection in a menu containing the following menu items:

  1. "new" menu item,  when selected a dialog box will appear with the following features:

    1. A set of radio buttons for the color of the rectangle (red/green/blue)

    2. A set of radio buttons for the shape (rectangle, ellipse, line)

    3. A text box for entering a label with the shape

    4. A check box which if checked will change border of the shape to a dashed line

    Selecting "OK" for the dialog box will create a new item with the selected features. The shape label will be displayed inside the rectangle or ellipse and underneath the line.

  2. "delete" menu item. when selected the next shape the user clicks on will be selected for deletion. However the program ask the user to confirm that the shape is to be deleted displaying  the text associated with the selected shape. If the user confirms the deletion, the shape and its associated text are deleted.

In addition to the above actions, the user can  move a shape, the used first selects which shape to move (no menu item is needed), then selects its new destination. The shape and its text will be moved to the new location.

Due: Feb. 23rd midnight

FUNCTIONAL REQUIREMENTS:

  1. The size of shapes will be 10% of the size of the main window.
  2. When necessary, your program must be able to redraw itself correctly.
  3. The delete menu item will be disabled if there are no objects to delete. 

IMPLEMENTATION REQUIREMENTS:

  1. You must use MFC objects for the window and application and must use the message handling architecture of MFC.
  2. The main window must be derived from CFrameWnd.
  3. The dialog box should be derived from CDialog.
  4. You should demonstrate object oriented design in your solution.

Copyright chris wild 1999-2002.
For problems or questions regarding this web contact [Dr. Wild].
Last updated: February 10, 2002.