Windows Systems Programming: Spring 2002

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


Assignment 1: Display Shapes

Description: This program will display different shapes depending on various mouse and keyboard events. Whenever the right mouse button is clicked down, the program will display a rectangle at that point on the screen. Whenever the left mouse button is clicked down, the program will display an ellipse at that point on the screen. Key presses will be handled as follows:

Key Pressed Effect to be seen
small letters ('a' to 'z') Color inside the rectangles will be set to red.
Capitol letters ('A' to 'Z') Color inside the ellipses will be set to blue
digit from '1' to '5'  Color inside the rectangle will be set to green
digit from '6' to '9' Color inside the ellipses will be set to yellow
exclamation point ('!') Color inside all objects will be set randomly

Due: Feb. 6

FUNCTIONAL REQUIREMENTS:

  1. The size of rectangles and ellipses will be 10% of the size of the main window.
  2. When necessary, your program must be able to redraw itself correctly. The color of each object must be maintained.
  3. The initial color inside the objects will be gray. ( This and the previous requirement mean that it is possible to have both gray and red rectangles displayed on the same time.) 

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. 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: January 27, 2002.