CS-360
Assignment # 1
Due Date: 9-23-09

Use Visual Studio .NET to create a new Visual C++, Win32 API application that 
performs the tasks listed below. It is suggested that you follow the procedure that 
is given in the last five slides of the "Win32 API Programming" notes at:
http://www.cs.binghamton.edu/~reckert/360/2_f09_win32api.pdf. It will be easiest 
if you begin with the "winapp2" example program discussed in class
(http://www.cs.binghamton.edu/~reckert/360/winapp2-cc-vs2008.html) and modify it 
so that it does all of the following:

Specifically the menu bar should contain the following items: "Drawing Function", 
"Color", "Pattern", "Clear", and "Quit". The first three of these should be popup
menus. When the user clicks "Drawing Function", a popup menu with the items "Sketch",
"Polygon", and "Text" should appear. Selecting "Sketch" should put the program into
a mode in which the user can start sketching when the left mouse button goes down and
stop sketching when it is released. In this mode each time the mouse moves with the
mouse button down, a line segment should be drawn that connects the current location
of the mouse cursor with the point it was at the last time the mouse moved. The
cumulative effect will be to draw a continuous trace of line segments that follows
the motion of the mouse. If the user selects "Polygon", subsequent left mouse button
clicks should identify each new vertex of the polygon to be drawn. A right mouse
button click should provide the last vertex of the polygon, and it should then be
drawn. (You may assume that a polylgon will never have more than 100 vertices.) If
the user selects "Text", any text that was entered into a single line edit control
positioned in the lower righthand corner of the window's client area should appear in
a static control positioned above the edit control. Both the edit control and the
static control should appear when the window first opens. There should be some default
text in the edit control.

If the user selects the "Color" menu item, a popup menu with the items: "Red", 
"Green", "Blue", "Yellow", "Magenta", "Cyan", and "Black" should appear. Selecting 
any of these should change the drawing color to the color selected so that any
subsequent ellipses, sketches, and polygons will be drawn with a pen of that color.

If the user selects the "Pattern" menu item, a popup menu should appear with the 
items: "LR Down Hatch" (45-degree downward left-to-right hatch), "LR Up Hatch" 
(45-degree upward left-to-right hatch), "HV Cross" (Horizontal and vertical 
crosshatch), "Diagonal Cross" (45-degree crosshatch), "Horizontal" (horizontal 
lines), "Vertical" (vertical lines), and "Solid" (solid-color). In each case, after 
the user has selected a "Pattern", all subsequent ellipses, and polygons should  be 
filled with the chosen pattern, using the current drawing color. (Hint: check out the
online help on CreateHatchBrush(). The "Clear" and "Quit" menu items should work as
in "winapp2".

For the menu choices: "Drawing Function", "Color", and "Pattern", , some defaults
should be in effect when the program starts. For example, the defaults could be "Sketch",
"Black", "Solid".

The window produced by your program should have a title (e.g., "This program was 
written by xxx", where xxx is your name) and an icon that you design with the Visual 
Studio Icon Editor.

Submitting your programs:

You should copy the main directory of your program to a CD-ROM. You should print out
the .cc (.cpp) file for the program. Place the CD-ROM along with your program printout
in an envelope. Be sure to write your name, "CS-360", and the assignment number
(Number 1 in this case) on the outside of the envelope. Submit the envelope on or
before the due date. (You can place it in the appropriate CS-360 drop drawer in the filing
cabinet outside the Computer Science office if you don't submit it in class.)