CS151 HW#12

Tara Davidson and Alyssa Belisle

Write up:

  1. A brief description of the task (in your own words): In this project we created a program similar to a paint program. We created a graphical user interface that has five fixed menus on the top of the screen that allows the user to: create a new canvas, save their work, open existing work, quit out of the program, undo the last action, use a crayon style, use the default style, change the color to blue or green or yellow or red, change the width of the line to 1 or 2 or 3 or 4 or 5, and change the fill color of default circles and rectangles to Royal Blue, Fire Red, Sun Yellow, or Grass Green. We also created a pop-up menu which allows the user to select an object they'd like to put on their scene. In our pop-up menu we allow our user to choose to create a circle, rectangle, line or tree. We incorporated user input for the radius of a circle, and points where they want their objects drawn.
  2. Provide a brief manual for your program, including how to run it and use it. Click a fixed menu or anywhere in the screen to bring up the pop-up menu. If you clicked the File menu, click New to clear and create a new, blank canvas. Click Open to open existing artwork. Click Quit to close the program. Click Save to save your artwork. If you clicked the Edit menu, click Undo to erase the most recent object drawn. If you clicked the Style menu, click Crayon if you would like to implement a crayon effect with your artwork. Click default to draw regularly. If you clicked Outline color, click the color you would like your objects drawn in. If you clicked Width Size, click the size of the stroke for your artwork. If you clicked Fill Color, click the color you would like to fill your default rectangles and circles with. If you clicked a fixed menu, but don't want to do any of the offered operations, simply click the menu box to close the drop down options. If you clicked anywhere in the screen (not in a fixed menu) a pop-up menu will show up at your mouse click. Click Line if you would like to draw a line. The program will ask you to click two endpoints for your line, click any two points in the scene. Click Rectangle if you would like to draw a rectangle. The program will ask you for your upper left corner of your rectangle and your lower right corner for your rectangle, click points accordingly to the rectangle you would like to draw. Click Circle if you would like to draw a circle. The program will ask you for an integer radius so type in an integer for your circle's radius. Press ENTER. Then the program will ask you to click a point for the center of your circle so click anywhere in the screen to draw your circle.
  3. Explain your main interaction loop. We created our main interaction loop, def mainLoop(self) in application.py. Our main interaction loop starts by setting Done to False and implementing a while not Done loop. While not done, the main interaction loop gets a mouse click. We use a for loop to loop over the list of fixed menus. If the click is in a fixed menu and the tuple returns a value of -1, then the program does the appropriate fixed menu action. Else it breaks out of the loop if the fixed menu is clicked but no selection is made. If the click returns a tuple value of -2, then the click is outside of the fixed menus and the pop-up menu is called. If another selection is made from the pop-up menu, then the program does the appropriate pop-up menu action.
  4. Create an interesting scene using your program:

  5. Have a friend who is not in the class create a scene using your program. Include the image (with their permission). We got Shannon's permission:

  6. Briefly describe your friend's experience with your program. We got our friend Shannon to make the scene above and she had so much fun! She found the program easy to use after just a few instructions from us. She had difficulty filling shapes with colors and making circles with appropriate radii because she had little knowledge of pixels and how long the radius should be. She thought it would have been cool to be able to create squiggly lines in her scene.
  7. A description of and pictures for any extensions you did. Our extensions include creating more fixed menus as well as creating a background color for the canvas. Our new fixed menus were created the same way as the required fixed menus except now there are menus for File, Width Size, and Fill Color for Default Styled Shapes. The user can set the width from 1-5 and can set the fill of default circles and rectangles to Royal Blue, Fire Red, Sun Yellow or Grass Green. In our File menu we created operations for New, Open, Save, and Quit (better explained in our program manual above). We demonstrated our extensions in our scenes (above).
  8. If you worked with a partner, indicate what each person did as part of the project. We combined successful aspects from our fixed menu and menu classes from lab. We worked together collaboratively to create our application.py and our main.py files. We both spent the same amount of time on this project. The majority of the time we worked in the Olin lab together on our files, but in addition we both worked alone on the project for equal amounts of time.