Write a children's "paint" program that lets users
draw colored circles and rectangles.
Use fltk for your GUI.
You can do this task in stages.
Stage 1:
Study a similar problem from Fall 1999 -->
Program 2
.
Change the xforms interface to fltk.
Note: fltk should be able to import xforms and save
the result as fltk.
Stage 2:
Modify the program to meet the following requirements:
Objects are created by rubber banding.
Circle centers are specified by the position of the mouse down event,
and its radius by the distance to the mouse up event.
Rectangles are defined by the position of two
diagonally opposite corners.
These two corners are specified by the positions
of the mouse down and mouse up events.
Use the left mouse button for creating objects.
All objects that have been created should be maintained by the program.
They are drawn from oldest to most recent, so that the most recent
object created can overlap (partially or completely) older objects.
Objects on the screen can be selected.
If a visible object is selected using the right button,
it is deleted from the list of objects in the scene.
If a visible object is selected using the middle button,
it is raised to the top (i.e. it becomes the most recently created object).
Attributes
Design a nice interface to allow users
to select colors for their objects,
and also whether they want a line (border only) drawing
or a filled object.
Grading.
We must be able to compile/test your code.
For this program,
we'll accept code and accompanying make/project files, etc.
for any platform that we (the course assistants) can get
their hands on to compile/run/test your program.
Be sure to include a README in your submission
as to which platform to use.
Also be sure to confirm with the course assistants that
the platform you're planning to submit is going to work out
for them or not.
If this multi-platform grading works,
we'll keep it around. If not, we'll revert back to the Suns platform grading.
Submission.
Submission must be done using the submit or xsubmit utility from CATS.
Run "quickhelp submit" on a CATS machine to find out more info.
Create and submit a subdirectory called "prog2". It should
contain all the files you have in make your program compile/run.
Remember that 20% of the grade is towards documentation/readability/style.
Last modified
Wednesday, 04-Apr-2001 10:17:17 PDT.