In this lab, you will design and implement a small FLTK program of
your own choosing.
- Your program should have a point to it: it should be "useful" in some way.
It doesn't have to be the next Microsoft Office, but there should be a
clearly defined purpose to the program, and it must be easy to use.
- You must research and use an advanced FLTK widget / feature
beyond what was covered in Lab0 (Fl_Box, Fl_Button, Fl_Input,
Fl_Menu*, etc.).
- Your code need not all be in Fluid: in fact, if your callbacks are
longer than one or two trivial lines, you should emphasize separation of logic
and layout: have a separate file (or two) for your callbacks.
Suggested project ideas
- Some suggestions to help you brainstorm:
- A basic image viewer: provide a way for a user to select an image file,
then display that image in a window. Allow the user to specify the filename
on the command line, too.
See ch5 of
the FLTK documentation.
(Hint: consider Fl_File_Chooser and Fl_JPEG_Image.)
- A program to graph exponential functions f(t)=Aert:
widgets to specify the initial population A and the growth rate r,
and a large box in which to draw the graph using line segments or Bezier
arcs. Update the graph whenever any one of the input widgets changes value.
See ch5 of
the FLTK documentation.
- A long-running program that makes use of the FL_Progress widget to
provide feedback to the user. Examples might include a program to find prime
numbers or solve a Knight's Tour (CMPT145 problems).
- A child's game to match pairs of cards ("Concentration"), similar
to this example.
(Hint: consider using buttons for the cards.)
- Be creative; have fun!
Lab write-up
- Follow the template lab write-up
to document your program. Name your write-up:
your_name_lab1_writeup.doc (or .txt, etc.)
Put it in the same project directory as your code so that it will be
included in the tarball.
Electronic turn-in
- Put everything (C++ code, header files, Fluid files, executable, lab
write-up) into a tarball and upload it to eCourses under "Lab1":
your_name_lab1.tar.gz