CS-580H
Assignment # 1
Due Date: 9-22-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", "Size", "Orientation", "Clear", and "Quit". The first four of
these should be popup menus. When the user clicks "Drawing Function", a popup menu
with the items "Ellipse", "Sketch", "Polygon", and "Text" should appear. If the
user selects "Ellipse", an ellipse centered on the cursor position of each
subsequent left mouse button click should be drawn. 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 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 when that occurs.

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), "Solid" (solid-color). and "Transparent". 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.
In the case of "Transparent", anything underneath the interior of the object should
show through. (Hint: check out the online help on CreateHatchBrush() and on using
the stock NULL_BRUSH.) 

If the user selects the "Size" menu item, a popup menu with the items: "Big", "Medium", 
and "Small" should appear. Subsequently any ellipses should be drawn in a size 
commensurate with the last-chosen size. (You can decide for yourself on what "Big", 
"Medium", and "Small" mean.) When in sketching mode the current Size should determine 
the width of the line segments being drawn. "Small" might mean one-pixel wide lines, 
"Medium" 5 pixels, and "Big" 10 pixels. 

If the user selects the "Orientation" menu item, a popup menu with the items: "Wide", 
"Tall", and "Symmetric" should appear. If "Wide" is selected, any subsequent ellipse 
drawn should be about twice as wide as it is tall; if "Tall" is selected, the figure 
should be about twice as high as it is wide; if "Symmetric" is selected, any ellipse 
should be drawn as a circle.

The "Clear" and "Quit" menu items should work as in "winapp2".

For the menu choices: "Drawing Function", "Color", "Pattern", "Size", and 
"Orientation", some defaults should be in effect when the program starts. For example, 
the defaults could be "Sketch", "Black", "Solid", "Small". If the default drawing 
function is "Ellipse", a default orientation (e.g., "Symmetric") and pattern (e.g., 
"Solid") should also be set. 

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-580H", 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 CS-580H drop drawer in the filing cabinet
outside the Computer Science office if you don't submit it in class.)